diff --git a/feature/platform/transceiver/tests/zr_fec_uncorrectable_frames_test/metadata.textproto b/feature/platform/transceiver/tests/zr_fec_uncorrectable_frames_test/metadata.textproto index f2bd6231241..114f4c8896c 100644 --- a/feature/platform/transceiver/tests/zr_fec_uncorrectable_frames_test/metadata.textproto +++ b/feature/platform/transceiver/tests/zr_fec_uncorrectable_frames_test/metadata.textproto @@ -13,6 +13,7 @@ platform_exceptions: { interface_enabled: true default_network_instance: "default" missing_port_to_optical_channel_component_mapping: true + channel_assignment_rate_class_parameters_unsupported: true } } platform_exceptions: { diff --git a/feature/platform/transceiver/tests/zr_logical_channels_test/metadata.textproto b/feature/platform/transceiver/tests/zr_logical_channels_test/metadata.textproto index fb942581ff5..d8e27d1fcc1 100644 --- a/feature/platform/transceiver/tests/zr_logical_channels_test/metadata.textproto +++ b/feature/platform/transceiver/tests/zr_logical_channels_test/metadata.textproto @@ -12,6 +12,7 @@ platform_exceptions: { interface_enabled: true default_network_instance: "default" missing_port_to_optical_channel_component_mapping: true + channel_assignment_rate_class_parameters_unsupported: true } } platform_exceptions: { diff --git a/feature/platform/transceiver/tests/zr_pm_test/metadata.textproto b/feature/platform/transceiver/tests/zr_pm_test/metadata.textproto index e7ad71ae9dd..6e3e5a8d2fe 100644 --- a/feature/platform/transceiver/tests/zr_pm_test/metadata.textproto +++ b/feature/platform/transceiver/tests/zr_pm_test/metadata.textproto @@ -11,6 +11,7 @@ platform_exceptions: { } deviations: { default_network_instance: "default" + channel_assignment_rate_class_parameters_unsupported: true } } platform_exceptions: { diff --git a/internal/cfgplugins/interface.go b/internal/cfgplugins/interface.go index fdef68680b5..9e9c2f4009a 100644 --- a/internal/cfgplugins/interface.go +++ b/internal/cfgplugins/interface.go @@ -140,36 +140,28 @@ func ConfigETHChannel(t *testing.T, dut *ondatra.DUTDevice, interfaceName, trans Transceiver: ygot.String(transceiverName), } } - var assignment = map[uint32]*oc.TerminalDevice_Channel_Assignment{} + var assignment = map[uint32]*oc.TerminalDevice_Channel_Assignment{ + 0: { + Index: ygot.Uint32(0), + LogicalChannel: ygot.Uint32(otnIndex), + Description: ygot.String("ETH to OTN"), + Allocation: ygot.Float64(400), + AssignmentType: oc.Assignment_AssignmentType_LOGICAL_CHANNEL, + }, + } if deviations.EthChannelAssignmentCiscoNumbering(dut) { - assignment = map[uint32]*oc.TerminalDevice_Channel_Assignment{ - 0: { - Index: ygot.Uint32(1), - LogicalChannel: ygot.Uint32(otnIndex), - Description: ygot.String("ETH to OTN"), - Allocation: ygot.Float64(400), - AssignmentType: oc.Assignment_AssignmentType_LOGICAL_CHANNEL, - }, - } - } else { - assignment = map[uint32]*oc.TerminalDevice_Channel_Assignment{ - 0: { - Index: ygot.Uint32(0), - LogicalChannel: ygot.Uint32(otnIndex), - Description: ygot.String("ETH to OTN"), - Allocation: ygot.Float64(400), - AssignmentType: oc.Assignment_AssignmentType_LOGICAL_CHANNEL, - }, - } + assignment[0].Index = ygot.Uint32(1) } - channel := &oc.TerminalDevice_Channel{ + var channel = &oc.TerminalDevice_Channel{ Description: ygot.String("ETH Logical Channel"), Index: ygot.Uint32(ethIndex), LogicalChannelType: oc.TransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE_PROT_ETHERNET, TribProtocol: oc.TransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_400GE, - RateClass: oc.TransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_400G, Ingress: ingress, Assignment: assignment, } + if !deviations.ChannelRateClassParametersUnsupported(dut) { + channel.RateClass = oc.TransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_400G + } gnmi.Replace(t, dut, gnmi.OC().TerminalDevice().Channel(ethIndex).Config(), channel) } diff --git a/internal/deviations/deviations.go b/internal/deviations/deviations.go index 9b77880799a..07dc0d51adc 100644 --- a/internal/deviations/deviations.go +++ b/internal/deviations/deviations.go @@ -1292,3 +1292,8 @@ func DefaultBgpInstanceName(dut *ondatra.DUTDevice) string { } return "DEFAULT" } + +// ChannelRateClassParametersUnsupported returns true if channel rate class parameters are unsupported +func ChannelRateClassParametersUnsupported(dut *ondatra.DUTDevice) bool { + return lookupDUTDeviations(dut).GetChannelAssignmentRateClassParametersUnsupported() +} diff --git a/proto/metadata.proto b/proto/metadata.proto index 448242f9d57..b9dafbe0075 100644 --- a/proto/metadata.proto +++ b/proto/metadata.proto @@ -38,6 +38,7 @@ message Metadata { TESTBED_DUT_DUT_ATE_2LINKS = 6; TESTBED_DUT_ATE_8LINKS = 7; TESTBED_DUT_400ZR = 8; + TESTBED_DUT_400ZR_PLUS = 9; } // Testbed on which the test is intended to run. Testbed testbed = 4; @@ -686,6 +687,8 @@ message Metadata { // Cisco: b/388983709 // default bgp instance name is used to set bgp instance name value other than DEFAULT string default_bgp_instance_name = 246; + // Arista does not support ETHChannel rate-class + bool channel_assignment_rate_class_parameters_unsupported = 247; // Reserved field numbers and identifiers. reserved 84, 9, 28, 20, 90, 97, 55, 89, 19, 36, 35, 40, 173; diff --git a/proto/metadata_go_proto/metadata.pb.go b/proto/metadata_go_proto/metadata.pb.go index 6b29a50840d..7c856ab6450 100644 --- a/proto/metadata_go_proto/metadata.pb.go +++ b/proto/metadata_go_proto/metadata.pb.go @@ -49,6 +49,7 @@ const ( Metadata_TESTBED_DUT_DUT_ATE_2LINKS Metadata_Testbed = 6 Metadata_TESTBED_DUT_ATE_8LINKS Metadata_Testbed = 7 Metadata_TESTBED_DUT_400ZR Metadata_Testbed = 8 + Metadata_TESTBED_DUT_400ZR_PLUS Metadata_Testbed = 9 ) // Enum value maps for Metadata_Testbed. @@ -63,6 +64,7 @@ var ( 6: "TESTBED_DUT_DUT_ATE_2LINKS", 7: "TESTBED_DUT_ATE_8LINKS", 8: "TESTBED_DUT_400ZR", + 9: "TESTBED_DUT_400ZR_PLUS", } Metadata_Testbed_value = map[string]int32{ "TESTBED_UNSPECIFIED": 0, @@ -74,6 +76,7 @@ var ( "TESTBED_DUT_DUT_ATE_2LINKS": 6, "TESTBED_DUT_ATE_8LINKS": 7, "TESTBED_DUT_400ZR": 8, + "TESTBED_DUT_400ZR_PLUS": 9, } ) @@ -968,6 +971,8 @@ type Metadata_Deviations struct { // Cisco: b/388983709 // default bgp instance name is used to set bgp instance name value other than DEFAULT DefaultBgpInstanceName string `protobuf:"bytes,246,opt,name=default_bgp_instance_name,json=defaultBgpInstanceName,proto3" json:"default_bgp_instance_name,omitempty"` + // Arista does not support ETHChannel rate-class + ChannelAssignmentRateClassParametersUnsupported bool `protobuf:"varint,247,opt,name=channel_assignment_rate_class_parameters_unsupported,json=channelAssignmentRateClassParametersUnsupported,proto3" json:"channel_assignment_rate_class_parameters_unsupported,omitempty"` } func (x *Metadata_Deviations) Reset() { @@ -2577,6 +2582,13 @@ func (x *Metadata_Deviations) GetDefaultBgpInstanceName() string { return "" } +func (x *Metadata_Deviations) GetChannelAssignmentRateClassParametersUnsupported() bool { + if x != nil { + return x.ChannelAssignmentRateClassParametersUnsupported + } + return false +} + type Metadata_PlatformExceptions struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2640,7 +2652,7 @@ var file_metadata_proto_rawDesc = []byte{ 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6f, 0x6e, 0x64, 0x61, 0x74, 0x72, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x62, 0x65, - 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x8b, 0x01, 0x0a, 0x08, 0x4d, 0x65, 0x74, + 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, 0x8c, 0x01, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x61, 0x6e, @@ -2674,7 +2686,7 @@ var file_metadata_proto_rawDesc = []byte{ 0x65, 0x67, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x67, 0x65, 0x78, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x52, 0x0e, 0x68, 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x1a, 0xd9, 0x82, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x1a, 0xc9, 0x83, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x69, 0x70, 0x76, 0x34, 0x5f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x69, 0x70, 0x76, 0x34, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, @@ -3715,7 +3727,14 @@ var file_metadata_proto_rawDesc = []byte{ 0x6c, 0x74, 0x5f, 0x62, 0x67, 0x70, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0xf6, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x42, 0x67, 0x70, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x4a, 0x04, 0x08, 0x54, 0x10, 0x55, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, 0x4a, + 0x61, 0x6d, 0x65, 0x12, 0x6e, 0x0a, 0x34, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x61, + 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x63, + 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x5f, + 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0xf7, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x41, 0x73, 0x73, 0x69, 0x67, + 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x55, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, + 0x74, 0x65, 0x64, 0x4a, 0x04, 0x08, 0x54, 0x10, 0x55, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, 0x4a, 0x04, 0x08, 0x1c, 0x10, 0x1d, 0x4a, 0x04, 0x08, 0x14, 0x10, 0x15, 0x4a, 0x04, 0x08, 0x5a, 0x10, 0x5b, 0x4a, 0x04, 0x08, 0x61, 0x10, 0x62, 0x4a, 0x04, 0x08, 0x37, 0x10, 0x38, 0x4a, 0x04, 0x08, 0x59, 0x10, 0x5a, 0x4a, 0x04, 0x08, 0x13, 0x10, 0x14, 0x4a, 0x04, 0x08, 0x24, 0x10, 0x25, 0x4a, @@ -3730,7 +3749,7 @@ var file_metadata_proto_rawDesc = []byte{ 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xfa, 0x01, 0x0a, 0x07, 0x54, 0x65, 0x73, 0x74, 0x62, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x96, 0x02, 0x0a, 0x07, 0x54, 0x65, 0x73, 0x74, 0x62, 0x65, 0x64, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, @@ -3746,14 +3765,16 @@ var file_metadata_proto_rawDesc = []byte{ 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x38, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x34, 0x30, 0x30, 0x5a, - 0x52, 0x10, 0x08, 0x22, 0x6d, 0x0a, 0x04, 0x54, 0x61, 0x67, 0x73, 0x12, 0x14, 0x0a, 0x10, 0x54, - 0x41, 0x47, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x41, 0x47, 0x47, 0x52, 0x45, 0x47, - 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x54, 0x41, 0x47, 0x53, 0x5f, - 0x44, 0x41, 0x54, 0x41, 0x43, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x5f, 0x45, 0x44, 0x47, 0x45, 0x10, - 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x45, 0x44, 0x47, 0x45, 0x10, 0x03, - 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x49, 0x54, - 0x10, 0x04, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x10, 0x08, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, + 0x55, 0x54, 0x5f, 0x34, 0x30, 0x30, 0x5a, 0x52, 0x5f, 0x50, 0x4c, 0x55, 0x53, 0x10, 0x09, 0x22, + 0x6d, 0x0a, 0x04, 0x54, 0x61, 0x67, 0x73, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x47, 0x53, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, + 0x10, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x41, 0x47, 0x47, 0x52, 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, + 0x4e, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x44, 0x41, 0x54, 0x41, + 0x43, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x5f, 0x45, 0x44, 0x47, 0x45, 0x10, 0x02, 0x12, 0x0d, 0x0a, + 0x09, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x45, 0x44, 0x47, 0x45, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, + 0x54, 0x41, 0x47, 0x53, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x49, 0x54, 0x10, 0x04, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/topologies/dut_400zr_plus.testbed b/topologies/dut_400zr_plus.testbed new file mode 100644 index 00000000000..8d7a1f159e7 --- /dev/null +++ b/topologies/dut_400zr_plus.testbed @@ -0,0 +1,23 @@ +# proto-file: github.com/openconfig/ondatra/blob/main/proto/testbed.proto +# proto-message: ondatra.Testbed + +# 1 DUT, 2 port, 400ZR_PLUS optics + +duts { + id: "dut" + ports { + id: "port1" + speed: S_400GB + pmd: PMD_400GBASE_ZR_PLUS + } + ports { + id: "port2" + speed: S_400GB + pmd: PMD_400GBASE_ZR_PLUS + } +} + +links { + a: "dut:port1" + b: "dut:port2" +}