Skip to content

Commit

Permalink
Merge branch 'main' into RT-1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
cprabha authored Aug 30, 2024
2 parents ba630cc + 971d8de commit 38b40a5
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,13 @@ func pushDecapScaleEntries(t *testing.T, args *testArgs, decapEntries []string)
}

func installDecapEntry(t *testing.T, args *testArgs, nhIndex, nhgIndex uint64, prefix string) {
decapNH := fluent.NextHopEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(args.dut)).
WithIndex(nhIndex).WithDecapsulateHeader(fluent.IPinIP)
if !deviations.DecapNHWithNextHopNIUnsupported(args.dut) {
decapNH.WithNextHopNetworkInstance(deviations.DefaultNetworkInstance(args.dut))
}
args.client.Modify().AddEntry(t,
fluent.NextHopEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(args.dut)).
WithIndex(nhIndex).WithDecapsulateHeader(fluent.IPinIP).
WithNextHopNetworkInstance(deviations.DefaultNetworkInstance(args.dut)),
decapNH,
fluent.NextHopGroupEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(args.dut)).
WithID(nhgIndex).AddNextHop(nhIndex, 1),
fluent.IPv4Entry().WithNetworkInstance(niDecapTeVrf).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ platform_exceptions: {
interface_enabled: true
default_network_instance: "default"
omit_l2_mtu: true
decap_nh_with_nexthop_ni_unsupported: true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,29 +80,23 @@ var (
func configureDUT(t *testing.T, dut *ondatra.DUTDevice) {
d := gnmi.OC()
p1 := dut.Port(t, "port1")
i1 := &oc.Interface{Name: ygot.String(p1.Name())}
gnmi.Replace(t, dut, d.Interface(p1.Name()).Config(), configInterfaceDUT(i1, &dutSrc, dut))
gnmi.Replace(t, dut, d.Interface(p1.Name()).Config(), configInterfaceDUT(p1, &dutSrc, dut))
p2 := dut.Port(t, "port2")
i2 := &oc.Interface{Name: ygot.String(p2.Name())}
gnmi.Replace(t, dut, d.Interface(p2.Name()).Config(), configInterfaceDUT(i2, &dutDst, dut))
gnmi.Replace(t, dut, d.Interface(p2.Name()).Config(), configInterfaceDUT(p2, &dutDst, dut))
}

// Configures the given DUT interface.
func configInterfaceDUT(i *oc.Interface, a *attrs.Attributes, dut *ondatra.DUTDevice) *oc.Interface {
i.Description = ygot.String(a.Desc)
i.Type = oc.IETFInterfaces_InterfaceType_ethernetCsmacd
if deviations.InterfaceEnabled(dut) {
i.Enabled = ygot.Bool(true)
func configInterfaceDUT(p *ondatra.Port, a *attrs.Attributes, dut *ondatra.DUTDevice) *oc.Interface {
i := a.NewOCInterface(p.Name(), dut)
s4 := i.GetOrCreateSubinterface(0).GetOrCreateIpv4()
if deviations.InterfaceEnabled(dut) && !deviations.IPv4MissingEnabled(dut) {
s4.Enabled = ygot.Bool(true)
}
s := i.GetOrCreateSubinterface(0)
s6 := s.GetOrCreateIpv6()
if deviations.InterfaceEnabled(dut) {
s6.Enabled = ygot.Bool(true)
}
s6a := s6.GetOrCreateAddress(a.IPv6)
s6a.PrefixLength = ygot.Uint8(plen6)
s6 := i.GetOrCreateSubinterface(0).GetOrCreateIpv6()
routerAdvert := s6.GetOrCreateRouterAdvertisement()
routerAdvert.SetInterval(routerAdvertisementTimeInterval)
if !deviations.Ipv6RouterAdvertisementIntervalUnsupported(dut) {
routerAdvert.SetInterval(routerAdvertisementTimeInterval)
}
if deviations.Ipv6RouterAdvertisementConfigUnsupported(dut) {
routerAdvert.SetSuppress(routerAdvertisementDisabled)
} else {
Expand Down Expand Up @@ -143,11 +137,13 @@ func configureOTG(t *testing.T, ate *ondatra.ATEDevice) gosnappi.Config {
// Verifies that desired parameters are set with required value on the device.
func verifyRATelemetry(t *testing.T, dut *ondatra.DUTDevice) {
txPort := dut.Port(t, "port1")
telemetryTimeIntervalQuery := gnmi.OC().Interface(txPort.Name()).Subinterface(0).Ipv6().RouterAdvertisement().Interval().State()
timeIntervalOnTelemetry := gnmi.Get(t, dut, telemetryTimeIntervalQuery)
t.Logf("Required RA time interval = %v, RA Time interval observed on telemetry = %v ", routerAdvertisementTimeInterval, timeIntervalOnTelemetry)
if timeIntervalOnTelemetry != routerAdvertisementTimeInterval {
t.Fatalf("Inconsistent Time interval!\nRequired RA time interval = %v and Configured RA Time Interval = %v are not same!", routerAdvertisementTimeInterval, timeIntervalOnTelemetry)
if !deviations.Ipv6RouterAdvertisementIntervalUnsupported(dut) {
telemetryTimeIntervalQuery := gnmi.OC().Interface(txPort.Name()).Subinterface(0).Ipv6().RouterAdvertisement().Interval().State()
timeIntervalOnTelemetry := gnmi.Get(t, dut, telemetryTimeIntervalQuery)
t.Logf("Required RA time interval = %v, RA Time interval observed on telemetry = %v ", routerAdvertisementTimeInterval, timeIntervalOnTelemetry)
if timeIntervalOnTelemetry != routerAdvertisementTimeInterval {
t.Fatalf("Inconsistent Time interval!\nRequired RA time interval = %v and Configured RA Time Interval = %v are not same!", routerAdvertisementTimeInterval, timeIntervalOnTelemetry)
}
}

if deviations.Ipv6RouterAdvertisementConfigUnsupported(dut) {
Expand Down Expand Up @@ -210,7 +206,6 @@ func validatePackets(t *testing.T, fileName string) {
if routerAdvert != nil {
t.Fatalf("Error:Found a router advertisement packet!")
}

}
}
}
Expand All @@ -229,5 +224,4 @@ func TestIpv6NDRA(t *testing.T) {
t.Run("TestCase-2: No Router Advertisement in response to Router Solicitation", func(t *testing.T) {
verifyOTGPacketCaptureForRA(t, ate, otgConfig, true, 1)
})

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ platform_exceptions: {
}
deviations: {
interface_enabled: true
ipv6_router_advertisement_interval_unsupported: true
}
}
10 changes: 10 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1119,3 +1119,13 @@ func BgpAfiSafiInDefaultNiBeforeOtherNi(dut *ondatra.DUTDevice) bool {
func DefaultImportExportPolicyUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetDefaultImportExportPolicyUnsupported()
}

// Ipv6RouterAdvertisementIntervalUnsupported returns true for devices which don't support Ipv6 RouterAdvertisement interval configuration
func Ipv6RouterAdvertisementIntervalUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetIpv6RouterAdvertisementIntervalUnsupported()
}

// DecapNHWithNextHopNIUnsupported returns true if Decap NH with NextHopNetworkInstance is unsupported
func DecapNHWithNextHopNIUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetDecapNhWithNexthopNiUnsupported()
}
5 changes: 4 additions & 1 deletion proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,10 @@ message Metadata {
bool bgp_afi_safi_in_default_ni_before_other_ni = 212;
// Devices which do not support default import export policy.
bool default_import_export_policy_unsupported = 213;

// ipv6_router_advertisement_interval_unsupported is set to true for devices that do not support ipv6 router advertisement interval configuration.
bool ipv6_router_advertisement_interval_unsupported = 214;
// Decap NH with NextHopNetworkInstance is unsupported
bool decap_nh_with_nexthop_ni_unsupported = 215;

// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 90, 97, 55, 89, 19, 36, 35, 40, 173;
Expand Down
111 changes: 70 additions & 41 deletions proto/metadata_go_proto/metadata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions testregistry.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,18 @@ test: {
readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/mpls/otg_tests/label_block/README.md"
exec: " "
}
test: {
id: "MTU-1.3"
description: "Large IP Packet Transmission"
readme: "https://github.com/openconfig/featureprofiles/tree/main/feature/mtu/largeippacket/otg_tests/large_ip_packet_transmission"
exec: " "
}
test: {
id: "MTU-1.5"
description: "Path MTU handling"
readme: "https://github.com/openconfig/featureprofiles/tree/main/feature/mtu/otg_tests/pmtu_handing"
exec: " "
}
test: {
id: "OC-1.1"
description: "System Configuration"
Expand Down

0 comments on commit 38b40a5

Please sign in to comment.