Skip to content

Conversation

@c-po
Copy link
Member

@c-po c-po commented Nov 6, 2025

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 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.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

How to test / Smoketest result

Local smoketests runs of make testc, make test-no-interfaces-no-vpp and make test-interfaces completed successfully

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

c-po added 3 commits November 6, 2025 21:28
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.
@c-po c-po added the bp/circinus Create automatic backport for circinus label Nov 6, 2025
@github-actions
Copy link

github-actions bot commented Nov 6, 2025

👍
No issues in PR Title / Commit Title

Copy link
Member

@sever-sever sever-sever left a 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

c-po added 2 commits November 7, 2025 16:41
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.
Copy link
Contributor

@jestabro jestabro left a 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.

@c-po c-po enabled auto-merge November 7, 2025 16:42
@c-po c-po disabled auto-merge November 7, 2025 16:42
@c-po c-po merged commit 25224cf into vyos:current Nov 7, 2025
16 of 18 checks passed
@c-po c-po deleted the fix-vrf-smoketest branch November 7, 2025 16:42
@vyosbot vyosbot added mirror-initiated This PR initiated for mirror sync workflow mirror-completed and removed mirror-initiated This PR initiated for mirror sync workflow labels Nov 7, 2025
@github-actions
Copy link

github-actions bot commented Nov 7, 2025

CI integration ❌ failed!

Details

CI logs

  • CLI Smoketests (no interfaces) ❌ failed
  • CLI Smoketests VPP 👍 passed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • Config tests VPP 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bp/circinus Create automatic backport for circinus current mirror-completed

Development

Successfully merging this pull request may close these issues.

4 participants