Skip to content

Commit

Permalink
Merge branch 'main' into DP1dot11
Browse files Browse the repository at this point in the history
  • Loading branch information
trathod1 authored Sep 12, 2023
2 parents 43ac19f + c40bd73 commit ff2fe7b
Show file tree
Hide file tree
Showing 165 changed files with 5,484 additions and 1,515 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
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)
2 changes: 2 additions & 0 deletions cloudbuild/virtual.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ sudo chmod 755 /usr/bin/cleanup.sh
sudo systemctl daemon-reload
sudo systemctl disable cleanup.service
sudo systemctl enable cleanup.timer
sudo systemctl start cleanup.timer

readonly platform="${1}"
readonly dut_tests="${2}"
Expand Down Expand Up @@ -81,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
42 changes: 40 additions & 2 deletions feature/acl/feature.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.



id {
name: "acl"
version: 1
Expand Down Expand Up @@ -57,6 +55,46 @@ telemetry_path {
path: "/acl/acl-sets/acl-set/acl-entries/acl-entry/actions/state/forwarding-action"
}

# ACL defined-sets
config_path {
path: "/acl/acl-sets/acl-set/acl-entries/acl-entry/ipv4/config/destination-address-prefix-set"
}
config_path {
path: "/acl/acl-sets/acl-set/acl-entries/acl-entry/ipv4/config/source-address-prefix-set"
}
telemetry_path {
path: "/acl/acl-sets/acl-set/acl-entries/acl-entry/ipv4/state/destination-address-prefix-set"
}
telemetry_path {
path: "/acl/acl-sets/acl-set/acl-entries/acl-entry/ipv4/state/source-address-prefix-set"
}
config_path {
path: "/acl/acl-sets/acl-set/acl-entries/acl-entry/ipv6/config/destination-address-prefix-set"
}
config_path {
path: "/acl/acl-sets/acl-set/acl-entries/acl-entry/ipv6/config/source-address-prefix-set"
}
telemetry_path {
path: "/acl/acl-sets/acl-set/acl-entries/acl-entry/ipv6/state/destination-address-prefix-set"
}
telemetry_path {
path: "/acl/acl-sets/acl-set/acl-entries/acl-entry/ipv6/state/source-address-prefix-set"
}
config_path {
path: "/acl/acl-sets/acl-set/acl-entries/acl-entry/transport/config/destination-port-set"
}
config_path {
path: "/acl/acl-sets/acl-set/acl-entries/acl-entry/transport/config/source-port-set"
}
telemetry_path {
path: "/acl/acl-sets/acl-set/acl-entries/acl-entry/transport/state/destination-port-set"
}
telemetry_path {
path: "/acl/acl-sets/acl-set/acl-entries/acl-entry/transport/state/source-port-set"
}



# INTERFACES

config_path {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ func (ad *ateData) ConfigureOTG(t *testing.T, otg *otg.OTG, ateList []string) go
if v.ip.v4 != "" {
address := strings.Split(v.ip.v4, "/")[0]
prefixInt4, _ := strconv.Atoi(strings.Split(v.ip.v4, "/")[1])
ipv4 := eth.Ipv4Addresses().Add().SetName(devName + ".IPv4").SetAddress(address).SetGateway(v.neighbor).SetPrefix(int32(prefixInt4))
ipv4 := eth.Ipv4Addresses().Add().SetName(devName + ".IPv4").SetAddress(address).SetGateway(v.neighbor).SetPrefix(uint32(prefixInt4))
bgp4Name := devName + ".BGP4.peer"
bgp4Peer := bgp.Ipv4Interfaces().Add().SetIpv4Name(ipv4.Name()).Peers().Add().SetName(bgp4Name).SetPeerAddress(ipv4.Gateway()).SetAsNumber(int32(v.as)).SetAsType(gosnappi.BgpV4PeerAsType.EBGP)
bgp4Peer := bgp.Ipv4Interfaces().Add().SetIpv4Name(ipv4.Name()).Peers().Add().SetName(bgp4Name).SetPeerAddress(ipv4.Gateway()).SetAsNumber(uint32(v.as)).SetAsType(gosnappi.BgpV4PeerAsType.EBGP)

bgp4Peer.Capability().SetIpv4UnicastAddPath(true).SetIpv6UnicastAddPath(true)
bgp4Peer.LearnedInformationFilter().SetUnicastIpv4Prefix(true).SetUnicastIpv6Prefix(true)
Expand All @@ -141,9 +141,9 @@ func (ad *ateData) ConfigureOTG(t *testing.T, otg *otg.OTG, ateList []string) go
if v.ip.v6 != "" {
address := strings.Split(v.ip.v6, "/")[0]
prefixInt6, _ := strconv.Atoi(strings.Split(v.ip.v6, "/")[1])
ipv6 := eth.Ipv6Addresses().Add().SetName(devName + ".IPv6").SetAddress(address).SetGateway(v.neighbor).SetPrefix(int32(prefixInt6))
ipv6 := eth.Ipv6Addresses().Add().SetName(devName + ".IPv6").SetAddress(address).SetGateway(v.neighbor).SetPrefix(uint32(prefixInt6))
bgp6Name := devName + ".BGP6.peer"
bgp6Peer := bgp.Ipv6Interfaces().Add().SetIpv6Name(ipv6.Name()).Peers().Add().SetName(bgp6Name).SetPeerAddress(ipv6.Gateway()).SetAsNumber(int32(v.as)).SetAsType(gosnappi.BgpV6PeerAsType.EBGP)
bgp6Peer := bgp.Ipv6Interfaces().Add().SetIpv6Name(ipv6.Name()).Peers().Add().SetName(bgp6Name).SetPeerAddress(ipv6.Gateway()).SetAsNumber(uint32(v.as)).SetAsType(gosnappi.BgpV6PeerAsType.EBGP)

bgp6Peer.Capability().SetIpv4UnicastAddPath(true).SetIpv6UnicastAddPath(true).SetExtendedNextHopEncoding(true)
bgp6Peer.LearnedInformationFilter().SetUnicastIpv4Prefix(true).SetUnicastIpv6Prefix(true)
Expand All @@ -160,17 +160,17 @@ func (ad *ateData) ConfigureOTG(t *testing.T, otg *otg.OTG, ateList []string) go
firstAdvAddr := strings.Split(ad.prefixesStart.v4, "/")[0]
firstAdvPrefix, _ := strconv.Atoi(strings.Split(ad.prefixesStart.v4, "/")[1])
bgp4PeerRoutes := bgpPeer.V4Routes().Add().SetName(bgpName + ".rr4").SetNextHopIpv4Address(ip.Address()).SetNextHopAddressType(gosnappi.BgpV4RouteRangeNextHopAddressType.IPV4).SetNextHopMode(gosnappi.BgpV4RouteRangeNextHopMode.MANUAL)
bgp4PeerRoutes.Addresses().Add().SetAddress(firstAdvAddr).SetPrefix(int32(firstAdvPrefix)).SetCount(int32(ad.prefixesCount))
bgp4PeerRoutes.AddPath().SetPathId(otgPort1Details.pathId)
bgp4PeerRoutes.Addresses().Add().SetAddress(firstAdvAddr).SetPrefix(uint32(firstAdvPrefix)).SetCount(uint32(ad.prefixesCount))
bgp4PeerRoutes.AddPath().SetPathId(uint32(otgPort1Details.pathId))

} else {
bgpName := ateList[0] + ".dev.BGP6.peer"
bgpPeer := bgp6ObjectMap[bgpName]
firstAdvAddr := strings.Split(ad.prefixesStart.v4, "/")[0]
firstAdvPrefix, _ := strconv.Atoi(strings.Split(ad.prefixesStart.v4, "/")[1])
bgp4PeerRoutes := bgpPeer.V4Routes().Add().SetName(bgpName + ".rr4")
bgp4PeerRoutes.Addresses().Add().SetAddress(firstAdvAddr).SetPrefix(int32(firstAdvPrefix)).SetCount(int32(ad.prefixesCount))
bgp4PeerRoutes.AddPath().SetPathId(otgPort1Details.pathId)
bgp4PeerRoutes.Addresses().Add().SetAddress(firstAdvAddr).SetPrefix(uint32(firstAdvPrefix)).SetCount(uint32(ad.prefixesCount))
bgp4PeerRoutes.AddPath().SetPathId(uint32(otgPort1Details.pathId))
}
}
if ad.prefixesStart.v6 != "" {
Expand All @@ -179,8 +179,8 @@ func (ad *ateData) ConfigureOTG(t *testing.T, otg *otg.OTG, ateList []string) go
firstAdvAddr := strings.Split(ad.prefixesStart.v6, "/")[0]
firstAdvPrefix, _ := strconv.Atoi(strings.Split(ad.prefixesStart.v6, "/")[1])
bgp6PeerRoutes := bgp6Peer.V6Routes().Add().SetName(bgp6Name + ".rr6")
bgp6PeerRoutes.Addresses().Add().SetAddress(firstAdvAddr).SetPrefix(int32(firstAdvPrefix)).SetCount(int32(ad.prefixesCount))
bgp6PeerRoutes.AddPath().SetPathId(otgPort1Details.pathId)
bgp6PeerRoutes.Addresses().Add().SetAddress(firstAdvAddr).SetPrefix(uint32(firstAdvPrefix)).SetCount(uint32(ad.prefixesCount))
bgp6PeerRoutes.AddPath().SetPathId(uint32(otgPort1Details.pathId))
}

t.Logf("Pushing config to ATE and starting protocols...")
Expand Down
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 @@ -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
Loading

0 comments on commit ff2fe7b

Please sign in to comment.