Git Product home page Git Product logo

ondatra's Introduction

Actions Status Go Report Card GoDoc License: BSD

Ondatra: Open Network Device Automated Test Runner and API

Ondatra is a framework for writing and running tests against both real and containerized network devices.

For an introduction to Ondatra, take the Ondatra Tour.

Building Ondatra

To build and execute Ondatra's unit tests, run the following:

go generate ./...
go build ./...
go test $(go list ./... | grep -v /integration)

Providing a Binding

The Ondatra binding is the API layer through which Ondatra connects to and controls the devices in your test environment. For an Ondatra test to run in your environment, you must provide an implementation of the Binding interface. For testing on KNE, Ondatra comes bundled with a binding implementation for accessing KNE on your local machine. For testing on your physical devices, read how to author your own Binding implementation.

Testbed File

To run an Ondatra test, the user must specify the testbed of resources that the Ondatra test runner should reserve in advance. The testbed is specified in an external text file in protobuf text format. The protobuf Testbed message is defined in proto/testbed.proto, and an example testbed can be found in knebind/integration/testbed.textproto. As the proto definition and example show, testbed consists of the DUTs (devices under test), ATEs (automated test equipment), the links between them, as well as properties of the DUTs, ATEs, and links. It is the job of the Reserve method in the binding implementation to locate available resources that match the abstract topology and criteria specified in the testbed file.

Writing an Ondatra Test

Ondatra provides a set of fluent interfaces for configuring and interacting with network devices. The interfaces are divided into several API packages:

  • Config provides an API to set native config on devices via vendor-specific (non-gNMI) protocols.
  • Console provides an API to interact with the serial console of a device.
  • Debug provides an API to add breakpoints to the test to debug its execution.
  • Event Listener provides an API to attach listeners that are called at events during the test execution.
  • gNMI provides an API for querying telemetry and setting the state of the device via gNMI.
  • Netutil provides a collection of network-related helper methods for testing.
  • OTG provides an API to generate traffic using Open Traffic Generator.
  • Raw provides low-level access to the raw device APIs, to be used when the other higher-level APIs are not sufficient.
  • Report provides an API to add properties to, and extract properties from, the JUnit XML test report.

See the full API reference documentation.

Running an Ondatra Test

An Ondatra test is a Go test, and so is run with go test, albeit with some additional flags to control the execution of the test:

  • -testbed (required): Path to the testbed text proto file.
  • -wait_time (optional): Maximum amount of time the test should wait until the testbed is ready. If not specified, the binding chooses the amount of time to wait.
  • -run_time (optional): Timeout of the test run, excluding the wait time for the testbed to be ready. If not specified, no limit is imposed.
  • -xml (optional): File path to write JUnit XML test results; disables normal Go test logging.
  • -debug (optional): Whether the test is run in debug mode.
  • -reserve (optional): Reservation id or a mapping of device and port IDs to names; allowed only in debug mode

To run a subset of the test cases of an Ondatra test, use the Go test -run flag. While the -run flag accepts an arbitrary Go regexp, to match a single test case it is usually sufficient to just pass the name of the test function:

$ go test -testbed=testbed.textproto -config=config.yaml -run=$RUN_THIS_TEST_CASE

Read the Go doc on subtests for more details on matching subtests with the -run flag.

Debugging an Ondatra Test

To run an Ondatra test in debug mode, pass the -debug flag to go test. Debug mode allows you to insert breakpoints in your code using the Debug API.

Debug mode also offers a menu option to pause the test immediately after the testbed is reserved. This is useful if you want to manually inspect the testbed before the test cases run, or to run a separate test execution against with the same reservation.

To debug a test against a pre-allocated reservation, set the -reserve flag to the reservation ID:

$ go test -testbed=testbed.textproto -config=config.yaml -debug -reserve=123abc

To debug the test against specifically-named devices, set the -reserve flag to a comma-separated list of id=name strings at the command line, where ports are named with the syntax deviceID:portID=portName:

$ go test -testbed=testbed.textproto -config=config.yaml -debug \
    -reserve=dut=mydevice,dut:port1=Ethernet1/1,ate=myixia,ate:port2=2/3

Logging Verbosity

Ondatra always sets the Go test -v flag to true for verbose test output, so there is no need to set this flag explicitly in your test invocations.

Ondatra uses glog for its own logging. By default, glog logs to a temporary dir, but setting the -alsologtostderr flag will output those logs to stderr. You can increase the verbosity glog by setting its -v flag to a positive integer. Increasing the value of v produces increasingly verbose and granular details in the logs, as outlined in this table:

Log Level Example Information
1 SetRequest/SubscribeRequest dumps
2 Each Update/Delete received in a SubscribeResponse
3 Ixia gNMI translation details

Because go test has its own -v flag, setting glog's -v value must be preceded by -args to avoid it being interpreted by go test itself. For example:

go test -alsologtostderr -args -v=1

See the glog package documentation for more information on all the glog flags.

XML Test Report

Ondatra has the ability to output test results in JUnit XML format. If you pass -xml=[path] to your go test invocation, Ondatra will use go-junit-report to translate the Go test log to an XML file at the provided path. To attach properties to the XML report and to programmatically parse the XML file use the Ondatra Report API.

Testing on KNE

You don't have to code your own binding implementation before getting started with Ondatra, because Ondatra comes packaged with a binding for KNE, and an example Ondatra test that uses that binding. See the knebind README for more on how to use the KNE binding and run the example test.

ondatra's People

Contributors

dependabot[bot] avatar greg-dennis avatar marcushines avatar robshakir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ondatra's Issues

Feature request - need a way to retrieve BGP As path Learned info in ATE

Hi,

Similar to issue #42 , we need support to retrieve as-path info from BGP rib on ATE.

Ixia ondatra API currently supports retrieving MED info in BGP Rib, but we don't have as-path retrieval support.

rib := at.NetworkInstance(ap.Name()).Protocol(telemetry.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP Peer 1").Bgp().Rib()
med := rib.AttrSet(0).ASPATH().Get(t) ==> This is needed.

Thanks,
Prabha

P4RT Client for ONDATRA

The OC "Feature Profile" set of tests includes a series of P4RT related cases. It appears that a stub of a p4rt client implementation is included here, however a full implementation must be done before p4rt can be tested. Is work currently underway to develop this?

gnmi.GetConfig: unmarshalling error because of unexpected leaf

Hi, gnmi.GetConfig fails when there is an additional leaf in the response. The additional fields issue is expected due to the recurring update in oc models. I think none of the gnmi api should fail due to the additional field. Here is the failure log.

I0110 08:52:20.806932   20309 gnmi.go:120] prefix:  {
  target:  "R3-10.85.84.51:2014"
}
path:  {
  origin:  "openconfig"
  elem:  {
    name:  "network-instances"
  }
  elem:  {
    name:  "network-instance"
    key:  {
      key:  "name"
      value:  "VRF-1"
    }
  }
}
type:  CONFIG
encoding:  JSON_IETF
I0110 08:52:20.871681   20309 gnmi.go:237] subscribe ONCE stream closed without sync_response.
I0110 08:52:20.873722   20309 ygnmi.go:250] noncompliant data encountered while unmarshalling: Noncompliance Errors by category:
Path Noncompliance Errors: None
Type Noncompliance Errors:
  Unmarshal json_ietf_val:"{\n \"name\": \"VRF-1\",\n \"config\": {\n  \"name\": \"VRF-1\",\n  \"type\": \"openconfig-network-instance-types:L3VRF\",\n  \"enabled\": true\n },\n \"interfaces\": {\n  \"interface\": [\n   {\n    \"id\": \"TenGigE0/0/0/1/0\",\n    \"config\": {\n     \"id\": \"TenGigE0/0/0/1/0\",\n     \"interface\": \"TenGigE0/0/0/1/0\",\n     \"subinterface\": 0\n    }\n   }\n  ]\n }\n}\n" into origin:"openconfig"  elem:{name:"network-instances"}  elem:{name:"network-instance"  key:{key:"name"  value:"VRF-1"}}: datapoint path "/network-instances/network-instance[name=VRF-1]" (value json_ietf_val:"{\n \"name\": \"VRF-1\",\n \"config\": {\n  \"name\": \"VRF-1\",\n  \"type\": \"openconfig-network-instance-types:L3VRF\",\n  \"enabled\": true\n },\n \"interfaces\": {\n  \"interface\": [\n   {\n    \"id\": \"TenGigE0/0/0/1/0\",\n    \"config\": {\n     \"id\": \"TenGigE0/0/0/1/0\",\n     \"interface\": \"TenGigE0/0/0/1/0\",\n     \"subinterface\": 0\n    }\n   }\n  ]\n }\n}\n") cannot be unmarshalled: rpc error: code = Unknown desc = failed to update struct *oc.NetworkInstance with value json_ietf_val:"{\n \"name\": \"VRF-1\",\n \"config\": {\n  \"name\": \"VRF-1\",\n  \"type\": \"openconfig-network-instance-types:L3VRF\",\n  \"enabled\": true\n },\n \"interfaces\": {\n  \"interface\": [\n   {\n    \"id\": \"TenGigE0/0/0/1/0\",\n    \"config\": {\n     \"id\": \"TenGigE0/0/0/1/0\",\n     \"interface\": \"TenGigE0/0/0/1/0\",\n     \"subinterface\": 0\n    }\n   }\n  ]\n }\n}\n"; parent container network-instance (type *oc.NetworkInstance): JSON contains unexpected field enabled
Value Restriction Noncompliance Errors: None
    gnmi.go:140: Get(t) on dut(R3-10.85.84.51:2014) at &{{NetworkInstance false 0xc0059de4c0 [] 0xc002154120}}: path origin:"openconfig"  elem:{name:"network-instances"}  elem:{name:"network-instance"  key:{key:"name"  value:"VRF-1"}}: value not present

This issue causing fp tests (e.g., https://github.com/openconfig/featureprofiles/blob/04860e1abb6139d8135a8f46fa46bb7c8553c128/feature/gribi/ate_tests/hierarchical_weight_resolution_test/hierarchical_weight_resolution_test.go#L286) that query /network-instance/[name="vrf-name"] to fail.

feat: UseGetForConfig for Nokia

👋 hello!

it looks like we'll need to add nokia to the vendors that are using get for config gnmi option here. would somebody be able to make that change here pretty please?

go generate ./... and go build ./... errors

when I tried to run go generate ./... and go build ./... these are the errors/issues I am facing help me out. I am using go 1.21 version

root@avi-virtualbox:~/ondatra$ go generate ./...
generate.go:18: running "./gnmi/generate.sh": exit status 1

root@avi-virtualbox:~/ondatra$ go build ./...

github.com/openconfig/ondatra/binding

binding/binding.go:182:57: undefined: gosnappi.GosnappiApi
binding/abstract.go:168:76: undefined: gosnappi.GosnappiApi

Support for setting EtherType of EthernetHeader in ATE

When we start to try to develop testcases related Packet I/O, we notice setting Ethernet-Type function is missing from Ondatra. Rightnow we can set src MAC, dst MAC, Vlan and CRC in ATE traffic item. In order to send traffic as LLDP(Ethernet-Type: 0x88cc), we need to find a way to set Ethernet-Type in ATE traffic item.

Need ATE API to set license server

Hi, this request is to add support for reading the ATE license server IP from the Ondatra binding file and configuring it at run time through an ATE API.

Thanks!

bootz oc model

please add support for release/models/system/openconfig-system-bootz.yang.

Ondatra does not support capture

If I get a raw API object, then I can do capture, so some supported devices do support capture natively. But the APIs will vary between devices, and so are not guaranteed to be portable. Please add capture support to Ondatra.

User replace operation password node as state leaf in Request

Doing a replace operation on User with below test https://github.com/openconfig/featureprofiles/blob/00a6330e677c649b0c7a1fb869411905312b9812/feature/experimental/security/aaa/kne_tests/tls_authentication_over_grpc_test/tls_authentication_over_grpc_test.go#L79
In replace operation password node is coming as state leaf

I1107 11:03:25.292024  493966 genutil.go:687] SetRequest:
prefix:  {
  origin:  "openconfig"
}
replace:  {
  path:  {
    elem:  {
      name:  "system"
    }
    elem:  {
      name:  "aaa"
    }
    elem:  {
      name:  "authentication"
    }
    elem:  {
      name:  "users"
    }
    elem:  {
      name:  "user"
      key:  {
        key:  "username"
        value:  "cisco"
      }
    }
  }
  val:  {
    json_ietf_val:  "{\n  \"openconfig-system:config\": {\n    \"username\": \"cisco\"\n  },\n  \"openconfig-system:state\": {\n    \"password\": \"cisco123\"\n  },\n  \"openconfig-system:username\": \"cisco\"\n}"
  }
}
 
-------replace path/value pair #0------
/system/aaa/authentication/users/user[username=cisco]
{
  "openconfig-system:config": {
    "username": "cisco"
  },
  "openconfig-system:state": {
    "password": "cisco123"
  },
  "openconfig-system:username": "cisco"
}

Both user and password nodes should be config

Not seeing a shadow path for Password in System_Aaa_Authentication_User for config

type System_Aaa_Authentication_User struct {

type System_Aaa_Authentication_User struct {
                AuthorizedKeysListCreatedOn  *uint64                                   `path:"state/authorized-keys-list-created-on" module:"openconfig-system/gnsi-ssh"`
                AuthorizedKeysListVersion    *string                                   `path:"state/authorized-keys-list-version" module:"openconfig-system/gnsi-ssh"`
                AuthorizedUsersListCreatedOn *uint64                                   `path:"state/authorized-users-list-created-on" module:"openconfig-system/gnsi-ssh"`
                AuthorizedUsersListVersion   *string                                   `path:"state/authorized-users-list-version" module:"openconfig-system/gnsi-ssh"`
                Password                     *string                                   `path:"state/password" module:"openconfig-system/openconfig-system"`
                PasswordCreatedOn            *uint64                                   `path:"state/password-created-on" module:"openconfig-system/gnsi-console"`
                PasswordHashed               *string                                   `path:"state/password-hashed" module:"openconfig-system/openconfig-system"`
                PasswordVersion              *string                                   `path:"state/password-version" module:"openconfig-system/gnsi-console"`
                Role                         System_Aaa_Authentication_User_Role_Union `path:"state/role" module:"openconfig-system/openconfig-system" shadow-path:"config/role" shadow-module:"openconfig-system/openconfig-system"`
                Username                     *string                                   `path:"state/username|username" module:"openconfig-system/openconfig-system|openconfig-system" shadow-path:"config/username|username" shadow-module:"openconfig-system/openconfig-system|openconfig-system"`
}

crafting VLAN tagged frames

I am looking to create a VLAN tagged GDP frame as below:
00 0A DA F0 F0 F0 00 AA 00 AA 00 AA 81 00 00 0A 60 07 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F

Currently

func (h *EthernetHeader) WithEtherType(etherType uint32) *EthernetHeader {

Allows the add EtherType for an Ethernet Frame using WithEtherType, and
func (h *EthernetHeader) WithVLANID(vid uint16) *EthernetHeader {
allows to add a VLAN tag using WithVLANID.

WithEtherType is allowing to modify the EtherType in untagged Ethernet frame or TPID in tagged frame. But I am unable to modify the Type/Protocol-ID (0x6007 for GDP) following 802.1Q Header.
Refer: https://en.wikipedia.org/wiki/IEEE_802.1Q

Have tried following:

  1. (results in an untagged GDP frame, second WithEtherType overwrites first)
    ethHeader := ondatra.NewEthernetHeader()
    ethHeader.WithSrcAddress(*gdp.SrcMAC)
    ethHeader.WithDstAddress(*gdp.DstMAC)
    ethHeader.WithEtherType(*ygot.Uint32(0x8100))
    ethHeader.WithVLANID(10)
    ethHeader.WithEtherType(*ygot.Uint32(0x6007))
  2. (results in an untagged GDP frame, VLAN tag appears as payload)
    ethHeader := ondatra.NewEthernetHeader()
    ethHeader.WithSrcAddress(*gdp.SrcMAC)
    ethHeader.WithDstAddress(*gdp.DstMAC)
    ethHeader.WithEtherType(*ygot.Uint32(0x6007))
    ethHeader.WithVLANID(10)

Errors while building and execute Ondatra's unit tests - ondatra 1.19 and 1.21 dependencies (FAIL github.com/openconfig/ondatra [build failed])

Hi Team,

Tried the same procedure which is being mentioned with readme doc in gitbug. Got below dependency messages with go build and go test. Eventually tried with both 1.19 and 1.21 for go build and for go test but hitting below error. I have attached logs as well, please let me know if anything needs to be changes with the approach I have taken

root@anu-VirtualBox:/home/anu/ondatra# go build ./...

github.com/golang/glog

/root/go/pkg/mod/github.com/golang/[email protected]/glog_file_other.go:27:6: abortProcess redeclared in this block
/root/go/pkg/mod/github.com/golang/[email protected]/glog_file_linux.go:33:6: other declaration of abortProcess
note: module requires Go 1.19

google.golang.org/grpc

/root/go/pkg/mod/google.golang.org/[email protected]/server.go:2082:14: undefined: atomic.Int64
note: module requires Go 1.19

root@anu-VirtualBox:/home/anu/ondatra# go test -testbed=testbed.textproto -config=config.yaml -run=$RUN_THIS_TEST_CASE

github.com/openconfig/ondatra/gnmi/oc

gnmi/oc/enum.go:88:2: imported and not used: "encoding/json"
gnmi/oc/enum.go:89:2: imported and not used: "fmt"
gnmi/oc/enum.go:90:2: imported and not used: "reflect"
gnmi/oc/enum.go:93:2: imported and not used: "github.com/openconfig/goyang/pkg/yang"
gnmi/oc/enum.go:94:2: imported and not used: "github.com/openconfig/ygot/ytypes"
gnmi/oc/enum_map.go:88:2: imported and not used: "encoding/json"
gnmi/oc/enum_map.go:89:2: imported and not used: "fmt"
gnmi/oc/enum_map.go:93:2: imported and not used: "github.com/openconfig/goyang/pkg/yang"
gnmi/oc/enum_map.go:94:2: imported and not used: "github.com/openconfig/ygot/ytypes"
gnmi/oc/schema.go:88:2: imported and not used: "encoding/json"
gnmi/oc/schema.go:88:2: too many errors
note: module requires Go 1.21

github.com/openconfig/ondatra/gnmi/otg

gnmi/otg/enum.go:25:2: imported and not used: "encoding/json"
gnmi/otg/enum.go:26:2: imported and not used: "fmt"
gnmi/otg/enum.go:27:2: imported and not used: "reflect"
gnmi/otg/enum.go:30:2: imported and not used: "github.com/openconfig/goyang/pkg/yang"
gnmi/otg/enum.go:31:2: imported and not used: "github.com/openconfig/ygot/ytypes"
gnmi/otg/enum_map.go:25:2: imported and not used: "encoding/json"
gnmi/otg/enum_map.go:26:2: imported and not used: "fmt"

gnmi/otg/enum_map.go:30:2: imported and not used: "github.com/openconfig/goyang/pkg/yang"
gnmi/otg/enum_map.go:31:2: imported and not used: "github.com/openconfig/ygot/ytypes"
gnmi/otg/schema.go:25:2: imported and not used: "encoding/json"
gnmi/otg/schema.go:25:2: too many errors
note: module requires Go 1.21

Regards,
Anu

Ondatra_logs.txt

Remove null value from ixconfig generated traffic config

Marshal of ixconfig is creating xpath contain null / black array value

{
   "xpath": "/traffic/trafficItem[1]/configElement[1]/stack[@alias = 'ipv4-2']/field[@alias = 'ipv4.header.version-1']",
   "valueList": []
},
{
   "xpath": "/traffic/trafficItem[1]/configElement[1]/stack[@alias = 'ipv4-2']/field[@alias = 'ipv4.header.headerLength-2']",
   "valueList": []
}

It will create huge unnecessary entry for large configuration which will add more performance overhead. So, it will better to remove those null value from traffic config.

ISIS Neighbor attribute retrieval

Hi,

We need to retrieve ISIS neighbor attributes like overload bit, metric from ATE LSDB information.

Below is test scenario which we are trying to validate.

Validate that received LSDB on ATE has:

1.) Overload bit unset by default, change overload bit to set via DUT configuration, and ensure that the overload bit is advertised as set (as observed by the ATE). Ensure that DUT telemetry reflects the overload bit is set.

2.) Metric is set to the specified value for ATE port-1 facing DUT port via configuration, update value in configuration, and ensure that ATE and DUT telemetry reflects the change.

On DUT we are using below OC Paths to set overload bit and metric.

/openconfig-network-instance/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/afi-safi/af/config/metric.

/openconfig-network-instance/network-instances/network-instance/protocols/protocol/isis/global/lsp-bit/overload-bit/config/set-bit

WBB Testcase which needs this support: gnmi 1.3, RT 2.2

Thanks,
Prabha

Feature request - need a way to set test timeout value from within a test

Hi, I am looking to set the RunTime timeout value for a test to something other than the default value of 10 minutes. Is there a way to set it from within the featureprofiles testcase and pass it through fptest.RunTests() to ondatra.RunTests() or set it as a flag inside the test? Had originally reported this under featureprofiles repo: openconfig/featureprofiles#202

Thanks!

PS: I have used the parameter '-run_time' to set a desired timeout value when executing a test from the command line. Looking for something that I could set within the Ondatra test itself, so the user of the test does not need to worry about it when executing.

issue seen while configuring Level 1 and 2 together in ATE

I am trying to configure ISIS level 1 and level 2 for one port in ATE. But I am observing the level is getting overwritten with the later value.
How can I combine level1+2 in the code.

Below is the code I am using:

func configureATE(t *testing.T, ate *ondatra.ATEDevice) *ondatra.ATETopology {
topo := ate.Topology().New()

port1 := ate.Port(t, "port1")
iDut1 := topo.AddInterface(atePort1.Name).WithPort(port1)
iDut1.IPv4().WithAddress(atePort1.IPv4CIDR()).WithDefaultGateway(dut1Port1.IPv4)
iDut1.IPv6().WithAddress(atePort1.IPv6CIDR()).WithDefaultGateway(dut1Port1.IPv6)

// Configure ISIS on Port1, required for multihop iBGP.
isisDut1 := iDut1.ISIS()
isisDut1.WithLevelL2().

WithNetworkTypePointToPoint().
WithTERouterID(atePort1.IPv4).
WithLevelL1()

RT-2.7_ancx: Ixia is not sending isis packets with authentication except for hello

Hi Team,

Below ATE code is not sending isis packets(lsp,psnp,csnp) with authentication . Only isis hello packets are send with authentication.Please help to resolve.

func addISISTopo(iface *ondatra.Interface, areaAddress, sysID string) {
isis := iface.ISIS()
isis.
WithAreaID(areaAddress).
WithTERouterID(sysID).
WithNetworkTypePointToPoint().
WithWideMetricEnabled(true).
WithLevelL2().WithMetric(10).
WithAuthMD5("google"). >>>>>>>>>>>>>>>>>>>>>this is the authentication config
WithHelloPaddingEnabled(true)

}

Entity-Id leaf on oc-platform not found using ondatra

The below path is not found on ondatra under the openconfig-platform model:
“/components/component/state/oc-platform-ext:entity-id”

Due to this when get is done at the component container level we see an unmarshall error at entity-id.
The gNMI subscribe req:
subscribe: {
prefix: {
target: "DUT"
}
subscription: {
path: {
origin: "openconfig"
elem: {
name: "components"
}
elem: {
name: "component"
key: {
key: "name"
value: "0/0/CPU0-QSFP_DD Optics Port 35"
}
}
}
}
mode: ONCE
encoding: PROTO
}

I1109 10:01:12.385033 777 genutil.go:992] Received gNMI SyncResponse.
I1109 10:01:12.389044 777 schema_helpers.go:53] noncompliant data encountered while unmarshalling: Noncompliance Errors by category:
Path Noncompliance Errors:
Unmarshal uint_val:8528 into origin:"openconfig" elem:{name:"components"} elem:{name:"component" key:{key:"name" value:"0/0/CPU0-QSFP_DD Optics Port 35"}} elem:{name:"state"} elem:{name:"entity-id"}: rpc error: code = InvalidArgument desc = no match found in *telemetry.Component, for path elem:{name:"state"} elem:{name:"entity-id"}
Type Noncompliance Errors: None
Value Restriction Noncompliance Errors: None

The entity-id has not been added recently according to https://github.com/openconfig/public/blob/624655d053ad1fdda62901c7e2055c22cd5d6a05/release/models/platform/openconfig-platform-ext.yang

No option available to set media type in ATE

Currently there is no option available to set media type (copper/fiber) for ATE ports. Some card models in Ixia that supports Fiber or Copper connections on the same port (e.g. NOVUS10/1GE16DP) defaults to media type Copper. When physical topology is built with fiber connections on such Ixia cards, running ondatra scripts require setting a breakpoint after loading the ATE topology and manually changing the media type in IxNetwork Web UI.

LookupConfig fails test when path does not exist

Currently, LookupConfig on a path that does not exist causes the test to fail whenever the server returns NOT_FOUND (and useGetForCfg is set). This causes multiple featureprofiles tests to fail.

According to the specs NOT_FOUND is the expected response. However, shouldn't LookupConfig handle that error by setting value.present to false? or at least, shouldn't errors be returned to the tests to deal with rather than failing the tests? I believe that was the behaviour in the old API.

Logging for GNMI.GetRequest

Thanks for adding the support for GNMI Get for config nodes. The current logging (

log.V(1).Info(prototext.Format(sr))
) is a little confusing since it shows a subscribe message is sent with encoding as PROTO which is not right. Can you please move the logging before sending the get request
resp, err := gs.client.Get(gs.ctx, getReq)
,i.e.,

	log.V(1).Info(prototext.Format(getReq))
	resp, err := gs.client.Get(gs.ctx, getReq)

gnmi.GetAll does not return containers with path complaince issue

Hi, when we do components := gnmi.GetAll[*oc.Component](t, dut, gnmi.OC().ComponentAny().State()) the returned data by device for some components has leaves with path compliance issues that is expected due to the model versioning. However, it seems gnmi.GetAll ignore those components, i.e., the returned list does not contain those components. For example: I see the following path compliance issue for 0/0/CPU0 that results in not including the component 0/0/CPU0 in the returned list (components). the simple gnmi.Get does not have this issue.

Path Noncompliance Errors:
	Unmarshal string_val:"POWER_ENABLED" into origin:"openconfig" elem:{name:"components"} elem:{name:"component" key:{key:"name" value:"0/0/CPU0"}} elem:{name:"linecard"} elem:{name:"state"} elem:{name:"power-admin-state"}: path "/components/component[name=0/0/CPU0]/linecard/state/power-admin-state" is invalid and cannot be matched to a generated GoStruct field: rpc error: code = InvalidArgument desc = no match found in *oc.Component, for path elem:{name:"linecard"} elem:{name:"state"} elem:{name:"power-admin-state"}
	Unmarshal string_val:"0/0/CPU0" into origin:"openconfig" elem:{name:"components"} elem:{name:"component" key:{key:"name" value:"0/0/CPU0"}} elem:{name:"linecard"} elem:{name:"state"} elem:{name:"slot-id"}: path "/components/component[name=0/0/CPU0]/linecard/state/slot-id" is invalid and cannot be matched to a generated GoStruct field: rpc error: code = InvalidArgument desc = no match found in *oc.Component, for path elem:{name:"linecard"} elem:{name:"state"} elem:{name:"slot-id"}
Type Noncompliance Errors: None
Value Restriction Noncompliance Errors: None

This issue impacts gnoi tests that use FindComponentsByType: https://github.com/openconfig/featureprofiles/blob/3400fd8c2473d2f0a8e239bcfa0e6348184f401d/internal/components/components.go#L34.

Feature request - need a way to retrieve ISIS Learned info in ATE

Use-case: ISIS feature profile tests would be needing ISIS metrics which would in turn, would require to get some learned info of the ISIS LSPS

So currently I see there are ways we can fetch Isis metrics like the below snippet:

isis := at.NetworkInstance(ap.Name()).Protocol(telemetry.PolicyTypes_INSTALL_PROTOCOL_TYPE_ISIS, fmt.Sprintf("isis-%s", ap.Name())).Isis()
isis.LevelAny().LspAny().IsType().Get(t)
isis.LevelAny().LspAny().Flags().Get(t)
isis.LevelAny().LspAny().LspId().Get(t)

But they return empty results.
So I guess we need to populate these with the result fetched from ATE .

I see a similar effort was done for BGP in the following files
https://github.com/openconfig/ondatra/blob/main/internal/ixgnmi/ixgnmi.go
https://github.com/openconfig/ondatra/blob/main/internal/ixgnmi/learnedinfo.go

Probably would be needing similar kind of support for ISIS as well.

Please let me know If I have missed something

Data type mismatch error while running RT1.3 test

Hi,

We are getting below error while running RT1.3 test with latest ondatra repo.
Please could you check .

route_propagation_test.go:317: Await(t) on ate(10.48.16.92) at &{{NetworkInstance_Protocol_Bgp_Rib_AfiSafi_Ipv4Unicast_Neighbor_AdjRibInPre_Route true 0xc0020e1650 0x8b92b00 0x8b92ba0 0xc00212bf20 true}}: error receiving gNMI response: failed to render notifications: cannot represent field value [0xc001e70f60] as TypedValue for path /network-instances/network-instance[name=port2]/protocols/protocol[identifier=BGP][name=0]/bgp/rib/attr-sets/attr-set[index=0]/as-path/as-segment: invalid type ptr in leaflist

Script link: https://github.com/openconfig/featureprofiles/blob/main/feature/bgp/addpath/ate_tests/route_propagation_test/route_propagation_test.go

Code:

if prefix.v4 != "" {
_, found := gnmi.Watch(t, ate, rib.AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Ipv4Unicast().
Neighbor(tc.ate.Port2Neighbor).
AdjRibInPre().
Route(prefix.v4, 0).
AttrIndex().State(), 1*time.Minute, func(i *ygnmi.Value[uint64]) bool {
return i.IsPresent()
}).Await(t)

Thanks,
Prabha

delay issue when validating data with gnmi.GetAll/CollectAll

After switching from device.Telemetry().NetworkInstanceAny().Afts().Ipv4EntryAny().Collect(t, subscriptionDuration).Await(t) to gnmi.CollectAll(t, device, gnmi.OC().NetworkInstanceAny().Afts().Ipv4EntryAny().State(),subscriptionDuration).Await(t) , we are seeing larger delay when trying to get 60k ipv4 prefixes. It took forever for backend to validate the data. That step stuck more then 30 minutes. We did not experience same delay with older lib.

support needed to get RouteAnyPrefix() leaf and AsPath() leaves for BGP Rib

Hi,

I have to get AsPath for all the prefixes in rib . Below is not supported, please could you check,
I have highglighed unsupported leaf in bold.

rib := at.NetworkInstance(ap.Name()).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, fmt.Sprintf("bgp-%s", ap.Name())).Bgp().Rib()
prefixPath := rib.AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Ipv4Unicast().
Neighbor(setup.DUTIPList[ap.ID()].String()).AdjRibInPre().RouteAnyPrefix(0).Prefix()
pref := gnmi.Get(t, dut, prefixPath.State())
asPath := gnmi.Get(t, dut, rib.AttrSetAny().AsPath().State())

Thanks,
Prabha

gNMI stat fetch is failing for OTG non-leaf nodes specified in models-yang

Issue Description

while fetching OTG gNMI stats using ondatra for non-leaf nodes we are facing some type error while unmarshalling, but it is not printed directly in the console though, in console its just showing No Value Present.

After adding some debug statements inside unmarshal function of internal/gnmigen/genutil.go, we found out the following error.

&{origin:"openconfig"  elem:{name:"ports"}  elem:{name:"port"  key:{key:"name"  value:"port2"}}  elem:{name:"state"}  elem:{name:"counters"} 0001-01-01 00:00:00 +0000 UTC 0001-01-01 00:00:00 +0000 UTC Noncompliance Errors by category: 
 
Path Noncompliance Errors: None 
 
Type Noncompliance Errors: 
        Unmarshal json_ietf_val:"{\n  \"open-traffic-generator-port:in-frames\": \"2000\",\n  \"open-traffic-generator-port:in-octets\": \"1024000\",\n  \"open-traffic-generator-port:out-frames\": \"0\",\n  \"open-traffic-generator-port:out-octets\": \"0\"\n}" into elem:{name:"ports"}  elem:{name:"port"  key:{key:"name"  value:"port2"}}  elem:{name:"state"}  elem:{name:"counters"}: rpc error: code = Unknown desc = path <nil> points to a node with non-leaf schema &{0xc0015a4780 <nil> counters  []  [] Directory unset 0xc0015a60f0 unset map[in-frames:0xc0015a4a80 in-octets:0xc0015a4c00 out-frames:0xc0015a4d80 out-octets:0xc0015a4f00]  <nil> [] <nil> <nil> [] [] [] [] map[] {false false} [] map[] map[schemapath:/open-traffic-generator-port/ports/port/state/counters structname:Port_Counters] <nil>}

I am also adding code snippet from where this error is getting formulated:

// 2. Check for type compliance (since path should already be compliant).
			if err := ytypes.SetNode(structSchema, structPtr, relPath, dp.Value, sopts...); err == nil {
				unmarshalledDatapoints = append(unmarshalledDatapoints, dp)
			} else {
				typeUnmarshalErrs = append(typeUnmarshalErrs, &TelemetryError{Path: dp.Path, Value: dp.Value, Err: err})
			}

another thing, we have noticed, there some utility which is determining relPath, which is return null for non-leaf node
relPath := util.TrimGNMIPathPrefix(dp.Path, util.PathStringToElements(structSchema.Path())[1:])

Steps Reproduce:

  1. Clone opentrafficgenerator:featuresprofile
git clone https://github.com/open-traffic-generator/featureprofiles.git
cd featureprofiles
git checkout dev-otg-gnmi-intergration
  1. Run static arp-test
    go test -v feature/interface/staticarp/otg_tests/static_arp_test/static_arp_test.go -kne-config $PWD/topologies/kne/testbed.kne.yml -testbed $PWD/topologies/atedut_2.testbed

Note:

  • function fetchFlowMetics is exercising fetching stats for non-leaf nodes
  • using this ondatra branch Ondatra-PR
  • models -repo models-yang
  • gnmic reference output
gnmic -a localhost:50051 --skip-verify -u admin -p admin  get --path "/flows/flow[name=f2]"
failed loading config file: Config File ".gnmic" Not Found in "[/home/padhikary /home/padhikary/.config /home/padhikary/.config/gnmic]"
[
  {
    "source": "localhost:50051",
    "timestamp": 1651054250141360279,
    "time": "2022-04-27T15:40:50.141360279+05:30",
    "updates": [
      {
        "Path": "flows/flow[name=f2]",
        "values": {
          "flows/flow": {
            "open-traffic-generator-flow:name": "f2",
            "open-traffic-generator-flow:state": {
              "counters": {
                "in-octets": "2000",
                "in-pkts": "200",
                "out-octets": "1000",
                "out-pkts": "100"
              },
              "in-frame-rate": "QKAAAA==",
              "name": "f2",
              "out-frame-rate": "QCAAAA==",
              "transmit": true
            }
          }
        }
      }
    ]
  }
]

OTG-HW binding for Ondatra-featureprofile to run OTG test

Requirements

  • gRPC, gNMI, Ixia-c and OTG-HW are deploy using docker compose and connected to HW chassis.
  • gRPC and gNMI server endpoint are required to run OTG test in featureprofile
  • User have to configure Chassis IP, Card, Port and Speed information in binding or testbed file.

Proposal

  • We will utilize StaticBinding present in featureprofile to run IxNetwork HW ATE test.
  • OTG test must be execute:
cd ./topologies/otg_tests/topology_test
go test -v . -testbed ../../atedut_2.testbed -binding ../../atedut_2.binding
  • Expose another property called otg within device binding
  • This is a sample ate binding section within ../../atedut_2.binding
ates {
  id: "ate"
  name: "10.39.33.143"  # Change this to the Ixia chassis name.

  # This option specific to OTG over Ixia-HW. 
  otg {
    target: "127.0.0.1:40051" # Change this to the Ixia-c-grpc server endpoint.
  }

  gnmi {
    target: "127.0.0.1:50051"  # Change this to the Ixia-c-gnmi server endpoint.
  }

  # Before this binding can be used with a topology, add ports mapping
  # from its topology ID to the actual port name on the device.
  ports {
    id: "port1"
    name: "2/5"  # Change this to the actual port name.
  }
  ports {
    id: "port2"
    name: "2/6"  # Change this to the actual port name.
  }
}

Feature Request : BGP AS Path info retrieval from BGP RIB

Hi,

Please provide support to retrieve BGP AS Path info from BGP RIB details.

rib := at.NetworkInstance(ap.Name()).Protocol(telemetry.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, fmt.Sprintf("bgp-%s", ap.Name())).Bgp().Rib()
pref := rib.AfiSafi(telemetry.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Ipv4Unicast().
Neighbor(setup.DutIPPool[ap.ID()].String()).AdjRibInPre().RouteAnyPrefix(0).Prefix().Get(t)
asPath := rib.AttrSetAny(). ================> We need As path option here to retrieve AS Path info.

Thanks,
Prabha

Data type mismatch error while running scripts : "invalid type ptr in leaflist"

Error from script:

{{NetworkInstance_Protocol_Bgp_Rib_AfiSafi_Ipv6Unicast_Neighbor_AdjRibInPre_Route true 0xc004f2f800 0x9960a80 0x9960b60 0xc0037901c0 true}}: error receiving gNMI response: failed to render notifications: cannot represent field value [0xc000566b00] as TypedValue for path /network-instances/network-instance[name=port2]/protocols/protocol[identifier=BGP][name=0]/bgp/rib/attr-sets/attr-set[index=0]/as-path/as-segment: invalid type ptr in leaflist

Path :

path /network-instances/network-instance[name=port2]/protocols/protocol[identifier=BGP][name=0]/bgp/rib/attr-sets/attr-set[index=0]/as-path/as-segment

Snapshot on Ixia showing received routes:

data_type_error

Error verbose details:

I1213 12:18:13.123988 1232102 gnmi.go:91] subscribe: {
prefix: {
target: "10.52.56.56"
}
subscription: {
path: {
origin: "openconfig"
elem: {
name: "network-instances"
}
elem: {
name: "network-instance"
key: {
key: "name"
value: "port2"
}
}
elem: {
name: "protocols"
}
elem: {
name: "protocol"
key: {
key: "identifier"
value: "BGP"
}
key: {
key: "name"
value: "65538"
}
}
elem: {
name: "bgp"
}
elem: {
name: "rib"
}
elem: {
name: "afi-safis"
}
elem: {
name: "afi-safi"
key: {
key: "afi-safi-name"
value: "IPV6_UNICAST"
}
}
elem: {
name: "ipv6-unicast"
}
elem: {
name: "neighbors"
}
elem: {
name: "neighbor"
key: {
key: "neighbor-address"
value: "2001:db8::5"
}
}
elem: {
name: "adj-rib-in-pre"
}
elem: {
name: "routes"
}
elem: {
name: "route"
key: {
key: "path-id"
value: "0"
}
key: {
key: "prefix"
value: "2001:db8:1::1/128"
}
}
elem: {
name: "state"
}
elem: {
name: "attr-index"
}
}
}
encoding: PROTO
}
I1213 12:18:13.131366 1232102 subscribe.go:268] peer: [::1]:49520 target: "10.52.56.56" subscription: subscribe:{prefix:{origin:"openconfig" target:"10.52.56.56"} subscription:{path:{elem:{name:"network-instances"} elem:{name:"network-instance" key:{key:"name" value:"port2"}} elem:{name:"protocols"} elem:{name:"protocol" key:{key:"identifier" value:"BGP"} key:{key:"name" value:"65538"}} elem:{name:"bgp"} elem:{name:"rib"} elem:{name:"afi-safis"} elem:{name:"afi-safi" key:{key:"afi-safi-name" value:"IPV6_UNICAST"}} elem:{name:"ipv6-unicast"} elem:{name:"neighbors"} elem:{name:"neighbor" key:{key:"neighbor-address" value:"2001:db8::5"}} elem:{name:"adj-rib-in-pre"} elem:{name:"routes"} elem:{name:"route" key:{key:"path-id" value:"0"} key:{key:"prefix" value:"2001:db8:1::1/128"}} elem:{name:"state"} elem:{name:"attr-index"}}} encoding:PROTO}
I1213 12:18:13.131952 1232102 subscribe.go:391] start processSubscription for 0xc0048fb9f0
I1213 12:18:13.132040 1232102 subscribe.go:399] end processSubscription for 0xc0048fb9f0
I1213 12:18:13.232415 1232102 ixweb.go:235] Response to "/api/v1/sessions/16/ixnetwork/operations/select": "{"id":"","url":"","resultUrl":"","executionTimeMs":33.0,"state":"SUCCESS","progress":100,"message":null,"result":[{"href":"/api/v1/sessions/16/ixnetwork","xpath":"/","topology":[{"href":"/api/v1/sessions/16/ixnetwork/topology/1","id":1,"xpath":"/topology[1]","deviceGroup":[{"href":"/api/v1/sessions/16/ixnetwork/topology/1/deviceGroup/1","id":1,"xpath":"/topology[1]/deviceGroup[1]","ethernet":[{"href":"/api/v1/sessions/16/ixnetwork/topology/1/deviceGroup/1/ethernet/1","id":1,"xpath":"/topology[1]/deviceGroup[1]/ethernet[1]","ipv6":[{"href":"/api/v1/sessions/16/ixnetwork/topology/1/deviceGroup/1/ethernet/1/ipv6/1","id":1,"xpath":"/topology[1]/deviceGroup[1]/ethernet[1]/ipv6[1]","bgpIpv6Peer":[{"href":"/api/v1/sessions/16/ixnetwork/topology/1/deviceGroup/1/ethernet/1/ipv6/1/bgpIpv6Peer/1","id":1,"xpath":"/topology[1]/deviceGroup[1]/ethernet[1]/ipv6[1]/bgpIpv6Peer[1]"}]}]}]}]},{"href":"/api/v1/sessions/16/ixnetwork/topology/2","id":2,"xpath":"/topology[2]","deviceGroup":[{"href":"/api/v1/sessions/16/ixnetwork/topology/2/deviceGroup/1","id":1,"xpath":"/topology[2]/deviceGroup[1]","ethernet":[{"href":"/api/v1/sessions/16/ixnetwork/topology/2/deviceGroup/1/ethernet/1","id":1,"xpath":"/topology[2]/deviceGroup[1]/ethernet[1]","ipv6":[{"href":"/api/v1/sessions/16/ixnetwork/topology/2/deviceGroup/1/ethernet/1/ipv6/1","id":1,"xpath":"/topology[2]/deviceGroup[1]/ethernet[1]/ipv6[1]","bgpIpv6Peer":[{"href":"/api/v1/sessions/16/ixnetwork/topology/2/deviceGroup/1/ethernet/1/ipv6/1/bgpIpv6Peer/1","id":1,"xpath":"/topology[2]/deviceGroup[1]/ethernet[1]/ipv6[1]/bgpIpv6Peer[1]"}]}]}]}]}]}]}"
I1213 12:18:13.393212 1232102 ixweb.go:235] Response to "/api/v1/sessions/16/ixnetwork/topology/deviceGroup/ethernet/ipv6/bgpIpv6Peer/operations/getAllLearnedInfo": "{"id":"","url":"","resultUrl":"","executionTimeMs":72.0,"state":"SUCCESS","progress":100,"message":null,"result":"kVoid"}"
I1213 12:18:13.582134 1232102 ixweb.go:235] Response to "/api/v1/sessions/16/ixnetwork/topology/2/deviceGroup/1/ethernet/1/ipv6/1/bgpIpv6Peer/1/learnedInfo/1/table/1": "{"id":1,"type":"IPv6 Prefixes 1","columns":["IPv6 Prefix","Prefix Length","Path ID","IPv4 Next Hop","IPv6 Next Hop","IPv6 Next Hop 2","MED","Local Preference","Origin","AS Path","Community","AIGP","Color","Large Community","SRv6 SID","Locator Block Length","Locator Node Length","Function Length","Argument Length"],"values":[["2001:db8:1::1","128","NA","removePacket[ ]","2001:db8::5","fe80::ba2a:d1ff:fe27:18","0","0","IGP","<65537 65536>"," ","","","NA","NA","NA","NA","NA","NA"],["2001:db8:1::2","128","NA","removePacket[ ]","2001:db8::5","fe80::ba2a:d1ff:fe27:18","0","0","IGP","<65537 65536>"," ","","","NA","NA","NA","NA","NA","NA"],["2001:db8:1::3","128","NA","removePacket[ ]","2001:db8::5","fe80::ba2a:d1ff:fe27:18","0","0","IGP","<65537 65536>"," ","","","NA","NA","NA","NA","NA","NA"],["2001:db8:1::4","128","NA","removePacket[ ]","2001:db8::5","fe80::ba2a:d1ff:fe27:18","0","0","IGP","<65537 65536>"," ","","","NA","NA","NA","NA","NA","NA"]],"actions":[],"rowCount":4,"links":[{"rel":"self","method":"GET","href":"/api/v1/sessions/16/ixnetwork/topology/2/deviceGroup/1/ethernet/1/ipv6/1/bgpIpv6Peer/1/learnedInfo/1/table/1"},{"rel":"meta","method":"OPTIONS","href":"/api/v1/sessions/16/ixnetwork/topology/2/deviceGroup/1/ethernet/1/ipv6/1/bgpIpv6Peer/1/learnedInfo/1/table/1"}]}"
route_propagation_test.go:330: Await(t) on ate(10.52.56.56) at &{{NetworkInstance_Protocol_Bgp_Rib_AfiSafi_Ipv6Unicast_Neighbor_AdjRibInPre_Route true 0xc004f2f800 0x9960a80 0x9960b60 0xc0037901c0 true}}: error receiving gNMI response: failed to render notifications: cannot represent field value [0xc000566b00] as TypedValue for path /network-instances/network-instance[name=port2]/protocols/protocol[identifier=BGP][name=0]/bgp/rib/attr-sets/attr-set[index=0]/as-path/as-segment: invalid type ptr in leaflist

Thanks,
Prabha

gNMI stat fetch failing for OTG nodes with latest Ondatra

While trying to fetch any stat using latest ondatra from otg gnmi server getting following error
gnmi.go:194: Get(t) at path origin:"openconfig" elem:{name:"interfaces"} elem:{name:"interface" key:{key:"name" value:"*"}} elem:{name:"ipv6-neighbors"} elem:{name:"ipv6-neighbor" key:{key:"ipv6-address" value:"*"}} elem:{name:"state"} elem:{name:"link-layer-address"} target:"ate": cannot subscribe to gNMI client: gnmi client getter not set on root object

Also pasting the code snippet how we are trying to fetch.
otg.Telemetry().InterfaceAny().Ipv6NeighborAny().LinkLayerAddress().Get(t)

netutil.NextBundleInterface fatals with "No value present" when device has no LAG

netutil.NextBundleInterface is not able to create the "first" bundle interface if the device does not already have a LAG because batch.Lookup of aggregate interface fatals with "no value present" here:

name, err := nextBundleInterface(t, dut.Vendor(), batch.Lookup(t))

(The actual line is a guess because netutil.NextBundleInterface() marks itself as a t.Helper() which masks the fataling line, and the helper function nextBundleInterface() only returns an error and does not fatal.)

From @octpetre:

opetre@caubserver1:~/featureprofiles$ go test -v feature/interface/aggregate/otg_tests/aggregate_test/*.go -kne-config ~/featureprofiles/topologies/kne/testbed.kne.yml -testbed ~/featureprofiles/topologies/atedut_lag.testbed --deviation_interface_enabled --deviation_default_network_instance=default | tee ~/featureprofiles/test.log
*** Reserving the testbed...


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

  Testbed Reservation Complete
  ID: 8787e45a-7938-46f6-ab0c-d6a0fe7a541c

    dut:              arista
    port3:            Ethernet9
    port5:            Ethernet5
    port7:            Ethernet3
    port9:            Ethernet4
    port1:            Ethernet1
    port2:            Ethernet6
    port4:            Ethernet8
    port6:            Ethernet2
    port8:            Ethernet7
    ate:              otg
    port2:            eth6
    port3:            eth9
    port4:            eth8
    port5:            eth5
    port6:            eth2
    port7:            eth3
    port8:            eth7
    port9:            eth4
    port1:            eth1

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

=== RUN   TestNegotiation
    aggregate_test.go:465: No value present
--- FAIL: TestNegotiation (9.68s)
FAIL

*** Releasing the testbed...

FAIL    command-line-arguments  15.568s
FAIL
opetre@caubserver1:~/featureprofiles$

and that line 465 in my local repo is actually this line https://github.com/open-traffic-generator/featureprofiles/blob/2a5ead9457dc13a9fe517a55487fa7722c37e2e7/feature/interface/aggregate/otg_tests/aggregate_test/aggregate_test.go#L459

Support of sending BGP notification from ATE

As a user we would like to test sending of BGP notification messages from test tool to DUT
Currently in ondatra ATE binding we don't a way to control BGP Peer level operations for example - sending BGP error code cease message.

Probable test scenario

top := ate.Topology().New()
in := top.AddInterface(ap.Name()).WithPort(ap)
bgp := in.BGP().AddPeer()
bgp.WithPeerAddress(dutPortIP(i)).WithTypeInternal().WithLocalASN(22)
top.Push(t).StartProtocols(t)

// proposed api for sending BGP error codes
top.SendBgpNotication(t, bgp, notification_code, notification_sub_code)

ondatra.NOKIA as vendor is not supported in netutil/interface.go

Currently ondatra.NOKIA as vendor is not supported in netutils/interface.go impacting configuration of loopback and bundle interfaces -

var (    
        loopbackPrefixes = map[ondatra.Vendor]string{    
                ondatra.ARISTA:  "Loopback",    
                ondatra.CISCO:   "Loopback",    
                ondatra.JUNIPER: "lo",    
        }    
        bundlePrefixes = map[ondatra.Vendor]string{    
                ondatra.ARISTA:  "Port-Channel",    
                ondatra.CISCO:   "Bundle-Ether",    
                ondatra.JUNIPER: "ae",    
        }    
        vlanPrefixes = map[ondatra.Vendor]string{    
                ondatra.ARISTA:  "Vlan",    
                ondatra.CISCO:   "BVI",    
                ondatra.JUNIPER: "irb.",    
        }    
)  

To have support for ondatra.NOKIA, it seems following files needs to be updated -

  1. In device.go -
const (
        // ARISTA vendor.
        ARISTA = Vendor(opb.Device_ARISTA)
        // CISCO vendor.
        CISCO = Vendor(opb.Device_CISCO)
        // DELL vendor.
        DELL = Vendor(opb.Device_DELL)
        // JUNIPER vendor.
        JUNIPER = Vendor(opb.Device_JUNIPER)
        // IXIA vendor.
        IXIA = Vendor(opb.Device_IXIA)
        // CIENA vendor.
        CIENA = Vendor(opb.Device_CIENA)
        // PALOALTO vendor.
        PALOALTO = Vendor(opb.Device_PALOALTO)
        // ZPE vendor.
        ZPE = Vendor(opb.Device_ZPE)
        // NOKIA vendor.
        NOKIA = Vendor(opb.Device_NOKIA)
)
  1. In netutil/interface.go -
var (    
        loopbackPrefixes = map[ondatra.Vendor]string{    
                ondatra.ARISTA:  "Loopback",    
                ondatra.CISCO:   "Loopback",    
                ondatra.JUNIPER: "lo",    
                ondatra.NOKIA:   "lo",
        }    
        bundlePrefixes = map[ondatra.Vendor]string{    
                ondatra.ARISTA:  "Port-Channel",    
                ondatra.CISCO:   "Bundle-Ether",    
                ondatra.JUNIPER: "ae",    
                ondatra.NOKIA:   "lag",    
        }    
        vlanPrefixes = map[ondatra.Vendor]string{    
                ondatra.ARISTA:  "Vlan",    
                ondatra.CISCO:   "BVI",    
                ondatra.JUNIPER: "irb.",    
                ondatra.NOKIA:   "irb1.",
        }    
)  

Question about implemenation of gnmi subscription in ondatra

Hi, I have a question regarding sending closeSend here in ondatra code. It seems when the client sends closeSend, the server can send an EOF and close the stream.

type ServerStream

	// RecvMsg blocks until it receives a message into m or the stream is
	// done. It returns io.EOF when the client has performed a CloseSend. On
	// any non-EOF error, the stream is aborted and the error contains the
	// RPC status.
	//
	// It is safe to have a goroutine calling SendMsg and another goroutine
	// calling RecvMsg on the same stream at the same time, but it is not
	// safe to call RecvMsg on the same stream in different goroutines.
	RecvMsg(m interface{}) error
...

if my understanding is correct, this can result in failure of the streaming call on ondatra side. Indeed we see some EOF issues for streaming requests that get resolved by commenting this line here. Can u please help me to understand why ondatra sends closesend before finishing receiving data.

Thanks

Support of IPv4 Packet Header ( ex protocol, more_fragments )

These are the supporting field in latest ATE Ipv4Header

message Ipv4Header {
    AddressRange src_addr = 1;
    AddressRange dst_addr = 2;
    bool dont_fragment = 6;
    uint32 ttl = 3;
    uint32 dscp = 4;
    uint32 ecn = 5;
    uint32 checksum = 7;
}

It will good to incorporate following IPv4 packet header fields:

message Ipv4Header {
    // existing fields till 7
    uint32 header_length = 8;
    uint32 tos = 5;
    uint32 total_length = 10;
    bool identification = 11;
    bool more_fragments = 12;
    uint32 fragment_offset = 13;
    uint32 protocol = 14;
}
}

Misleading grpc logs

Hi, we recently observed a new issue concerning the logging of grpc requests that is misleading.
It seems that ondatra correlates the eof error at the end of the grpc session with the last request which is not right. for example I use gribi to program the following entry and then restart the gribi service that will result in an expected eof, however, ondatra correlated the eof with the last request which was successfully processed.

here is the log shows the entry is successfully programmed:

I0323 15:36:04.611060    4472 gribiclient.go:372] sent Modify message operation:{id:3  network_instance:"DEFAULT"  op:ADD  ipv4:{prefix:"[203.0.113.0/24](https://www.google.com/url?q=http://203.0.113.0/24&sa=D&source=buganizer&usg=AOvVaw1Um7cNzJXXgQalNtdhwMmz)"  ipv4_entry:{next_hop_group:{value:42}}}  election_id:{low:2}}
I0323 15:36:04.656613    4471 gribiclient.go:318] received message on Modify stream: result:{id:3  status:RIB_PROGRAMMED  timestamp:1679610964653535635}

and here is the ondatra logs after expected eof that reports the last request was failed due to eof

E0323 15:39:21.101732    4471 gribiclient.go:327] got error receiving message, rpc error: code = Unavailable desc = error on request {
operation:  {
  id:  3
  network_instance:  "DEFAULT"
  op:  ADD
  ipv4:  {
    prefix:  "[203.0.113.0/24](https://www.google.com/url?q=http://203.0.113.0/24&sa=D&source=buganizer&usg=AOvVaw1Um7cNzJXXgQalNtdhwMmz)"
    ipv4_entry:  {
      next_hop_group:  {
        value:  42
      }
    }
  }
  election_id:  {
    low:  2
  }
}
}: error reading from

OTG does not support NewConfig API

When working with OTG, I have to import gosnappi just to create a new config before using the OTG object to push it. Later, when I upgrade to a new ondatra, I also have to update the gosnappi anchor to match the OTG anchor. Not a huge deal, but it's a friction point when using your API. Please add NewConfig or an equivalent API to the OTG object.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.