Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to gosnappi v0.12.1. #32

Merged
merged 2 commits into from
Aug 25, 2023
Merged

Upgrade to gosnappi v0.12.1. #32

merged 2 commits into from
Aug 25, 2023

Conversation

robshakir
Copy link
Contributor

* (M) e2e/simple_ondatra_test.go
   - Migrate integration test to new fields.
 * (M) flows/common/*
   - Switch to using uint64 for pps rate.
   - Switch to using list of rx port names, rather than a single port,
     although magna does not support >1 port.
 * (M) flows/mpls/mpls.go
   - Switch to using uint32 vs int32.
 * (M) lwotg/*
   - Consume new Connection rather than PortName.

Integration test result


I0824 23:44:10.111444   24755 topo.go:151] Trying in-cluster configuration
I0824 23:44:10.111484   24755 topo.go:154] Falling back to kubeconfig: "/usr/local/google/home/robjs/.kube/config"
I0824 23:44:10.112691   24755 topo.go:357] Adding Link: ate:eth1 mirror:eth1
I0824 23:44:10.112708   24755 topo.go:357] Adding Link: ate:eth2 mirror:eth2
I0824 23:44:10.112713   24755 topo.go:357] Adding Link: ate:eth3 mirror:eth3
I0824 23:44:10.112718   24755 topo.go:398] Adding Node: ate:OPENCONFIG
I0824 23:44:10.112737   24755 topo.go:398] Adding Node: mirror:HOST

*** Reserving the testbed...

I0824 23:44:10.113207   24755 topo.go:292] Topology:
name: "magna-integration"
nodes: {
  name: "ate"
  labels: {
    key: "ondatra-role"
    value: "ATE"
  }
  config: {
    command: "/app/magna"
    args: "-alsologtostderr"
    args: "-v=2"
    args: "-port=40051"
    args: "-telemetry_port=50051"
    args: "-certfile=/data/cert.pem"
    args: "-keyfile=/data/key.pem"
    image: "magna:latest"
    entry_command: "kubectl exec -it ate -- sh"
  }
  services: {
    key: 40051
    value: {
      name: "grpc"
      inside: 40051
    }
  }
  services: {
    key: 50051
    value: {
      name: "gnmi"
      inside: 50051
    }
  }
  vendor: OPENCONFIG
  model: "MAGNA"
  interfaces: {
    key: "eth1"
    value: {
      int_name: "eth1"
      peer_name: "mirror"
      peer_int_name: "eth1"
    }
  }
  interfaces: {
    key: "eth2"
    value: {
      int_name: "eth2"
      peer_name: "mirror"
      peer_int_name: "eth2"
      uid: 1
    }
  }
  interfaces: {
    key: "eth3"
    value: {
      int_name: "eth3"
      peer_name: "mirror"
      peer_int_name: "eth3"
      uid: 2
    }
  }
}
nodes: {
  name: "mirror"
  labels: {
    key: "ondatra-role"
    value: "DUT"
  }
  config: {
    command: "/app/mirror"
    command: "-alsologtostderr"
    image: "mirror:latest"
    entry_command: "kubectl exec -it mirror -- sh"
    config_path: "/etc"
    config_file: "config"
  }
  services: {
    key: 60051
    value: {
      name: "mirror-controller"
      inside: 60051
    }
  }
  vendor: HOST
  interfaces: {
    key: "eth1"
    value: {
      int_name: "eth1"
      peer_name: "ate"
      peer_int_name: "eth1"
    }
  }
  interfaces: {
    key: "eth2"
    value: {
      int_name: "eth2"
      peer_name: "ate"
      peer_int_name: "eth2"
      uid: 1
    }
  }
  interfaces: {
    key: "eth3"
    value: {
      int_name: "eth3"
      peer_name: "ate"
      peer_int_name: "eth3"
      uid: 2
    }
  }
}
links: {
  a_node: "ate"
  a_int: "eth1"
  z_node: "mirror"
  z_int: "eth1"
}
links: {
  a_node: "ate"
  a_int: "eth2"
  z_node: "mirror"
  z_int: "eth2"
}
links: {
  a_node: "ate"
  a_int: "eth3"
  z_node: "mirror"
  z_int: "eth3"
}
E0824 23:44:10.142899   24755 dut.go:271] Could not dial GNMI to dut mirror: service "gnmi" not found on DUT "mirror"
*** PROPERTY: test.path -> e2e
*** PROPERTY: build.path -> 
*** PROPERTY: build.main.version -> 
*** PROPERTY: git.commit -> 40ba2ddba6cd50356df365d191c9fef3da536c74
*** PROPERTY: git.clean -> false
*** PROPERTY: git.commit_timestamp -> 1692739020
*** PROPERTY: git.status -> M  flows/mpls/mpls_test.go
M  lwotg/intf_test.go
?? test.result
MM e2e/simple_ondatra_test.go
M  flows/common/common.go
M  flows/common/common_test.go
M  go.mod
M  go.sum
M  lwotg/intf.go

*** PROPERTY: topology -> ate:3,mirror:3
*** PROPERTY: build.go_version -> go1.22-20230729-RC00 cl/552016856 +457721cd52 X:fieldtrack,boringcrypto
*** PROPERTY: build.main.path -> 
*** PROPERTY: build.main.sum -> 
*** PROPERTY: git.origin -> [email protected]:openconfig/magna.git

********************************************************************************

  Testbed Reservation Complete
  ID: 91e4f3b2-743c-429c-b165-83e04e493b29

    mirror:           mirror
    port1:            eth1
    port2:            eth2
    port3:            eth3
    ate:              ate
    port3:            eth3
    port1:            eth1
    port2:            eth2

********************************************************************************

=== RUN   TestMirror
--- PASS: TestMirror (1.00s)
=== RUN   TestMPLS
    simple_ondatra_test.go:73: 
        *** Creating new config for ate...
        
        
    simple_ondatra_test.go:85: configuration for OTG is {
          "ports": [
            {
              "name": "port1"
            },
            {
              "name": "port2"
            },
            {
              "name": "port3"
            }
          ],
          "devices": [
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port1"
                  },
                  "mac": "02:00:01:01:01:01",
                  "mtu": 1500,
                  "name": "port1_ETH"
                }
              ],
              "name": "port1"
            },
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port2"
                  },
                  "mac": "02:00:02:01:01:01",
                  "mtu": 1500,
                  "name": "port2_ETH"
                }
              ],
              "name": "port2"
            },
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port3"
                  },
                  "mac": "03:00:03:01:01:01",
                  "mtu": 1500,
                  "name": "port3_ETH"
                }
              ],
              "name": "port3"
            }
          ]
        }
    simple_ondatra_test.go:87: 
        *** Pushing config to ate...
        
        
    simple_ondatra_test.go:245: 
        *** Pushing config to ate...
        
        
    simple_ondatra_test.go:247: Starting MPLS traffic...
    simple_ondatra_test.go:248: 
        *** Starting traffic on ate...
        
        
    simple_ondatra_test.go:249: Sleeping for 10s...
    simple_ondatra_test.go:251: Stopping MPLS traffic...
    simple_ondatra_test.go:252: 
        *** Stopping traffic on ate...
        
        
--- PASS: TestMPLS (14.07s)
=== RUN   TestMPLSFlowsTwoPorts
=== RUN   TestMPLSFlowsTwoPorts/two_flows_-_same_source_port
    simple_ondatra_test.go:73: 
        *** Creating new config for ate...
        
        
    simple_ondatra_test.go:85: configuration for OTG is {
          "ports": [
            {
              "name": "port1"
            },
            {
              "name": "port2"
            },
            {
              "name": "port3"
            }
          ],
          "devices": [
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port1"
                  },
                  "mac": "02:00:01:01:01:01",
                  "mtu": 1500,
                  "name": "port1_ETH"
                }
              ],
              "name": "port1"
            },
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port2"
                  },
                  "mac": "02:00:02:01:01:01",
                  "mtu": 1500,
                  "name": "port2_ETH"
                }
              ],
              "name": "port2"
            },
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port3"
                  },
                  "mac": "03:00:03:01:01:01",
                  "mtu": 1500,
                  "name": "port3_ETH"
                }
              ],
              "name": "port3"
            }
          ]
        }
    simple_ondatra_test.go:87: 
        *** Pushing config to ate...
        
        
    simple_ondatra_test.go:345: 
        *** Pushing config to ate...
        
        
    simple_ondatra_test.go:347: Starting MPLS traffic...
    simple_ondatra_test.go:348: 
        *** Starting traffic on ate...
        
        
    simple_ondatra_test.go:349: Sleeping for 10s...
    simple_ondatra_test.go:351: Stopping MPLS traffic...
    simple_ondatra_test.go:352: 
        *** Stopping traffic on ate...
        
        
    simple_ondatra_test.go:297: FLOW_ONE: recv: 10, sent: 10 packets
    simple_ondatra_test.go:297: FLOW_TWO: recv: 10, sent: 10 packets
=== RUN   TestMPLSFlowsTwoPorts/failure_-_two_flows,_one_that_is_not_mirrored
    simple_ondatra_test.go:73: 
        *** Creating new config for ate...
        
        
    simple_ondatra_test.go:85: configuration for OTG is {
          "ports": [
            {
              "name": "port1"
            },
            {
              "name": "port2"
            },
            {
              "name": "port3"
            }
          ],
          "devices": [
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port1"
                  },
                  "mac": "02:00:01:01:01:01",
                  "mtu": 1500,
                  "name": "port1_ETH"
                }
              ],
              "name": "port1"
            },
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port2"
                  },
                  "mac": "02:00:02:01:01:01",
                  "mtu": 1500,
                  "name": "port2_ETH"
                }
              ],
              "name": "port2"
            },
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port3"
                  },
                  "mac": "03:00:03:01:01:01",
                  "mtu": 1500,
                  "name": "port3_ETH"
                }
              ],
              "name": "port3"
            }
          ]
        }
    simple_ondatra_test.go:87: 
        *** Pushing config to ate...
        
        
    simple_ondatra_test.go:345: 
        *** Pushing config to ate...
        
        
    simple_ondatra_test.go:347: Starting MPLS traffic...
    simple_ondatra_test.go:348: 
        *** Starting traffic on ate...
        
        
    simple_ondatra_test.go:349: Sleeping for 10s...
    simple_ondatra_test.go:351: Stopping MPLS traffic...
    simple_ondatra_test.go:352: 
        *** Stopping traffic on ate...
        
        
    simple_ondatra_test.go:307: A->B: recv: 9, sent: 10 packets
    simple_ondatra_test.go:308: B->A: recv: 0, sent: 10 packets
=== RUN   TestMPLSFlowsTwoPorts/ten_flows
    simple_ondatra_test.go:73: 
        *** Creating new config for ate...
        
        
    simple_ondatra_test.go:85: configuration for OTG is {
          "ports": [
            {
              "name": "port1"
            },
            {
              "name": "port2"
            },
            {
              "name": "port3"
            }
          ],
          "devices": [
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port1"
                  },
                  "mac": "02:00:01:01:01:01",
                  "mtu": 1500,
                  "name": "port1_ETH"
                }
              ],
              "name": "port1"
            },
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port2"
                  },
                  "mac": "02:00:02:01:01:01",
                  "mtu": 1500,
                  "name": "port2_ETH"
                }
              ],
              "name": "port2"
            },
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port3"
                  },
                  "mac": "03:00:03:01:01:01",
                  "mtu": 1500,
                  "name": "port3_ETH"
                }
              ],
              "name": "port3"
            }
          ]
        }
    simple_ondatra_test.go:87: 
        *** Pushing config to ate...
        
        
    simple_ondatra_test.go:345: 
        *** Pushing config to ate...
        
        
    simple_ondatra_test.go:347: Starting MPLS traffic...
    simple_ondatra_test.go:348: 
        *** Starting traffic on ate...
        
        
    simple_ondatra_test.go:349: Sleeping for 10s...
    simple_ondatra_test.go:351: Stopping MPLS traffic...
    simple_ondatra_test.go:352: 
        *** Stopping traffic on ate...
        
        
    simple_ondatra_test.go:324: flow0: recv: 10, sent: 10 packets
    simple_ondatra_test.go:324: flow1: recv: 9, sent: 10 packets
    simple_ondatra_test.go:324: flow2: recv: 9, sent: 10 packets
    simple_ondatra_test.go:324: flow3: recv: 9, sent: 10 packets
    simple_ondatra_test.go:324: flow4: recv: 10, sent: 10 packets
    simple_ondatra_test.go:324: flow5: recv: 10, sent: 10 packets
    simple_ondatra_test.go:324: flow6: recv: 10, sent: 10 packets
    simple_ondatra_test.go:324: flow7: recv: 9, sent: 10 packets
    simple_ondatra_test.go:324: flow8: recv: 10, sent: 10 packets
    simple_ondatra_test.go:324: flow9: recv: 9, sent: 10 packets
--- PASS: TestMPLSFlowsTwoPorts (42.20s)
    --- PASS: TestMPLSFlowsTwoPorts/two_flows_-_same_source_port (14.05s)
    --- PASS: TestMPLSFlowsTwoPorts/failure_-_two_flows,_one_that_is_not_mirrored (14.06s)
    --- PASS: TestMPLSFlowsTwoPorts/ten_flows (14.09s)
=== RUN   TestMPLSFlowsThreePorts
=== RUN   TestMPLSFlowsThreePorts/one_flow_each
    simple_ondatra_test.go:73: 
        *** Creating new config for ate...
        
        
    simple_ondatra_test.go:85: configuration for OTG is {
          "ports": [
            {
              "name": "port1"
            },
            {
              "name": "port2"
            },
            {
              "name": "port3"
            }
          ],
          "devices": [
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port1"
                  },
                  "mac": "02:00:01:01:01:01",
                  "mtu": 1500,
                  "name": "port1_ETH"
                }
              ],
              "name": "port1"
            },
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port2"
                  },
                  "mac": "02:00:02:01:01:01",
                  "mtu": 1500,
                  "name": "port2_ETH"
                }
              ],
              "name": "port2"
            },
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port3"
                  },
                  "mac": "03:00:03:01:01:01",
                  "mtu": 1500,
                  "name": "port3_ETH"
                }
              ],
              "name": "port3"
            }
          ]
        }
    simple_ondatra_test.go:87: 
        *** Pushing config to ate...
        
        
    simple_ondatra_test.go:448: 
        *** Pushing config to ate...
        
        
    simple_ondatra_test.go:450: Starting MPLS traffic...
    simple_ondatra_test.go:451: 
        *** Starting traffic on ate...
        
        
    simple_ondatra_test.go:452: Sleeping for 10s...
    simple_ondatra_test.go:454: Stopping MPLS traffic...
    simple_ondatra_test.go:455: 
        *** Stopping traffic on ate...
        
        
    simple_ondatra_test.go:412: port1->port2: recv: 10, sent: 10 packets
    simple_ondatra_test.go:412: port3->port2: recv: 10, sent: 10 packets
=== RUN   TestMPLSFlowsThreePorts/ten_flows_on_each_port
    simple_ondatra_test.go:73: 
        *** Creating new config for ate...
        
        
    simple_ondatra_test.go:85: configuration for OTG is {
          "ports": [
            {
              "name": "port1"
            },
            {
              "name": "port2"
            },
            {
              "name": "port3"
            }
          ],
          "devices": [
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port1"
                  },
                  "mac": "02:00:01:01:01:01",
                  "mtu": 1500,
                  "name": "port1_ETH"
                }
              ],
              "name": "port1"
            },
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port2"
                  },
                  "mac": "02:00:02:01:01:01",
                  "mtu": 1500,
                  "name": "port2_ETH"
                }
              ],
              "name": "port2"
            },
            {
              "ethernets": [
                {
                  "connection": {
                    "choice": "port_name",
                    "port_name": "port3"
                  },
                  "mac": "03:00:03:01:01:01",
                  "mtu": 1500,
                  "name": "port3_ETH"
                }
              ],
              "name": "port3"
            }
          ]
        }
    simple_ondatra_test.go:87: 
        *** Pushing config to ate...
        
        
    simple_ondatra_test.go:448: 
        *** Pushing config to ate...
        
        
    simple_ondatra_test.go:450: Starting MPLS traffic...
    simple_ondatra_test.go:451: 
        *** Starting traffic on ate...
        
        
    simple_ondatra_test.go:452: Sleeping for 10s...
    simple_ondatra_test.go:454: Stopping MPLS traffic...
    simple_ondatra_test.go:455: 
        *** Stopping traffic on ate...
        
        
    simple_ondatra_test.go:426: port1->port2_0: recv: 10, sent: 10 packets
    simple_ondatra_test.go:426: port3->port2_0: recv: 9, sent: 10 packets
    simple_ondatra_test.go:426: port1->port2_1: recv: 9, sent: 10 packets
    simple_ondatra_test.go:426: port3->port2_1: recv: 9, sent: 10 packets
    simple_ondatra_test.go:426: port1->port2_2: recv: 9, sent: 10 packets
    simple_ondatra_test.go:426: port3->port2_2: recv: 9, sent: 10 packets
    simple_ondatra_test.go:426: port1->port2_3: recv: 9, sent: 10 packets
    simple_ondatra_test.go:426: port3->port2_3: recv: 10, sent: 10 packets
    simple_ondatra_test.go:426: port1->port2_4: recv: 10, sent: 10 packets
    simple_ondatra_test.go:426: port3->port2_4: recv: 10, sent: 10 packets
    simple_ondatra_test.go:426: port1->port2_5: recv: 10, sent: 10 packets
    simple_ondatra_test.go:426: port3->port2_5: recv: 10, sent: 10 packets
    simple_ondatra_test.go:426: port1->port2_6: recv: 9, sent: 10 packets
    simple_ondatra_test.go:426: port3->port2_6: recv: 9, sent: 10 packets
    simple_ondatra_test.go:426: port1->port2_7: recv: 9, sent: 10 packets
    simple_ondatra_test.go:426: port3->port2_7: recv: 9, sent: 10 packets
    simple_ondatra_test.go:426: port1->port2_8: recv: 10, sent: 10 packets
    simple_ondatra_test.go:426: port3->port2_8: recv: 9, sent: 10 packets
    simple_ondatra_test.go:426: port1->port2_9: recv: 10, sent: 10 packets
    simple_ondatra_test.go:426: port3->port2_9: recv: 9, sent: 10 packets
--- PASS: TestMPLSFlowsThreePorts (28.13s)
    --- PASS: TestMPLSFlowsThreePorts/one_flow_each (14.05s)
    --- PASS: TestMPLSFlowsThreePorts/ten_flows_on_each_port (14.08s)
PASS

*** Releasing the testbed...

*** PROPERTY: time.begin -> 1692920650
*** PROPERTY: time.end -> 1692920735
ok  	command-line-arguments	86.586s

 * (M) e2e/simple_ondatra_test.go
   - Migrate integration test to new fields.
 * (M) flows/common/*
   - Switch to using uint64 for pps rate.
   - Switch to using list of rx port names, rather than a single port,
     although magna does not support >1 port.
 * (M) flows/mpls/mpls.go
   - Switch to using uint32 vs int32.
 * (M) lwotg/*
   - Consume new Connection rather than PortName.
@github-actions
Copy link

github-actions bot commented Aug 24, 2023

Pull Request Test Coverage Report for Build 5970091146

  • 13 of 13 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 61.268%

Totals Coverage Status
Change from base Build 5944147060: 0.3%
Covered Lines: 995
Relevant Lines: 1624

💛 - Coveralls

Copy link

@jasdeep-hundal jasdeep-hundal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, Ondatra hasn't been upgraded to gosnappi 0.12.1 yet (would break featureprofiles, pending openconfig/featureprofiles#2044), but the gosnappi changes are backwards-compatible.

@robshakir
Copy link
Contributor Author

Thanks -- that's good to understand. I think at the moment the only test in featureprofiles that magna supports is the gRIBI MPLS ones, since it doesn't support IP flow generation. So this is probably good to move ahead with.

Thanks for taking a look.

@robshakir robshakir merged commit ea83683 into main Aug 25, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants