Skip to content

Commit

Permalink
RT-6.1 Fix (#3369)
Browse files Browse the repository at this point in the history
* RT-6.1 Fix

use GetOrCreate() for lldp interface configs
ref b/358044619
---
<sub>This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia’s intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind.</sub>

* fix readme.md

---
<sub>This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia’s intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind.</sub>

* sync otg and ate readmes

---
<sub>This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia’s intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind.</sub>

* fix incorrect path

---
<sub>This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia’s intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind.</sub>

* added same change to otg for tests to be in-sync

---
<sub>This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia’s intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind.</sub>
  • Loading branch information
MarcCharlebois authored Aug 13, 2024
1 parent 373cdd4 commit 60c9722
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 54 deletions.
48 changes: 25 additions & 23 deletions feature/lldp/ate_tests/core_lldp_tlv_population_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,31 @@ Determine LLDP advertisement and reception operates correctly.
configuration of lldp/interfaces/interface/config/enabled (TRUE or
FALSE) on any interface.

## Config Parameter coverage

* /lldp/config/enabled
* /lldp/interfaces/interface/config/enabled

## Telemetry Parameter coverage

* /lldp/interfaces/interface/neighbors/neighbor/state/chassis-id
* /lldp/interfaces/interface/neighbors/neighbor/state/chassis-id-subtype
* /lldp/interfaces/interface/neighbors/neighbor/state/port-id
* /lldp/interfaces/interface/neighbors/neighbor/state/port-id-subtype
* /lldp/interfaces/interface/neighbors/neighbor/state/system-name
* /lldp/interfaces/interface/state/name
* /lldp/state/chassis-id
* /lldp/state/chassis-id-type
* /lldp/state/system-name

## Protocol/RPC Parameter coverage

LLDP:

* /lldp/config/enabled = true
* /lldp/interfaces/interface/config/enabled = true
## OpenConfig Path and RPC Coverage

The below yaml defines the OC paths intended to be covered by this test. OC paths used for test setup are not listed here.

```yaml
paths:
## Config Paths ##
/lldp/config/enabled:
/lldp/interfaces/interface/config/enabled:

## State Paths ##
/lldp/interfaces/interface/neighbors/neighbor/state/chassis-id:
/lldp/interfaces/interface/neighbors/neighbor/state/port-id:
/lldp/interfaces/interface/neighbors/neighbor/state/system-name:
/lldp/interfaces/interface/state/name:
/lldp/state/chassis-id:
/lldp/state/chassis-id-type:
/lldp/state/system-name:

rpcs:
gnmi:
gNMI.Get:
gNMI.Set:

```

## Minimum DUT platform requirement

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,21 @@ func TestCoreLLDPTLVPopulation(t *testing.T) {
func configureNode(t *testing.T, name string, lldpEnabled bool) (*ondatra.DUTDevice, *oc.Lldp) {
node := ondatra.DUT(t, name)
p := node.Port(t, portName)
lldp := gnmi.OC().Lldp()
d := &oc.Root{}
lldp := d.GetOrCreateLldp()
llint := lldp.GetOrCreateInterface(p.Name())

gnmi.Replace(t, node, lldp.Enabled().Config(), lldpEnabled)
gnmi.Replace(t, node, gnmi.OC().Lldp().Enabled().Config(), lldpEnabled)

if lldpEnabled {
gnmi.Replace(t, node, lldp.Interface(p.Name()).Enabled().Config(), lldpEnabled)
gnmi.Replace(t, node, gnmi.OC().Lldp().Interface(p.Name()).Config(), llint)
}

if deviations.InterfaceEnabled(node) {
gnmi.Replace(t, node, gnmi.OC().Interface(p.Name()).Enabled().Config(), true)
}

return node, gnmi.Get(t, node, lldp.Config())
return node, gnmi.Get(t, node, gnmi.OC().Lldp().Config())
}

// verifyNodeConfig verifies the config by comparing against the telemetry state object.
Expand Down
48 changes: 25 additions & 23 deletions feature/lldp/otg_tests/core_lldp_tlv_population_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,31 @@ Determine LLDP advertisement and reception operates correctly.
configuration of lldp/interfaces/interface/config/enabled (TRUE or
FALSE) on any interface.

## Config Parameter coverage

* /lldp/config/enabled
* /lldp/interfaces/interface/config/enabled

## Telemetry Parameter coverage

* /lldp/interfaces/interface/neighbors/neighbor/state/chassis-id
* /lldp/interfaces/interface/neighbors/neighbor/state/chassis-id-subtype
* /lldp/interfaces/interface/neighbors/neighbor/state/port-id
* /lldp/interfaces/interface/neighbors/neighbor/state/port-id-subtype
* /lldp/interfaces/interface/neighbors/neighbor/state/system-name
* /lldp/interfaces/interface/state/name
* /lldp/state/chassis-id
* /lldp/state/chassis-id-type
* /lldp/state/system-name

## Protocol/RPC Parameter coverage

LLDP:

* /lldp/config/enabled = true
* /lldp/interfaces/interface/config/enabled = true
## OpenConfig Path and RPC Coverage

The below yaml defines the OC paths intended to be covered by this test. OC paths used for test setup are not listed here.

```yaml
paths:
## Config Paths ##
/lldp/config/enabled:
/lldp/interfaces/interface/config/enabled:

## State Paths ##
/lldp/interfaces/interface/neighbors/neighbor/state/chassis-id:
/lldp/interfaces/interface/neighbors/neighbor/state/port-id:
/lldp/interfaces/interface/neighbors/neighbor/state/system-name:
/lldp/interfaces/interface/state/name:
/lldp/state/chassis-id:
/lldp/state/chassis-id-type:
/lldp/state/system-name:

rpcs:
gnmi:
gNMI.Get:
gNMI.Set:

```

## Minimum DUT platform requirement

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,21 @@ func TestLLDPDisabled(t *testing.T) {
func configureDUT(t *testing.T, name string, lldpEnabled bool) (*ondatra.DUTDevice, *oc.Lldp) {
node := ondatra.DUT(t, name)
p := node.Port(t, portName)
lldp := gnmi.OC().Lldp()
d := &oc.Root{}
lldp := d.GetOrCreateLldp()
llint := lldp.GetOrCreateInterface(p.Name())

gnmi.Replace(t, node, lldp.Enabled().Config(), lldpEnabled)
gnmi.Replace(t, node, gnmi.OC().Lldp().Enabled().Config(), lldpEnabled)

if lldpEnabled {
gnmi.Replace(t, node, lldp.Interface(p.Name()).Enabled().Config(), lldpEnabled)
gnmi.Replace(t, node, gnmi.OC().Lldp().Interface(p.Name()).Config(), llint)
}

if deviations.InterfaceEnabled(node) {
gnmi.Replace(t, node, gnmi.OC().Interface(p.Name()).Enabled().Config(), true)
}

return node, gnmi.Get(t, node, lldp.Config())
return node, gnmi.Get(t, node, gnmi.OC().Lldp().Config())
}

func configureATE(t *testing.T, otg *otg.OTG) gosnappi.Config {
Expand Down

0 comments on commit 60c9722

Please sign in to comment.