telemetry_interface_carrier_transitions_test - openconfig/featureprofiles GitHub Wiki
Validates that the carrier-transitions counter increments correctly when the
interface link state changes.
[TODO: b/391432919] Use /interfaces/interface/state/counters/interface-transitions and
/interfaces/interface/state/counters/link-transitions for the interface state
changes.
Topology: https://github.com/openconfig/featureprofiles/blob/main/topologies/atedut_2.testbed
ATE port-1 <------> port-1 DUT
[TODO: b/391432919] Deprecate this test when interface-transitions and link-transitions OC
Paths are implemented.
The test environment consists of a DUT connected to an ATE with the following port roles:
-
DUT Port 1: Configured with IPv4 and IPv6 addresses. This is the interface under test where the administrative state (
enabled) will be toggled. -
ATE Port 1: Configured with IPv4 and IPv6 addresses. Acts as the link peer to ensure the DUT interface can transition to
oper-status: UP.
-
Setup:
- Connect DUT port-1 to ATE port-1.
- Configure IPv4/IPv6 addresses on the DUT and ATE ports.
- Ensure the interface is administratively UP and the link is UP.
-
Collection:
- Start a gNMI SAMPLE subscription for
/interfaces/interface/state/counters/carrier-transitionswith a 30s interval.
- Start a gNMI SAMPLE subscription for
-
Trigger:
- Administratively disable the DUT interface (set
enabledtofalse). - Verify
oper-statusbecomesDOWN. - Administratively enable the DUT interface (set
enabledtotrue). - Verify
oper-statusbecomesUP.
- Administratively disable the DUT interface (set
-
Validation:
- Wait for the collection to complete.
- Verify that the counter values never decrease (monotonicity).
- Verify that the counter values do not increase by more than 100 between samples.
- Verify that the final value is greater than the initial value.
- Get Initial Counters: Read the values of:
/interfaces/interface[name=dutPort1]/state/counters/interface-transitions-
/interfaces/interface[name=dutPort1]/state/counters/link-transitionsvia gNMI.Get. Store these asinterface_transitions_initialandlink_transitions_initial.
- Admin Down: Set
/interfaces/interface[name=dutPort1]/config/enabledtofalseusing gNMI.Set UPDATE. - Verify Oper Down: Confirm
/interfaces/interface[name=dutPort1]/state/oper-statustransitions toDOWNvia gNMI.Get or Subscribe. - Admin Up: Set
/interfaces/interface[name=dutPort1]/config/enabledtotrueusing gNMI.Set UPDATE. - Verify Oper Up: Confirm
/interfaces/interface[name=dutPort1]/state/oper-statustransitions toUP. - Get Final Counters: Read the counter values:
/interfaces/interface[name=dutPort1]/state/counters/interface-transitions-
/interfaces/interface[name=dutPort1]/state/counters/link-transitionsagain. Store these asinterface_transitions_finalandlink_transitions_final.
- Validation:
-
interface_transitions_finalmust be equal tointerface_transitions_initial + 2. -
link_transitions_finalmust not change fromlink_transitions_initial.
-
- Setup: Ensure the interface is configured as per the basic setup and is operationally UP.
- Get Initial Counters: Read the values of:
/interfaces/interface[name=dutPort1]/state/counters/interface-transitions/interfaces/interface[name=dutPort1]/state/counters/link-transitions
- ATE Port Down: Disable the ATE port
atePort1. - Verify Oper Down: Confirm DUT
/interfaces/interface[name=dutPort1]/state/oper-statustransitions toDOWN. - ATE Port Up: Enable the ATE port
atePort1. - Verify Oper Up: Confirm DUT
/interfaces/interface[name=dutPort1]/state/oper-statustransitions toUP. - Get Final Counters: Read the counter values again.
- Validation:
- The
interface-transitionscounter must have incremented by exactly 2. - The
link-transitionscounter must have incremented by exactly 2.
- The
{
"openconfig-interfaces:interfaces": {
"interface": [
{
"config": {
"enabled": true,
"name": "Ethernet1"
},
"name": "Ethernet1"
}
]
}
}paths:
/interfaces/interface/state/counters/carrier-transitions:
/interfaces/interface/state/counters/interface-transitions:
/interfaces/interface/state/counters/link-transitions:
/interfaces/interface/config/enabled:
/interfaces/interface/state/oper-status:
rpcs:
gnmi:
gNMI.Set:
union_replace: true
gNMI.Subscribe:
mode: sample
sample_interval: 30s
- MFF
- FFF