Skip to content

Commit

Permalink
Merge branch 'openconfig:main' into certz4
Browse files Browse the repository at this point in the history
  • Loading branch information
priyacj authored Feb 20, 2025
2 parents 06d6d9a + 1c021b6 commit 8a7c48c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 67 deletions.
9 changes: 0 additions & 9 deletions feature/gribi/otg_tests/static_lsp_test/metadata.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,3 @@ platform_exceptions: {
ipv4_missing_enabled: true
}
}

platform_exceptions: {
platform: {
vendor: JUNIPER
}
deviations: {
static_lsp_unsupported: true
}
}
64 changes: 9 additions & 55 deletions feature/gribi/otg_tests/static_lsp_test/static_lsp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/openconfig/featureprofiles/internal/attrs"
"github.com/openconfig/featureprofiles/internal/deviations"
"github.com/openconfig/featureprofiles/internal/fptest"
"github.com/openconfig/featureprofiles/internal/helpers"
"github.com/openconfig/featureprofiles/internal/otgutils"
"github.com/openconfig/ondatra"
"github.com/openconfig/ondatra/gnmi"
Expand Down Expand Up @@ -142,60 +141,15 @@ func configureOTG(t *testing.T) gosnappi.Config {

// configureStaticLSP configures a static MPLS LSP with the provided parameters.
func configureStaticLSP(t *testing.T, dut *ondatra.DUTDevice, lspName string, incomingLabel uint32, nextHopIP string) {
if deviations.StaticLspConfigUnsupported(dut) {
t.Logf("Push config via native CLI:%s", dut.Vendor())
switch dut.Vendor() {
case ondatra.JUNIPER:
config := juniperMplsLSPConfig(t, dut, lspName, incomingLabel, nextHopIP)
helpers.GnmiCLIConfig(t, dut, config)
default:
t.Fatalf("StaticLspConfigUnsupported deviation needs cli configuration for vendor %s which is not defined", dut.Vendor())
}
} else {
d := &oc.Root{}
// ConfigureDefaultNetworkInstance configures the default network instance name and type.
fptest.ConfigureDefaultNetworkInstance(t, dut)
mplsCfg := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut)).GetOrCreateMpls()
staticMplsCfg := mplsCfg.GetOrCreateLsps().GetOrCreateStaticLsp(lspName)
staticMplsCfg.GetOrCreateEgress().SetIncomingLabel(oc.UnionUint32(incomingLabel))
staticMplsCfg.GetOrCreateEgress().SetNextHop(nextHopIP)
staticMplsCfg.GetOrCreateEgress().SetPushLabel(oc.Egress_PushLabel_IMPLICIT_NULL)
gnmi.Update(t, dut, gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Mpls().Config(), mplsCfg)
}
}

// juniperMplsLSPConfig is used to configure mpls lsp configuration via native cli as an alternative to below xpaths.
// /network-instances/network-instance/mpls/lsps/static-lsps/static-lsp/egress/config/next-hop
// /network-instances/network-instance/mpls/lsps/static-lsps/static-lsp/egress/config/incoming-label
// /network-instances/network-instance/mpls/lsps/static-lsps/static-lsp/egress/config/push-label
func juniperMplsLSPConfig(t *testing.T, dut *ondatra.DUTDevice, lspName string, incomingLabel uint32, nextHopIP string) string {
p1 := dut.Port(t, "port1").Name()
p2 := dut.Port(t, "port2").Name()
return fmt.Sprintf(`
interfaces {
%s {
unit %d {
family mpls;
}
}
%s {
unit %d {
family mpls;
}
}
}
protocols {
mpls {
interface %s;
interface %s;
static-label-switched-path %s {
transit %d {
next-hop %s;
pop;
}
}
}
}`, p1, 0, p2, 0, p1, p2, lspName, incomingLabel, nextHopIP)
d := &oc.Root{}
// ConfigureDefaultNetworkInstance configures the default network instance name and type.
fptest.ConfigureDefaultNetworkInstance(t, dut)
mplsCfg := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut)).GetOrCreateMpls()
staticMplsCfg := mplsCfg.GetOrCreateLsps().GetOrCreateStaticLsp(lspName)
staticMplsCfg.GetOrCreateEgress().SetIncomingLabel(oc.UnionUint32(incomingLabel))
staticMplsCfg.GetOrCreateEgress().SetNextHop(nextHopIP)
staticMplsCfg.GetOrCreateEgress().SetPushLabel(oc.Egress_PushLabel_IMPLICIT_NULL)
gnmi.Update(t, dut, gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Mpls().Config(), mplsCfg)
}

func createTrafficFlow(t *testing.T,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ func TestAuthentication(t *testing.T) {
ts := isissession.MustNew(t).WithISIS()
ts.ConfigISIS(func(isis *oc.NetworkInstance_Protocol_Isis) {
level := isis.GetOrCreateLevel(2)
level.Enabled = ygot.Bool(true)
auth := level.GetOrCreateAuthentication()
auth.Enabled = ygot.Bool(true)
auth.AuthMode = tc.mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestFabricPowerAdmin(t *testing.T) {

powerDownUp(t, dut, f, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FABRIC, 3*time.Minute)

helpers.ValidateOperStatusUPIntfs(t, dut, before, 5*time.Minute)
helpers.ValidateOperStatusUPIntfs(t, dut, before, 8*time.Minute)
})
}
}
Expand Down Expand Up @@ -76,7 +76,7 @@ func TestLinecardPowerAdmin(t *testing.T) {

powerDownUp(t, dut, l, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_LINECARD, 20*time.Minute)

helpers.ValidateOperStatusUPIntfs(t, dut, before, 5*time.Minute)
helpers.ValidateOperStatusUPIntfs(t, dut, before, 8*time.Minute)
})
}
}
Expand Down
17 changes: 17 additions & 0 deletions testregistry.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,23 @@ test: {
readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/policy_forwarding/otg_tests/mpls_gre_udp_decap_test/README.md"
exec: " "
}
test: {
id: "PF-1.8"
description: "Ingress handling of the TTL, for all ingress packets decrement TTL , and for TTL=1 generate ICMP time exceeded message"
readme: " "
exec: " "
}test: {
id: "PF-1.9"
description: "Egress handling of the TTL, all egress packets should have their TTL decremented,egress packets with TTL=1 should generate ICMP time exceeded to source"
readme: " "
exec: " "
}
test: {
id: "PF-1.10"
description: "DSCP Egress handling, all egress packets IP, IPoGRE, IPoMPLSoGRE and IPoGUE, IPoMPLSoGUE should have their DSCP values re-written to 0x0 via egress QOS policy (or equivalent)"
readme: " "
exec: " "
}
test: {
id: "PLT-1.1"
description: "Interface breakout Test"
Expand Down

0 comments on commit 8a7c48c

Please sign in to comment.