tests: Fix intermittent failures in srv6_encap_src_addr
topotest
#18187
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
srv6_encap_src_addr
runs a vtysh command to configure the SRv6 encapsulation source address and then immediately invokes an iproute2 command to verify that zebra has set this address in the kernel. There is no wait between the two operations and the verification is attempted only once. If the topotest does not find the expected address it fails immediately.The problem is that when topotest is run on a heavyily loaded system, it can take some time for zebra to set the address in the kernel.
In this case, when the topotest checks the kernel address right after running the vtysh command, it doesn't find the expected address because zebra hasn't set it yet.
This commit gives zebra some time to configure the address. It keeps to check that the address is the expected one for about 1 minute. If after 1 minute the address is not the expected one then the test fails.