Skip to content
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-7 Added required deviations. #3640

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,14 @@ platform_exceptions: {
deviations: {
component_mfg_date_unsupported: true
}
}
}
platform_exceptions: {
platform: {
vendor: NOKIA
}
deviations: {
interface_enabled: true
require_zr_oper_mode: true
explicit_dco_config: true
}
}
37 changes: 30 additions & 7 deletions internal/cfgplugins/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
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.
Expand Down
11 changes: 11 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1264,3 +1264,14 @@ func IsisDatabaseOverloadsUnsupported(dut *ondatra.DUTDevice) bool {
func BgpSetMedV7Unsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetBgpSetMedV7Unsupported()
}

// RequireZrOperMode returns true for the devices that require a mandatory value in operational-mode leaf for optical-channel
func RequireZrOperMode(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetRequireZrOperMode()
}

// ExplicitDcoConfig returns true if a user-configured value is required in module-functional-type for the transceiver
func ExplicitDcoConfig(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetExplicitDcoConfig()
}

7 changes: 6 additions & 1 deletion proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,12 @@ message Metadata {
// Juniper: b/358534837
// Devices that do not support setting med value using union type in OC.
bool bgp_set_med_v7_unsupported = 241;

// Nokia: b/383369830
// RequireZrOperMode returns true if a user-configured value is required in operational-mode for the optical-channel
bool require_zr_oper_mode = 242;
// Nokia: b/383075189
// ExplicitDcoConfig returns true if explicit configurations are required in module-functional-type for the transceiver
bool explicit_dco_config = 243;
// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 90, 97, 55, 89, 19, 36, 35, 40, 173;
}
Expand Down
Loading
Loading