p4rt_device_down_test - openconfig/featureprofiles GitHub Wiki
Verify that the P4RT server handles StreamChannel, Read, and Write RPCs for a device/node as follows:
- Accepts them when the device is available and
- Returns a
NOT_FOUNDerror when it is unavailable or down Point-1 P4RT Spec
- Connect ATE port-1 and port-2 to DUT port-1 and port-2 respectively.
- Configure P4RT id and node-id (device_id) with two interfaces on different integrated circuits (LineCards or forwarding NPUs).
- 1st Linecard
device_id = 111 - 2nd Linecard
device_id = 222
- 1st Linecard
- Verify via gNMI that the
oper-statusof both components isACTIVE.
-
Step 1 - Disable Linecard 2 and verify status
- Disable the Linecard 2 with
device_id = 222using gNMI (e.g., by setting the component'spower-admin-statetoPOWER_DISABLEDor using a platform-specific method to simulate a down state). - Verify via gNMI that the
oper-statusof the component fordevice_id = 222transitions toDISABLEDorINACTIVE.
- Disable the Linecard 2 with
-
Step 2 - Send MasterArbitrationUpdate and Pipeline Config
- Attempt to establish a
StreamChanneland send aMasterArbitrationUpdatefordevice_id = 222. Verify it is rejected or returnsNOT_FOUND. - Send the WBB P4Info via the
SetForwardingPipelineConfigfor bothdevice_id = 111anddevice_id = 222. - Verify that
SetForwardingPipelineConfigis successful fordevice_id = 111. - Verify that
SetForwardingPipelineConfigreturnsNOT_FOUNDfordevice_id = 222.
- Attempt to establish a
-
Step 3 - Send Write RPC
- Send RPC Write to install the
AclWbbIngressTableEntryfor LLDP (ethertype: 0x88CC) for bothdevice_id = 111anddevice_id = 222. - Verify that the write RPC is successful for
device_id = 111. - Verify that the write RPC returns
NOT_FOUNDfordevice_id = 222.
- Send RPC Write to install the
-
Step 4 - Send Read RPC
- Send RPC Read to read back the installed table entries for both
device_id = 111anddevice_id = 222. - Verify that the read RPC is successful for
device_id = 111. - Verify that the read RPC returns
NOT_FOUNDfordevice_id = 222.
- Send RPC Read to read back the installed table entries for both
-
Step 5 - Verify PacketOut to Down Device
- Send a
PacketOutmessage over theStreamChanneldestined fordevice_id = 222. - Verify the server drops it or returns an error.
- Send a
-
Step 6 - Invalid Device ID
- Attempt to send MasterArbitrationUpdate, SetForwardingPipelineConfig, Write, and Read RPCs to an entirely unconfigured
device_id(e.g.,device_id = 999). - Verify they all return
NOT_FOUND.
- Attempt to send MasterArbitrationUpdate, SetForwardingPipelineConfig, Write, and Read RPCs to an entirely unconfigured
{
"components": {
"component": [
{
"name": "NPU1",
"integrated-circuit": {
"config": {
"node-id": "111"
}
}
},
{
"name": "NPU2",
"integrated-circuit": {
"config": {
"node-id": "222"
}
}
}
]
}
}-
Step 1 - State Transition (Down to Up)
- Re-enable Linecard 2 with
device_id = 222via gNMI. - Verify via gNMI that the
oper-statusof the component transitions back toACTIVE. - Verify that the P4RT server now accepts Mastership,
SetForwardingPipelineConfig,Write, andReadfordevice_id = 222.
- Re-enable Linecard 2 with
-
Step 2 - Device goes down mid-operation (Up to Down)
- While
device_id = 222is up, disable the Linecard 2 via gNMI. - Verify that subsequent
ReadandWriteRPCs todevice_id = 222now fail withNOT_FOUND.
- While
paths:
/components/component/integrated-circuit/config/node-id:
platform_type: ["INTEGRATED_CIRCUIT"]
/interfaces/interface/config/id:
/components/component/state/oper-status:
platform_type: ["LINECARD", "INTEGRATED_CIRCUIT"]
/components/component/linecard/config/power-admin-state:
platform_type: ["LINECARD"]
rpcs:
gnmi:
gNMI.Get:
gNMI.Set:
gNMI.Subscribe:- MFF