gnmi_set_test - bstoll/featureprofiles GitHub Wiki
Ensures that the device respects certain gNMI SetRequest corner case behaviors.
- ATE port-1 and DUT port-1
- ATE port-2 and DUT port-2
Each test should be implemented as three variants:
- RootOp: performs a get-modify-set of the full config at root. The SetRequest
contains one
replaceoperation. - ContainerOp: performs a get-modify-set on both
/interfacesand/network-instances. The SetRequest contains tworeplaceoperations, one for each container of the list. - ItemOp: SetRequest contains
delete,replaceorupdateon the list items (e.g. under/interfaces/interface[name]and/network-instances/network-instance[name]).
The results MUST be the same.
Notes:
- Use
--deviation_default_network_instancefor the name of the default VRF. - Use
--deviation_static_protocol_namefor the name of the static protocol.
This test checks that the config read from the device can be written back.
- Obtain the full config at root using gNMI Get.
- Deploy the config back to the same device using a gNMI SetRequest.
This test checks that the config of a physical interface can be reset to the default value using the delete operation.
-
Initialize the interfaces in the same SetRequest.
- Configure
dut:port1with the descriptiondut:port1. - Configure
dut:port2with the descriptiondut:port2.
Verify through telemetry that these interfaces are configured correctly.
- Configure
-
Delete
dut:port1anddut:port2in the same SetRequest.In the ContainerOp variant, delete the interfaces by omission.
Verify through telemetry that the interfaces still exist, but the description has been reset to no value.
This test checks that the IP address of a deleted interface can be immediately reused by another interface.
Allocate two aggregate interface names using netutil.NextAggregateInterface.
We refer to them as dut:agg1 and dut:agg2 below.
-
Initialize the interfaces in the same SetRequest.
- Delete
dut:port1,dut:port2,dut:agg1anddut:agg2. - Configure
dut:agg1with memberdut:port1and IP address 192.0.2.1/30. - Configure
dut:agg2with memberdut:port2and IP address 192.0.2.5/30.
Verify through telemetry that these interfaces are configured correctly.
- Delete
-
Modify the interfaces in the same SetRequest:
- Delete
dut:agg1. - Configure
dut:agg2to have the IP address 192.0.2.1/30.
Verify through telemetry that
dut:agg2has the correct IP address. - Delete
-
Clean up by deleting
dut:agg2.
This test checks that the IP addresses of two interfaces can be swapped in the same SetRequest.
-
Initialize the interfaces in the same SetRequest:
- Configure
dut:port1with IP address 192.0.2.1/30. - Configure
dut:port2with IP address 192.0.2.5/30.
Verify through telemetry that these interfaces are configured correctly.
- Configure
-
Modify the interfaces in the same SetRequest:
- Set
dut:port1address to 192.0.2.5/30. - Set
dut:port2address to 192.0.2.1/30.
Verify through telemetry that the interfaces have the correct IP addresses.
- Set
This test checks that a non-existing VRF can be deleted.
-
Initialize by making sure the VRF
GREENdoes not exist.This is no-op for ContainerOp and RootOp. Only ItemOp will generate a DELETE operation in the SetRequest. The request should succeed.
This test checks that a non-default VRF can be deleted.
-
Initialize the interfaces in the same SetRequest:
- Configure
dut:port1with IP address 192.0.2.1/30. - Configure
dut:port2with IP address 192.0.2.5/30. - Configure a non-default VRF
BLUEattaching both interfaces.
Verify through telemetry that these interfaces are configured correctly and attached to the non-default VRF.
- Configure
-
Clean up by deleting VRF
BLUE.Verify through telemetry that the VRF is not present.
This test checks that interfaces can be moved from one VRF to a different VRF while preserving the interface configs.
There should be two variants of this test:
- Moving from the default VRF to non-default VRF
BLUE. - Moving from non-default VRF
REDto another non-default VRFBLUE.
Steps:
-
Initialize the attachment in the same SetRequest:
- Configure
dut:port1with IP address 192.0.2.1/30. - Configure
dut:port2with IP address 192.0.2.5/30. - Attach both interfaces to the first VRF. Create the first VRF as L3VRF if it is not the default.
Verify through telemetry that these interfaces are configured correctly and attached to the first VRF.
- Configure
-
Modify attachment in the same SetRequest:
- Detach
dut:port1anddut:port2from the first VRF. If the first VRF is not the default VRF, delete it. - In the ContainerOp variant, also replace the interfaces
dut:port1anddut:port2with exactly the same config as before. - Configure the second VRF as L3VRF attaching
dut:port1anddut:port2.
- Detach
-
Verify through telemetry:
- The IP addresses of
dut:port1anddut:port2are as expected. - The
dut:port1anddut:port2interfaces are attached to the second VRF.
- The IP addresses of
-
Clean up by deleting the second VRF.
This test checks that the static protocol name is usable.
-
Initialize the attachment in the same SetRequest:
- Configure
dut:port1with IP address 192.0.2.1/30. - Configure
dut:port2with IP address 192.0.2.5/30. - Configure a non-default VRF
BLUEattaching both interfaces. - Configure the static routes in VRF
BLUEas follows:- Prefix 198.51.100.0/24 has next-hop 192.0.2.2 and interface
dut:port1. - Prefix 203.0.113.0/24 has next-hop 192.0.2.6 and interface
dut:port2.
- Prefix 198.51.100.0/24 has next-hop 192.0.2.2 and interface
Verify through telemetry that the static routes are configured correctly.
- Configure
-
Modify the static routes in VRF
BLUEas follows in the same SetRequest.- Prefix 198.51.100.0/24 has next-hop 192.0.2.6 and interface
dut:port2. - Prefix 203.0.113.0/24 has next-hop 192.0.2.2 and interface
dut:port1.
Verify through telemetry that the static routes are configured correctly.
- Prefix 198.51.100.0/24 has next-hop 192.0.2.6 and interface
-
Clean up by deleting VRF
BLUE.
- gNMI.Set