From dcf02d1fc499fdb1f6f44a528cbb77b0b43ccb15 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Tue, 17 Dec 2024 20:04:47 +0000 Subject: [PATCH] Arista device is not supporting ETH channel rate class yet. Adding this deviation. --- internal/cfgplugins/interface.go | 28 ++++++++++++++++++++-------- internal/deviations/deviations.go | 5 +++++ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/internal/cfgplugins/interface.go b/internal/cfgplugins/interface.go index 9a140168fd2..c3de901fa4c 100644 --- a/internal/cfgplugins/interface.go +++ b/internal/cfgplugins/interface.go @@ -162,14 +162,26 @@ func ConfigETHChannel(t *testing.T, dut *ondatra.DUTDevice, interfaceName, trans }, } } - 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, + var channel *oc.TerminalDevice_Channel + if deviations.ChannelRateClassParametersUnsupported(dut) { + 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, + Ingress: ingress, + Assignment: assignment, + } + } else { + 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, + } } gnmi.Replace(t, dut, gnmi.OC().TerminalDevice().Channel(ethIndex).Config(), channel) } diff --git a/internal/deviations/deviations.go b/internal/deviations/deviations.go index c60ba035066..6d9019d5945 100644 --- a/internal/deviations/deviations.go +++ b/internal/deviations/deviations.go @@ -1243,3 +1243,8 @@ func EnableTableConnections(dut *ondatra.DUTDevice) bool { func NoZeroSuppression(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetNoZeroSuppression() } + +// ChannelRateClassParametersUnsupported returns true if channel rate class parameters are unsupported +func ChannelRateClassParametersUnsupported(dut *ondatra.DUTDevice) bool { + return lookupDUTDeviations(dut).GetChannelAssignmentRateClassParametersUnsupported() +}