diff --git a/feature/platform/transceiver/tests/zr_tunable_parameters_test/zr_tunable_parameters_test.go b/feature/platform/transceiver/tests/zr_tunable_parameters_test/zr_tunable_parameters_test.go index fe01013e2be..5fc86b1abde 100644 --- a/feature/platform/transceiver/tests/zr_tunable_parameters_test/zr_tunable_parameters_test.go +++ b/feature/platform/transceiver/tests/zr_tunable_parameters_test/zr_tunable_parameters_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + fpargs "github.com/openconfig/featureprofiles/internal/args" "github.com/openconfig/featureprofiles/internal/attrs" "github.com/openconfig/featureprofiles/internal/deviations" "github.com/openconfig/featureprofiles/internal/fptest" @@ -18,7 +19,6 @@ import ( const ( samplingInterval = 10 * time.Second frequencyTolerance = 1800 - dp16QAM = 1 ) var ( @@ -41,6 +41,7 @@ func Test400ZRTunableFrequency(t *testing.T) { dut := ondatra.DUT(t, "dut") p1 := dut.Port(t, "port1") p2 := dut.Port(t, "port2") + dp16QAM := uint16(*fpargs.OpticChannelOperationalMode) fptest.ConfigureDefaultNetworkInstance(t, dut) gnmi.Replace(t, dut, gnmi.OC().Interface(p1.Name()).Config(), dutPort1.NewOCInterface(p1.Name(), dut)) gnmi.Replace(t, dut, gnmi.OC().Interface(p2.Name()).Config(), dutPort2.NewOCInterface(p2.Name(), dut)) @@ -76,6 +77,14 @@ func Test400ZRTunableFrequency(t *testing.T) { targetOutputPower: -9, }, } + opticalChannelList := []string{oc1, oc2} + //Set config container leaf for optical channel + for _, opticChannel := range opticalChannelList { + setConfigLeaf := gnmi.OC().Component(opticChannel) + gnmi.Update(t, dut, setConfigLeaf.Config(), &oc.Component{ + Name: ygot.String(opticChannel), + }) + } for _, tc := range tests { t.Run(tc.description, func(t *testing.T) { for freq := tc.startFreq; freq <= tc.endFreq; freq += tc.freqStep { @@ -103,6 +112,7 @@ func Test400ZRTunableOutputPower(t *testing.T) { p1 := dut.Port(t, "port1") p2 := dut.Port(t, "port2") fptest.ConfigureDefaultNetworkInstance(t, dut) + dp16QAM := uint16(*fpargs.OpticChannelOperationalMode) gnmi.Replace(t, dut, gnmi.OC().Interface(p1.Name()).Config(), dutPort1.NewOCInterface(p1.Name(), dut)) gnmi.Replace(t, dut, gnmi.OC().Interface(p2.Name()).Config(), dutPort2.NewOCInterface(p2.Name(), dut)) oc1 := opticalChannelFromPort(t, dut, p1) @@ -111,6 +121,14 @@ func Test400ZRTunableOutputPower(t *testing.T) { defer streamOC1.Close() streamOC2 := samplestream.New(t, dut, gnmi.OC().Component(oc2).State(), 10*time.Second) defer streamOC2.Close() + opticalChannelList := []string{oc1, oc2} + //Set config container leaf for optical channel + for _, opticChannel := range opticalChannelList { + setConfigLeaf := gnmi.OC().Component(opticChannel) + gnmi.Update(t, dut, setConfigLeaf.Config(), &oc.Component{ + Name: ygot.String(opticChannel), + }) + } tests := []struct { description string frequency uint64 @@ -153,6 +171,7 @@ func Test400ZRInterfaceFlap(t *testing.T) { dut := ondatra.DUT(t, "dut") p1 := dut.Port(t, "port1") p2 := dut.Port(t, "port2") + dp16QAM := uint16(*fpargs.OpticChannelOperationalMode) fptest.ConfigureDefaultNetworkInstance(t, dut) gnmi.Replace(t, dut, gnmi.OC().Interface(p1.Name()).Config(), dutPort1.NewOCInterface(p1.Name(), dut)) gnmi.Replace(t, dut, gnmi.OC().Interface(p2.Name()).Config(), dutPort2.NewOCInterface(p2.Name(), dut)) @@ -203,6 +222,7 @@ func Test400ZRInterfaceFlap(t *testing.T) { } func validateOpticsTelemetry(t *testing.T, streams []*samplestream.SampleStream[*oc.Component], frequency uint64, outputPower float64) { dut := ondatra.DUT(t, "dut") + dp16QAM := uint16(*fpargs.OpticChannelOperationalMode) var ocs []*oc.Component_OpticalChannel for _, s := range streams { val := s.Next() diff --git a/internal/args/args.go b/internal/args/args.go index 1afbf3aa1f3..f1149ccb565 100644 --- a/internal/args/args.go +++ b/internal/args/args.go @@ -50,9 +50,10 @@ var ( DecapEncapCount = flag.Int("arg_decap_encap_count", 64, "In gRIBI scaling tests, number of next-hop-groups with decap+encap next-hops") DefaultVRFPrimarySubifCount = flag.Int("arg_default_vrf_primary_subif_count", 64, "In gRIBI scaling tests, number of subinterfaces to use for \"primary\" (i.e. non-backup) next-hop forwarding. Set such that DefaultVRFPrimarySubifCount <= (DefaultVRFIPv4NHCount - DefaultVRFIPv4NHSize)") - V4TunnelCount = flag.Int("arg_v4_tunnel_count", 20000, "In gRIBI scaling tests, the number of tunnel IPs.") - V4TunnelNHGCount = flag.Int("arg_v4_tunnel_nhg_count", 256, "In gRIBI scaling tests, the number of next-hop-groups associated to the v4 tunnels.") - V4TunnelNHGSplitCount = flag.Int("arg_v4_tunnel_nhg_split_count", 2, "In gRIBI scaling tests, the number of next-hop per next-hop-group for the v4 tunnels.") - EgressNHGSplitCount = flag.Int("arg_egress_nhg_split_count", 16, "In gRIBI scaling tests, the number of next-hop per next-hop-group for the egress traffic.") - V4ReEncapNHGCount = flag.Int("arg_v4_re_encap_nhg_count", 256, "In gRIBI scaling tests, the number of next-hop-groups for re-encapping v4 tunnels.") + V4TunnelCount = flag.Int("arg_v4_tunnel_count", 20000, "In gRIBI scaling tests, the number of tunnel IPs.") + V4TunnelNHGCount = flag.Int("arg_v4_tunnel_nhg_count", 256, "In gRIBI scaling tests, the number of next-hop-groups associated to the v4 tunnels.") + V4TunnelNHGSplitCount = flag.Int("arg_v4_tunnel_nhg_split_count", 2, "In gRIBI scaling tests, the number of next-hop per next-hop-group for the v4 tunnels.") + EgressNHGSplitCount = flag.Int("arg_egress_nhg_split_count", 16, "In gRIBI scaling tests, the number of next-hop per next-hop-group for the egress traffic.") + V4ReEncapNHGCount = flag.Int("arg_v4_re_encap_nhg_count", 256, "In gRIBI scaling tests, the number of next-hop-groups for re-encapping v4 tunnels.") + OpticChannelOperationalMode = flag.Int("arg_optic_channel_operational_mode", 1, "Vendor-specific operational mode identifier for the terminal-optical-channel") )