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

add deviation for leaf constraint #3524

Merged
merged 17 commits into from
Oct 18, 2024
24 changes: 20 additions & 4 deletions feature/platform/tests/power_admin_down_up_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,27 @@ ControllerCard.
to POWER_ENABLED.
* Verify /components/component/state/oper-status returns to ACTIVE.

## Config Parameter coverage
## Minumum DUT platform requirement
vRX

* /components/component/{fabric|linecard|controller-card}/config/power-admin-state
## Config Parameter coverage
* /components/component/{fabric|linecard|controller-card}/config/power-admin-state

## Telemetry Parameter coverage
* /components/component/state/oper-status
* /components/component/{fabric|linecard|controller-card}/state/power-admin-state

## OpenConfig Path and RPC Coverage

The below yaml defines the OC paths and RPC intended to be covered by this test.

```yaml
paths:
/components/component/name:
/components/component/state/name:

* /components/component/state/oper-status
* /components/component/{fabric|linecard|controller-card}/state/power-admin-state
rpcs:
gnmi:
gNMI.Set:
gNMI.Subscribe:
```
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,12 @@ platform_exceptions: {
skip_controller_card_power_admin: true
}
}
platform_exceptions: {
platform: {
vendor: CISCO
}
deviations: {
leaf_ref_validation: true
ram-mac marked this conversation as resolved.
Show resolved Hide resolved
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/openconfig/ondatra/gnmi"
"github.com/openconfig/ondatra/gnmi/oc"
"github.com/openconfig/ygnmi/ygnmi"
"github.com/openconfig/ygot/ygot"
)

func TestMain(m *testing.M) {
Expand Down Expand Up @@ -106,7 +107,7 @@ func TestControllerCardPowerAdmin(t *testing.T) {
t.Skipf("ControllerCard Component %s is already INACTIVE, hence skipping", c)
}

powerDownUp(t, dut, c, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_CONTROLLER_CARD, 3*time.Minute)
powerDownUp(t, dut, c, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_CONTROLLER_CARD, 5*time.Minute)
})
}
if primary != "" {
Expand All @@ -132,7 +133,11 @@ func powerDownUp(t *testing.T, dut *ondatra.DUTDevice, name string, cType oc.E_P
default:
t.Fatalf("Unknown component type: %s", cType.String())
}

if deviations.LeafRefValidation(dut) {
gnmi.Update(t, dut, c.Config(), &oc.Component{
Name: ygot.String(name),
})
}
start := time.Now()
t.Logf("Starting %s POWER_DISABLE", name)
gnmi.Replace(t, dut, config, oc.Platform_ComponentPowerType_POWER_DISABLED)
Expand Down
5 changes: 5 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1176,3 +1176,8 @@ func EthChannelAssignmentCiscoNumbering(dut *ondatra.DUTDevice) bool {
func ChassisGetRPCUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetChassisGetRpcUnsupported()
}

// LeafRefValidation returns true if definition of leaf-ref is not supported
func LeafRefValidation(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetLeafRefValidation()
}
3 changes: 3 additions & 0 deletions proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,9 @@ message Metadata {
bool interface_counters_update_delayed = 224;
// device does not support a Healthz GET RPC against Chassis level component like "CHASSIS" or "Rack 0"
bool chassis_get_rpc_unsupported = 225;
// Leaf-ref validation for list keys which is enforced for Cisco and hence deviation
// b/373581140
bool leaf_ref_validation = 226;
// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 90, 97, 55, 89, 19, 36, 35, 40, 173;
}
Expand Down
111 changes: 62 additions & 49 deletions proto/metadata_go_proto/metadata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading