-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TRANSCEIVER-12 Fixed with adding required deviations #3638
base: main
Are you sure you want to change the base?
Changes from 6 commits
cc57093
b8af83e
cfbfdf9
c8b9275
9abfd2b
c32b256
eaed3dc
11c9eb0
ecbe171
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -41,13 +41,36 @@ func InterfaceConfig(t *testing.T, dut *ondatra.DUTDevice, dp *ondatra.Port) { | |||
i.Enabled = ygot.Bool(true) | ||||
i.Type = oc.IETFInterfaces_InterfaceType_ethernetCsmacd | ||||
gnmi.Replace(t, dut, gnmi.OC().Interface(dp.Name()).Config(), i) | ||||
ocComponent := components.OpticalChannelComponentFromPort(t, dut, dp) | ||||
t.Logf("Got opticalChannelComponent from port: %s", ocComponent) | ||||
gnmi.Update(t, dut, gnmi.OC().Component(ocComponent).Name().Config(), ocComponent) | ||||
gnmi.Replace(t, dut, gnmi.OC().Component(ocComponent).OpticalChannel().Config(), &oc.Component_OpticalChannel{ | ||||
TargetOutputPower: ygot.Float64(targetOutputPowerdBm), | ||||
Frequency: ygot.Uint64(targetFrequencyMHz), | ||||
}) | ||||
if deviations.ExplicitDcoConfig(dut) { | ||||
transceiverName := gnmi.Get(t, dut, gnmi.OC().Interface(dp.Name()).Transceiver().State()) | ||||
gnmi.Replace(t, dut, gnmi.OC().Component(transceiverName).Config(), &oc.Component{ | ||||
Name: ygot.String(transceiverName), | ||||
Transceiver: &oc.Component_Transceiver{ | ||||
ModuleFunctionalType: oc.TransportTypes_TRANSCEIVER_MODULE_FUNCTIONAL_TYPE_TYPE_DIGITAL_COHERENT_OPTIC, | ||||
}, | ||||
}) | ||||
} | ||||
if deviations.RequireZrOperMode(dut) { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should be using ConfigOpticalChannel() here and then we don't need a deviation?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can set this up calling ConfigOpticalChannel() under InterfaceConfig(); however will this have any negative impact on existing implementation of other vendors where the oper-mode may be self-discovered? |
||||
ocComponent := components.OpticalChannelComponentFromPort(t, dut, dp) | ||||
t.Logf("Got opticalChannelComponent from port: %s", ocComponent) | ||||
var operMode uint16 = 83 | ||||
gnmi.Replace(t, dut, gnmi.OC().Component(ocComponent).Config(), &oc.Component{ | ||||
Name: ygot.String(ocComponent), | ||||
OpticalChannel: &oc.Component_OpticalChannel{ | ||||
TargetOutputPower: ygot.Float64(targetOutputPowerdBm), | ||||
Frequency: ygot.Uint64(targetFrequencyMHz), | ||||
OperationalMode: ygot.Uint16(operMode), | ||||
}, | ||||
}) | ||||
} else { | ||||
ocComponent := components.OpticalChannelComponentFromPort(t, dut, dp) | ||||
t.Logf("Got opticalChannelComponent from port: %s", ocComponent) | ||||
gnmi.Update(t, dut, gnmi.OC().Component(ocComponent).Name().Config(), ocComponent) | ||||
gnmi.Replace(t, dut, gnmi.OC().Component(ocComponent).OpticalChannel().Config(), &oc.Component_OpticalChannel{ | ||||
TargetOutputPower: ygot.Float64(targetOutputPowerdBm), | ||||
Frequency: ygot.Uint64(targetFrequencyMHz), | ||||
}) | ||||
} | ||||
} | ||||
|
||||
// ValidateInterfaceConfig validates the output power and frequency for the given port. | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not encode specific implementation's oper-mode's here.
If you want to specify a specific oper-mode, this should be done through a flag in the tests. As an example:
featureprofiles/feature/platform/transceiver/tests/zr_pm_test/zr_pm_test.go
Line 37 in ecbe171