-
Notifications
You must be signed in to change notification settings - Fork 393
smoketest: T7996: fix hardcoded "vrf red" search path in FRR config #4836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Commit 186900f ("smoketest: T7927: test DHCP route preservation") which was added to validate a bugfix for DHCP default routes added it's own little regression. Tests defined a VRF named red15, but when reading in the FRR configuration we have had a hardcoded search for "vrf red" instead. This has been fixed to re-use the defined VRF variable name we perform our test on.
The original VRF DHCP test case, introduced in commit 186900f ("smoketest: T7927: test DHCP route preservation"), used a fixed delay of 8 seconds to wait for the DHCP server and client to initialize. This approach was unreliable and could cause unnecessary test delays. Since commit 3545176 ("wlb: T7977: Updated smoketest to validate nft vmap weight buckets"), the "vyos.utils.misc.wait_for()" helper provides a more efficient busy-wait loop with an early-exit condition. This test case now uses wait_for() to detect when the DHCP-assigned default route becomes available, eliminating the fixed sleep and reducing test runtime.
|
👍 |
sever-sever
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix VRF smoketest
Dehardcode VRF
Use wait_for
Commit 9775bb4 ("frr: T7664: drop BASH/SED implementation in smoketest getFRRconfig()") changed how we searched strings using a regex. In the past we searched at the beginning of a line ^ till the end $. THis logic was dropped in commit 9775bb4 marking some tests failing as they matched, when they should not match. Example: getFRRconfig('vrf red') showed output for both VRF red and red15 as both started with "red". This has been fixed.
…ing config Commit 9775bb4 ("frr: T7664: drop BASH/SED implementation in smoketest getFRRconfig()") dropped a custom BASH/SED based implementation of how we interacted with FRR to make use of the utility helpers from FRR team. This changed added some arbitray warnings when executing about unclosed files handles. ResourceWarning: unclosed file <_io.BufferedReader name=5> Instead of importing the frr-reload Python module, we simply call popen() by ourself.
jestabro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several subtle fixes for logic of smoketests/warnings: all vrf smoketests now pass in local test.
|
CI integration ❌ failed! Details
|
Change summary
Commit 186900f (
smoketest: T7927: test DHCP route preservation) which was added to validate a bugfix for DHCP default routes added it's own little regression. Tests defined a VRF named red15, but when reading in the FRR configuration we have had a hardcoded search forvrf redinstead.This has been fixed to re-use the defined VRF variable name we perform our test on.
The original VRF DHCP test case, introduced in commit 186900f (
smoketest: T7927: test DHCP route preservation), used a fixed delay of 8 seconds to wait for the DHCP server and client to initialize. This approach was unreliable and could cause unnecessary test delays.Since commit 3545176 (
wlb: T7977: Updated smoketest to validate nft vmap weight buckets), thevyos.utils.misc.wait_for()helper provides a more efficient busy-wait loop with an early-exit condition. This test case now useswait_for()to detect when the DHCP-assigned default route becomes available, eliminating the fixed sleep and reducing test runtime.Types of changes
Related Task(s)
Related PR(s)
How to test / Smoketest result
Local smoketests runs of
make testc,make test-no-interfaces-no-vppandmake test-interfacescompleted successfullyChecklist: