Skip to content

Commit

Permalink
Merge branch 'main' into isis_missing_intf_afi_deviation
Browse files Browse the repository at this point in the history
  • Loading branch information
arvbaska1 authored Sep 15, 2023
2 parents 6e7e41c + a937f79 commit fa28eb3
Show file tree
Hide file tree
Showing 189 changed files with 5,520 additions and 17,354 deletions.
48 changes: 6 additions & 42 deletions .github/ISSUE_TEMPLATE/new_test_requirement.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,15 @@
---
name: New featureprofiles test requirement
about: Use this template to document the requirements for a new test to be implemented.
about: Use this template to create an issue to assign and track implemenation of the code for a test.
title: ''
labels: enhancement
assignees: ''

---

# TestID-x.y: Short name of test here

## Summary

Write a few sentences or paragraphs describing the purpose and scope of the test.

## Procedure

* Test #1 - Name of test
* Step 1
* Step 2
* Step 3

* Test #2 - New of test
* Step 1
* Step 2
* Step 3


## Config Parameter Coverage

Add list of OpenConfig 'config' paths used in this test, if any.

## Telemetry Parameter Coverage

Add list of OpenConfig 'state' paths used in this test, if any.

## Protocol/RPC Parameter Coverage
# Request for New Test Code Implementation Instructions

Add list of OpenConfig RPC's (gNMI, gNOI, gNSI, gRIBI) used in the list
* The label 'enhancement' is automatically set by this template.
* Add a label for the test priority according to the test requirements. (p0, p1, p2)
* Add a link in this issue description to the README.md for the test requirements. For example:

For example:
* gNMI
* Set
* Subscribe
* gNOI
* System
* KillProcess
* Healthz
* Get
* Check
* Artifact
Implement code for [Test name here](https://github.com/openconfig/featureprofiles/blob/main/feature/example/tests/topology_test/README.md)
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ protocols such as BGP, IS-IS.

Feature profiles also includes a suite of
[Ondatra](https://github.com/openconfig/ondatra) tests for validating the
network device behavior for each defined feature.
network device behavior for each defined feature. If you are new to Ondatra,
please start by reading the Ondata
[README](https://github.com/openconfig/ondatra#readme) and taking the [Ondatra
tour](https://docs.google.com/viewer?url=https://raw.githubusercontent.com/openconfig/ondatra/main/internal/tour/tour.pdf).

# Contributing

Expand Down
1 change: 1 addition & 0 deletions cloudbuild/virtual.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function metadata_kne_topology() {
kne_topology_file["TESTBED_DUT_ATE_2LINKS"]="${topo_prefix}/dutate.textproto"
kne_topology_file["TESTBED_DUT_ATE_4LINKS"]="${topo_prefix}/dutate.textproto"
kne_topology_file["TESTBED_DUT_ATE_9LINKS_LAG"]="${topo_prefix}/dutate_lag.textproto"
kne_topology_file["TESTBED_DUT_DUT_ATE_2LINKS"]="${topo_prefix}/dutdutate.textproto"
for p in "${!kne_topology_file[@]}"; do
if grep -q "testbed.*${p}$" "${metadata_test_path}"/metadata.textproto; then
echo "${kne_topology_file[${p}]}"
Expand Down
71 changes: 71 additions & 0 deletions doc/test-requirements-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
name: New featureprofiles test requirement
about: Use this template to document the requirements for a new test to be implemented.
title: ''
labels: enhancement
assignees: ''

---

# Instructions for this template

Below is the required template for writing test requirements. Good examples of test
requirements include:

* [TE-3.7: Base Hierarchical NHG Update](/feature/gribi/otg_tests/base_hierarchical_nhg_update/README.md)
* [gNMI-1.13: Telemetry: Optics Power and Bias Current](https://github.com/openconfig/featureprofiles/blob/main/feature/platform/tests/optics_power_and_bias_current_test/README.md)
* [RT-5.1: Singleton Interface](https://github.com/openconfig/featureprofiles/blob/main/feature/interface/singleton/otg_tests/singleton_test/README.md)

# TestID-x.y: Short name of test here

## Summary

Write a few sentences or paragraphs describing the purpose and scope of the test.

## Testbed type

* Specify the .testbed topology file from the [topologies](https://github.com/openconfig/featureprofiles/tree/main/topologies) folder to be used with this test

## Procedure

* Sub Test #1 - Name of test
* Step 1
* Step 2
* Validation and pass fail criteria

* Sub Test #2 - New of test
* Step 1
* Step 2
* Validation and pass fail criteria

## Config Parameter Coverage

Add list of OpenConfig 'config' paths used in this test, if any.

## Telemetry Parameter Coverage

Add list of OpenConfig 'state' paths used in this test, if any.

## Protocol/RPC Parameter Coverage

Add list of OpenConfig RPC's (gNMI, gNOI, gNSI, gRIBI) used in the list, if any.

For example:

* gNMI
* Set
* Subscribe
* gNOI
* System
* KillProcess
* Healthz
* Get
* Check
* Artifact

## Required DUT platform

* Specify the minimum DUT-type:
* MFF - A modular form factor device containing LINECARDs, FABRIC and redundant CONTROLLER_CARD components
* FFF - fixed form factor
* vRX - virtual router device
68 changes: 68 additions & 0 deletions feature/bgp/afi_safi/oc_defaults/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
Summary:
- When operating in "openconfig mode", NOS (network operating system) defaults should match what OC defines as the defaults i.e,
- For BGP, there are no defaults for AFI-SAFI at the neighbor and peer-group levels. However at the global level the default is "false"
- This test currently only verifies the defaults for ipv4-unicast and ipv6-unicast families. However, this test can be extended further to cover for other
AFI-SAFIs as well in future.
- The test will check for default implementations under the neighbor and peer-group hierarchies and also test for inheritance rules as was specified in [pull/774](https://github.com/openconfig/public/pull/774) and [pull/815](https://github.com/openconfig/public/pull/815).


Topology:
ATE (Port1) <-EBGP-> (Port1) DUT (Port2) <-IBGP-> (Port2) ATE
- Connect ATE Port1 to DUT port1 (EBGP peering)
- Connect ATE Port2 to DUT port2 (IBGP peering)

Procedure:
- [Test case-1] AFI-SAFI configurations at "neighbor level":
- Push EBGP and IBGP OC configuration to the DUT
- Configuration should include corresponding IPv4 and IPv6 neighbor configurations.
- Ensure that only IPv4-Unicast enabled boolean is made "true" for IPv4 neighbor. "IPv6-unicast enabled" boolean is left to OC default for the IPv4 peer".
- Ensure that only IPv6-Unicast enabled boolean is made "true" for IPv6 neighbor. "IPv4-unicast enabled" boolean is left to OC default for the IPv6 peer".
- Ensure that there are no AFI-SAFI configurations at the global and peer-group levels.
- On the ATE side ensure that IPv4-unicast and IPv6-unicast AFI-SAFI are enabled==true for IPv4 and IPv6 neighbors.
- verification:
- For IPv4 neighbor, ensure that the IPv4 neighborship is up and IPv6-unicast capability is not negotiated.
- For IPv6 neighbor ensure that the IPv6 neighborship is up and IPv4-unicast capability is not negotiated.
- [Test case-2] IPv4-unicast and IPv6-Unicast AFI-SAFIs enabled at peer-group level:
- Configuration at the neighbor level is same as in [Test case-1] except for IPv4-unicast and IPv6-unicast being enabled at the peer-group level
- No configuration should be made at the global AFI-SAFI level
- verification:
- For IPv4 neighbor, ensure that the IPv4 neighborship is up and both IPv4-unicast and IPv6-unicast capabilities are negotiated.
- For IPv6 neighbor ensure that the IPv6 neighborship is up and both IPv4-unicast and IPv6-unicast capabilities are negotiated.
- [Test case-4] IPv4-unicast and IPv6-Unicast AFI-SAFIs enabled at Global level:
- Configuration at the neighbor level is same as in [Test case-1] except for IPv4-unicast and IPv6-unicast being enabled at the global level
- No configuration should be made at the peer-group AFI-SAFI level
- verification:
- For IPv4 neighbor, ensure that the IPv4 neighborship is up and both IPv4-unicast and IPv6-unicast capabilities are negotiated.
- For IPv6 neighbor ensure that the IPv6 neighborship is up and both IPv4-unicast and IPv6-unicast capabilities are negotiated.

Config Parameter coverage:

/network-instances/network-instance/protocols/protocol/bgp/global/config/as
/network-instances/network-instance/protocols/protocol/bgp/global/config/router-id
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/config/auth-password
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/config/neighbor-address
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/config/peer-as
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/neighbor-address
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/config/enabled


/network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/config/auth-password
/network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/config/neighbor-address
/network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/config/peer-as
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/config/peer-group/peer-group-name
/network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/config/enabled

/network-instances/network-instance/protocols/protocol/bgp/global/afi-safis/afi-safi/config/enabled

Telemetry Parameter coverage:
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/state/session-state
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/state/supported-capabilities
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/state/peer-type
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/state/peer-as
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/state/supported-capabilities

/network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/state/peer-type
/network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/state/peer-as
/network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/state/local-as
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/state/peer-group

Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ func buildNbrList(asN uint32) []*bgpNeighbor {
func bgpWithNbr(as uint32, nbrs []*bgpNeighbor, dut *ondatra.DUTDevice) *oc.NetworkInstance_Protocol {
d := &oc.Root{}
ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut))
ni_proto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := ni_proto.GetOrCreateBgp()
niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := niProto.GetOrCreateBgp()

g := bgp.GetOrCreateGlobal()
g.As = ygot.Uint32(as)
Expand Down Expand Up @@ -246,7 +246,7 @@ func bgpWithNbr(as uint32, nbrs []*bgpNeighbor, dut *ondatra.DUTDevice) *oc.Netw
af4.Enabled = ygot.Bool(false)
}
}
return ni_proto
return niProto
}

func checkBgpStatus(t *testing.T, dut *ondatra.DUTDevice) {
Expand Down Expand Up @@ -582,7 +582,7 @@ func configACLNative(t testing.TB, d *ondatra.DUTDevice, name string) {
},
},
}
gnmiClient := d.RawAPIs().GNMI().Default(t)
gnmiClient := d.RawAPIs().GNMI(t)
if _, err := gnmiClient.Set(context.Background(), gpbSetRequest); err != nil {
t.Fatalf("Unexpected error configuring SRL ACL: %v", err)
}
Expand Down Expand Up @@ -618,7 +618,7 @@ func configAdmitAllACLNative(t testing.TB, d *ondatra.DUTDevice, name string) {
},
},
}
gnmiClient := d.RawAPIs().GNMI().Default(t)
gnmiClient := d.RawAPIs().GNMI(t)
if _, err := gnmiClient.Set(context.Background(), gpbDelRequest); err != nil {
t.Fatalf("Unexpected error removing SRL ACL: %v", err)
}
Expand Down Expand Up @@ -667,7 +667,7 @@ func configACLInterfaceNative(t *testing.T, d *ondatra.DUTDevice, ifName string)
},
},
}
gnmiClient := d.RawAPIs().GNMI().Default(t)
gnmiClient := d.RawAPIs().GNMI(t)
if _, err := gnmiClient.Set(context.Background(), gpbSetRequest); err != nil {
t.Fatalf("Unexpected error configuring interface ACL: %v", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ func bgpCreateNbr(localAs, peerAs uint32, policy string, dut *ondatra.DUTDevice)

d := &oc.Root{}
ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut))
ni_proto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := ni_proto.GetOrCreateBgp()
niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := niProto.GetOrCreateBgp()
global := bgp.GetOrCreateGlobal()
global.RouterId = ygot.String(dutDst.IPv4)
global.As = ygot.Uint32(localAs)
Expand Down Expand Up @@ -219,7 +219,7 @@ func bgpCreateNbr(localAs, peerAs uint32, policy string, dut *ondatra.DUTDevice)
}

}
return ni_proto
return niProto
}

// configureBGPPolicy configures a BGP routing policy to accept or reject routes based on prefix match conditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ func bgpCreateNbr(localAs, peerAs uint32, policy string, dut *ondatra.DUTDevice)

d := &oc.Root{}
ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut))
ni_proto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := ni_proto.GetOrCreateBgp()
niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := niProto.GetOrCreateBgp()
global := bgp.GetOrCreateGlobal()
global.RouterId = ygot.String(dutDst.IPv4)
global.As = ygot.Uint32(localAs)
Expand Down Expand Up @@ -226,7 +226,7 @@ func bgpCreateNbr(localAs, peerAs uint32, policy string, dut *ondatra.DUTDevice)
}

}
return ni_proto
return niProto
}

// configureBGPPolicy configures a BGP routing policy to accept or reject routes based on prefix match conditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ func createBGPNeighbor(localAs, peerAs, pLimit uint32, restartTime uint16, dut *

d := &oc.Root{}
ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut))
ni_proto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := ni_proto.GetOrCreateBgp()
niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := niProto.GetOrCreateBgp()

global := bgp.GetOrCreateGlobal()
global.As = ygot.Uint32(localAs)
Expand Down Expand Up @@ -302,7 +302,7 @@ func createBGPNeighbor(localAs, peerAs, pLimit uint32, restartTime uint16, dut *
}
}
}
return ni_proto
return niProto
}

func configureRoutePolicy(t *testing.T, dut *ondatra.DUTDevice, name string, pr oc.E_RoutingPolicy_PolicyResultType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ func createBGPNeighbor(localAs, peerAs, pLimit uint32, restartTime uint16, dut *

d := &oc.Root{}
ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut))
ni_proto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := ni_proto.GetOrCreateBgp()
niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := niProto.GetOrCreateBgp()

global := bgp.GetOrCreateGlobal()
global.As = ygot.Uint32(localAs)
Expand Down Expand Up @@ -334,7 +334,7 @@ func createBGPNeighbor(localAs, peerAs, pLimit uint32, restartTime uint16, dut *
}
}
}
return ni_proto
return niProto
}

func configureRoutePolicy(t *testing.T, dut *ondatra.DUTDevice, name string, pr oc.E_RoutingPolicy_PolicyResultType) {
Expand Down
Loading

0 comments on commit fa28eb3

Please sign in to comment.