Skip to content

Commit

Permalink
Merge branch 'openconfig:main' into otg-rt1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
octpetre authored Feb 25, 2025
2 parents be428fb + 5b8036a commit 84e7dac
Show file tree
Hide file tree
Showing 12 changed files with 610 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ func bgpCreateNbr(t *testing.T, dut *ondatra.DUTDevice, authPwd, routerID string
global := bgp.GetOrCreateGlobal()
global.RouterId = ygot.String(routerID)
global.As = ygot.Uint32(localAs)
global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true)
global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(true)

pg1 := bgp.GetOrCreatePeerGroup(peerGrpName1)
pg1.PeerAs = ygot.Uint32(ateAS1)
Expand Down
10 changes: 0 additions & 10 deletions feature/gribi/otg_tests/gribi_scaling/gribi_scaling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ func incrementMAC(mac string, i int) (string, error) {

func TestScaling(t *testing.T) {
dut := ondatra.DUT(t, "dut")
overrideScaleParams(dut)
ate := ondatra.ATE(t, "ate")

ctx := context.Background()
Expand Down Expand Up @@ -399,12 +398,3 @@ func checkTraffic(t *testing.T, ate *ondatra.ATEDevice, top gosnappi.Config) {
t.Errorf("FAIL- Got %v%% packet loss for %s ; expected < 1%%", lossPct, "flow")
}
}

// overrideScaleParams allows to override the default scale parameters based on the DUT vendor.
func overrideScaleParams(dut *ondatra.DUTDevice) {
if deviations.OverrideDefaultNhScale(dut) {
if dut.Vendor() == ondatra.CISCO {
*fpargs.V4TunnelCount = 3328
}
}
}
1 change: 0 additions & 1 deletion feature/gribi/otg_tests/gribi_scaling/metadata.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ platform_exceptions: {
deviations: {
ipv4_missing_enabled: true
interface_ref_interface_id_format: true
override_default_nh_scale: true
}
}
platform_exceptions: {
Expand Down
29 changes: 23 additions & 6 deletions feature/gribi/otg_tests/ipv4_entry_test/ipv4_entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,12 @@ func TestMain(m *testing.M) {

func staticARPWithMagicUniversalIP(t *testing.T, dut *ondatra.DUTDevice) {
t.Helper()
dummyIPCIDR1 := nh1IpAddr + "/32"
dummyIPCIDR2 := nh2IpAddr + "/32"
p2 := dut.Port(t, "port2")
p3 := dut.Port(t, "port3")
s2 := &oc.NetworkInstance_Protocol_Static{
Prefix: ygot.String(nh1IpAddr + "/32"),
Prefix: ygot.String(dummyIPCIDR1),
NextHop: map[string]*oc.NetworkInstance_Protocol_Static_NextHop{
strconv.Itoa(nh1ID): {
Index: ygot.String(strconv.Itoa(nh1ID)),
Expand All @@ -131,7 +133,7 @@ func staticARPWithMagicUniversalIP(t *testing.T, dut *ondatra.DUTDevice) {
},
}
s3 := &oc.NetworkInstance_Protocol_Static{
Prefix: ygot.String(nh2IpAddr + "/32"),
Prefix: ygot.String(dummyIPCIDR2),
NextHop: map[string]*oc.NetworkInstance_Protocol_Static_NextHop{
strconv.Itoa(nh2ID): {
Index: ygot.String(strconv.Itoa(nh2ID)),
Expand All @@ -141,9 +143,24 @@ func staticARPWithMagicUniversalIP(t *testing.T, dut *ondatra.DUTDevice) {
},
},
}
static1 := &oc.NetworkInstance_Protocol{
Identifier: oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_STATIC,
Name: ygot.String(deviations.StaticProtocolName(dut)),
Static: map[string]*oc.NetworkInstance_Protocol_Static{
dummyIPCIDR1: s2,
},
}
static2 := &oc.NetworkInstance_Protocol{
Identifier: oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_STATIC,
Name: ygot.String(deviations.StaticProtocolName(dut)),
Static: map[string]*oc.NetworkInstance_Protocol_Static{
dummyIPCIDR2: s3,
},
}
fptest.ConfigureDefaultNetworkInstance(t, dut)
sp := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_STATIC, deviations.StaticProtocolName(dut))
gnmi.Replace(t, dut, sp.Static(nh1IpAddr+"/32").Config(), s2)
gnmi.Replace(t, dut, sp.Static(nh2IpAddr+"/32").Config(), s3)
gnmi.Update(t, dut, sp.Config(), static1)
gnmi.Update(t, dut, sp.Config(), static2)
gnmi.Update(t, dut, gnmi.OC().Interface(p2.Name()).Config(), configStaticArp(p2, nh1IpAddr, staticDstMAC))
gnmi.Update(t, dut, gnmi.OC().Interface(p3.Name()).Config(), configStaticArp(p3, nh2IpAddr, staticDstMAC))
}
Expand Down Expand Up @@ -349,7 +366,7 @@ func TestIPv4Entry(t *testing.T) {
if tc.gribiMACOverrideWithStaticARPStaticRoute {
staticARPWithMagicUniversalIP(t, dut)
} else if tc.gribiMACOverrideWithStaticARP {
//Creating a Static ARP entry for staticDstMAC
// Creating a Static ARP entry for staticDstMAC
d := gnmi.OC()
p2 := dut.Port(t, "port2")
p3 := dut.Port(t, "port3")
Expand All @@ -359,7 +376,7 @@ func TestIPv4Entry(t *testing.T) {
gnmi.Update(t, dut, d.Interface(p3.Name()).Config(), configStaticArp(p3, nh2IpAddr, staticDstMAC))
}
if tc.gribiMACOverrideWithStaticARP || tc.gribiMACOverrideWithStaticARPStaticRoute {
//Programming a gRIBI flow with above IP/mac-address as the next-hop entry
// Programming a gRIBI flow with above IP/mac-address as the next-hop entry
tc.entries = []fluent.GRIBIEntry{
fluent.NextHopEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(dut)).
WithIndex(nh1ID).WithInterfaceRef(dut.Port(t, "port2").Name()).WithIPAddress(nh1IpAddr).WithMacAddress(staticDstMAC),
Expand Down
86 changes: 86 additions & 0 deletions feature/system/logging/otg_tests/remote_syslog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# TR-6.1: Remote Syslog feature config

## Summary

Verify configuration of remote syslog host (server) in DEFAULT and non-default
VRF.

## Procedure

* Connect DUT port-1 with OTG port-1 and DUT port-2 with OTG port-2
* Configure DUT $VRF-name network-instance and OTG with:
* interface(port-1), interface(port-2) with IPv4 and IPv6 address
* static host routes to syslog server addresses pointing OTG
interface(port-1) IP
* loopback interface with IPv4 and IPv6 address and netmasks of /32, /64
respectively
* Configure syslog servers DUT
* Configure 1st IPv4 Syslog remote hosts in $VRF-name with:
* facility “local7” and severity “debug”
* (TODO when OC model published) compliance to RFC5424 (structured)
* source address equal to IPv4 address of loopback interface
* Configure 2nd IPv4 Syslog remote hosts in $VRF-name with:
* facility “local7” and severity “critical”
* (TODO when OC model published) compliance to RFC3164 (BSD/original)
* source address equal to IPv4 address of loopback interface
* Configure 3rd IPv6 Syslog remote hosts in $VRF-name with:
* non-standard remote port
* facility “local1” and severity “debug”
* (TODO when OC model published) compliance to RFC5424 (structured)
* source address equal to IPv6 address of loopback interface
* Configure 4th IPv6 Syslog remote hosts in $VRF-name with:
* facility “local7” and severity “critical”
* (TODO when OC model published) compliance to RFC3164 (BSD/original)
* source address equal to IPv6 address of loopback interface
* Test Procedure
* Read configuration of all 4 servers, verify it matches intent
* enable packet capture on OTG port-1
* disable OTG port-2 so DUT interface(port-2) goes down, which should
generate log
* Observe on OTG capture:
* Syslog packet w/ DstIP of host 1st and 4th and standard dstPort.
* Syslog packet w/ DstIP of host 3rd and non-standard dstPort
* Note: no packet w/ DstIP of 2nd host is expected.

### Test Case #1 - Default network instance

```
* Execute above procedure for $VRF-name = "DEFAULT" (default VRF)
```

### Test Case #2 - Non-Default network instance

```
* Execute above procedure for $VRF-name = "VRF-foo"
```

## OpenConfig Path and RPC Coverage

```yaml
paths:
## Config parameter coverage
/system/logging/remote-servers/remote-server/config/host:
/system/logging/remote-servers/remote-server/config/network-instance:
/system/logging/remote-servers/remote-server/config/remote-port:
/system/logging/remote-servers/remote-server/config/source-address:
/system/logging/remote-servers/remote-server/selectors/selector/config/facility:
/system/logging/remote-servers/remote-server/selectors/selector/config/severity:

## Telemetry parameter coverage
/system/logging/remote-servers/remote-server/state/host:
/system/logging/remote-servers/remote-server/state/network-instance:
/system/logging/remote-servers/remote-server/state/remote-port:
/system/logging/remote-servers/remote-server/state/source-address:
/system/logging/remote-servers/remote-server/selectors/selector/state/facility:
/system/logging/remote-servers/remote-server/selectors/selector/state/severity:

rpcs:
gnmi:
gNMI.Get:
gNMI.Subscribe:
gNMI.Set:
```
## DUT
FFF
19 changes: 19 additions & 0 deletions feature/system/logging/otg_tests/remote_syslog/metadata.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# proto-file: github.com/openconfig/featureprofiles/proto/metadata.proto
# proto-message: Metadata

uuid: "1f83da73-9db4-43ae-a282-bc309ff64e0e"
plan_id: "TR-6.1"
description: "Remote Syslog feature config"
testbed: TESTBED_DUT_ATE_2LINKS
platform_exceptions: {
platform: {
vendor: ARISTA
}
deviations: {
omit_l2_mtu: true
interface_config_vrf_before_address: true
interface_enabled: true
default_network_instance: "default"
static_protocol_name: "STATIC"
}
}
Loading

0 comments on commit 84e7dac

Please sign in to comment.