p4rt_election - bstoll/featureprofiles GitHub Wiki
Validate the P4RT server handles primary election and failover.
- Enable P4RT on a single FAP by configuring an ID on the device and one or more interfaces.
- Verify that the right clients become primary. Verify that primary can read &
write and that non-primary can only read through the following scenarios:
- Become Primary
- Connect two P4RT clients with different election IDs.
- Verify client with the higher election ID (primary) receives a successful MasterArbitrationUpdate.
- Verify primary client can read as well as write.
- Fail to become Primary
- Connect two P4RT clients with different election IDs.
- Verify client with the lower election ID (secondary) receives a successful MasterArbitrationUpdate.
- Verify secondary client can read but not write.
- Replace Primary
- Connect two P4RT clients with different election IDs.
- Verify client with the lower election ID (secondary) receives a successful MasterArbitrationUpdate.
- Verify secondary client can read but not write.
- TODO: Trigger MasterArbitrationUpdate using the secondary client with an election ID higher than that of primary client.
- TODO: Verify that the old secondary client now becomes primary and able to read and write.
- TODO: Verify that
status
field ofnew primary
client's MasterArbitrationUpdate response is set togoogle.rpc.OK
. - TODO: Verify that
election_id
field ofnew primary
client's MasterArbitrationUpdate response is set to the highest election_id. - TODO: Verify that old primary is now only able to read and not write.
- TODO: Verify that
status
field ofold primary
client's MasterArbitrationUpdate response is set togoogle.rpc.ALREADY_EXISTS
. - TODO: Verify that
election_id
field ofold primary
client's MasterArbitrationUpdate response is set tonew primary
client's election_id.
- Replace Primary after Failure
- Connect two P4RT clients with different election IDs.
- Verify primary client can read and write.
- Stop primary client by closing the stream.
- Trigger MasterArbitrationUpdate using the secondary client with an election ID equal to that of primary client.
- Verify that old secondary client now becomes primary and able to read and write.
- TODO: Fail To become Primary after Primary Disconnect
- Connect two P4RT clients with different election IDs.
- Verify primary client can read and write.
- Stop primary client by closing the Stream.
- Verify that the secondary client can only read and not write.
- Verify that
status
field ofsecondary
client's MasterArbitrationUpdate response is set togoogle.rpc.NOT_FOUND
.
- Reconnect Primary
- Connect two P4RT clients with different election IDs.
- Verify primary client can read and write.
- Stop primary client by closing the stream.
- Connect a new P4RT client with election ID higher that old primary election ID.
- verify that new primary client is able to read and write.
- Double Primary
- Connect two P4RT clients with different election IDs.
- Verify primary client can read and write.
- TODO: Trigger MasterArbitrationUpdate using the secondary client with an election ID equal to that of primary client.
- TODO: Verify secondary client stream terminates with
google.rpc.INVALID_ARGUMENT
. - Connect a new P4RT client with election ID equal to that of primary client.
- Verify new client's stream terminates with
google.rpc.INVALID_ARGUMENT
.
- Unset Election ID
- Connect two P4RT clients with an
unset
election ID and no other active P4RT clients for the corresponding device_id. (unset
andzero
electionIDs are two different scenarios and azero
electionID is considered as being Set) - Verify that the clients are able to read and not write using Get and Set ForwardingPipelineConfig requests.
- Connect two P4RT clients with an
- TODO: Long Evolution
- Connect five P4RT clients to the same device_id with election_id's 1,2,3,4,5
- Verify primary client is able to read and write.
- Trigger MasterArbitrationUpdate from client with
election_id=1
and make it primary usingelection_id=6
. - Verify that client with
election_id=6
is able to read and write. - Verify that client with
election_id=5
is able to read and not write. - Repeat steps
c
,d
,e
for the below client and election_id combinations:- MasterArbitrationUpdate from client with
election_id=2
and make it primary usingelection_id=7
and verify correct read & writes for clients withelection_id=6
&election_id=7
. - MasterArbitrationUpdate from client with
election_id=3
and make it primary usingelection_id=8
and verify correct read & writes for clients withelection_id=7
&election_id=8
. - MasterArbitrationUpdate from client with
election_id=4
and make it primary usingelection_id=9
and verify correct read & writes for clients withelection_id=8
&election_id=9
. - MasterArbitrationUpdate from client with
election_id=5
and make it primary usingelection_id=10
and verify correct read & writes for clients withelection_id=9
&election_id=10
.
- MasterArbitrationUpdate from client with
- Become Primary
- TODO: Enable P4RT on an additional FAP and verify that the same set of scenarios work independently of the first FAP