Skip to content

Commit

Permalink
PR suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikeya-remilla committed Sep 26, 2024
1 parent 1d7f01c commit 876f6c0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ func configInterface(t *testing.T, dut1 *ondatra.DUTDevice, dp *ondatra.Port, en
i.Enabled = ygot.Bool(enable)
i.Type = oc.IETFInterfaces_InterfaceType_ethernetCsmacd
gnmi.Replace(t, dut1, gnmi.OC().Interface(dp.Name()).Config(), i)
component := components.OpticalChannelComponentFromPort(t, dut1, dp)
//Set config container leaf for optical channel
setConfigLeaf := gnmi.OC().Component(component)
gnmi.Update(t, dut1, setConfigLeaf.Config(), &oc.Component{
Name: ygot.String(component),
componentName := components.OpticalChannelComponentFromPort(t, dut1, dp)
// Set config container leaf for optical channel
component := gnmi.OC().Component(componentName)
gnmi.Replace(t, dut1, component.Config(), &oc.Component{
Name: ygot.String(componentName),
})
gnmi.Replace(t, dut1, gnmi.OC().Component(component).OpticalChannel().Config(), &oc.Component_OpticalChannel{
gnmi.Replace(t, dut1, component.OpticalChannel().Config(), &oc.Component_OpticalChannel{
TargetOutputPower: ygot.Float64(targetOutputPower),
Frequency: ygot.Uint64(frequency),
})
Expand Down
4 changes: 2 additions & 2 deletions internal/cfgplugins/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func ConfigOpticalChannel(t *testing.T, dut *ondatra.DUTDevice, och string, freq
// ConfigOTNChannel configures the OTN channel.
func ConfigOTNChannel(t *testing.T, dut *ondatra.DUTDevice, och string, otnIndex, ethIndex uint32) {
t.Helper()
if deviations.OTNChannelTRIBUnsupported(dut) {
if deviations.OTNChannelTribUnsupported(dut) {
gnmi.Replace(t, dut, gnmi.OC().TerminalDevice().Channel(otnIndex).Config(), &oc.TerminalDevice_Channel{
Description: ygot.String("OTN Logical Channel"),
Index: ygot.Uint32(otnIndex),
Expand Down Expand Up @@ -133,7 +133,7 @@ func ConfigOTNChannel(t *testing.T, dut *ondatra.DUTDevice, och string, otnIndex
// ConfigETHChannel configures the ETH channel.
func ConfigETHChannel(t *testing.T, dut *ondatra.DUTDevice, interfaceName, transceiverName string, otnIndex, ethIndex uint32) {
t.Helper()
if deviations.ETHChannelIngressParametersUnsupported(dut) {
if deviations.EthChannelIngressParametersUnsupported(dut) {
gnmi.Replace(t, dut, gnmi.OC().TerminalDevice().Channel(ethIndex).Config(), &oc.TerminalDevice_Channel{
Description: ygot.String("ETH Logical Channel"),
Index: ygot.Uint32(ethIndex),
Expand Down
8 changes: 4 additions & 4 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1151,12 +1151,12 @@ func ComponentMfgDateUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetComponentMfgDateUnsupported()
}

// OTNChannelTRIBUnsupported returns true if TRIB parameter is unsupported under OTN channel configuration
func OTNChannelTRIBUnsupported(dut *ondatra.DUTDevice) bool {
// OTNChannelTribUnsupported returns true if TRIB parameter is unsupported under OTN channel configuration
func OTNChannelTribUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetOtnChannelTribUnsupported()
}

// ETHChannelIngressParametersUnsupported returns true if ingress parameters are unsupported under ETH channel configuration
func ETHChannelIngressParametersUnsupported(dut *ondatra.DUTDevice) bool {
// EthChannelIngressParametersUnsupported returns true if ingress parameters are unsupported under ETH channel configuration
func EthChannelIngressParametersUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetEthChannelIngressParametersUnsupported()
}

0 comments on commit 876f6c0

Please sign in to comment.