Skip to content

Add testcases()TestSameElectionIDFromTwoClients and TestElectionIdAsZero) in compliance test#103

Merged
robshakir merged 1 commit intoopenconfig:mainfrom
mingyangcisco:mingyang_adding_testcases
Jan 12, 2022
Merged

Add testcases()TestSameElectionIDFromTwoClients and TestElectionIdAsZero) in compliance test#103
robshakir merged 1 commit intoopenconfig:mainfrom
mingyangcisco:mingyang_adding_testcases

Conversation

@mingyangcisco
Copy link
Copy Markdown
Contributor

We are adding 2 testcases (TestSameElectionIDFromTwoClients and TestElectionIdAsZero) in compliance test.
TestSameElectionIDFromTwoClients is the test that same the same election Id from 2 clients and 1st client will be master and 2nd will be non-master
TestElectionIdAsZero is the test that client sends (0,0) as the election Id to the server. the server should respond with RPC error invalid argument based on the protobuf.

Following is the testing log for those 2 testcases.

=== RUN   TestCompliance/Decrementing_election_ID_is_ignored
E0107 17:23:25.048685   76747 client.go:308] got error receiving message, rpc error: code = Canceled desc = grpc: the client connection is closing
E0107 17:23:25.048804   76747 server.go:265] received nil message on Modify channel
=== RUN   TestCompliance/Sending_same_election_ID_from_two_clients
E0107 17:23:25.258343   76747 client.go:308] got error receiving message, rpc error: code = Unavailable desc = transport is closing
E0107 17:23:25.258442   76747 server.go:265] received nil message on Modify channel
E0107 17:23:25.271405   76747 server.go:843] returning failed to client afe3a997-b3aa-429d-bfeb-91095d1f1e06 (id: low:52), because they are not the elected master (fb91be92-4a85-40e2-a41f-624eccbfca1c is, id: low:52)
=== RUN   TestCompliance/Sending_election_ID_as_zero
E0107 17:23:25.373305   76747 client.go:308] got error receiving message, rpc error: code = Canceled desc = grpc: the client connection is closing
E0107 17:23:25.373427   76747 client.go:308] got error receiving message, rpc error: code = Unavailable desc = transport is closing
E0107 17:23:25.373498   76747 server.go:265] received nil message on Modify channel
E0107 17:23:25.373532   76747 server.go:265] received nil message on Modify channel
E0107 17:23:25.380454   76747 client.go:308] got error receiving message, rpc error: code = InvalidArgument desc = client ID 0478263c-517a-4c14-b4e6-29f7fbf0e106, zero is an invalid election ID
    --- PASS: TestCompliance/Sending_same_election_ID_from_two_clients (0.11s)
    --- PASS: TestCompliance/Sending_election_ID_as_zero (0.11s)

Copy link
Copy Markdown
Member

@robshakir robshakir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this change! Looks correct to me.

It's likely that we shouldn't be running the -race tests against the compliance tests, let me verify and update the workflow.

@robshakir robshakir merged commit 9830dba into openconfig:main Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants