diff options
| author | Miaosen Wang <secretandanon@gmail.com> | 2026-02-23 23:31:26 -0800 |
|---|---|---|
| committer | Miaosen Wang <secretandanon@gmail.com> | 2026-02-24 00:43:34 -0800 |
| commit | 7f6545b188b7ad00a2ba4bf2dc7281bca93f05bf (patch) | |
| tree | de3cd4ad1498eb95d26c9d8a017fff6819aec7e0 /smoketest/scripts | |
| parent | 662b45c159393aa9451c93b168da415021949857 (diff) | |
| download | vyos-1x-7f6545b188b7ad00a2ba4bf2dc7281bca93f05bf.tar.gz vyos-1x-7f6545b188b7ad00a2ba4bf2dc7281bca93f05bf.zip | |
T8302: This PR adds Router Advertisement (RA) base-interface support for IPv6 wildcard prefix derivation and includes validation and smoketests.
Included changes:
- Add `base-interface` under:
- `service router-advert interface <lan-if> prefix ::/64 base-interface <wan-if>`
- Render `Base6Interface <wan-if>;` in `radvd.conf` when configured.
- Add validation guard:
- `base-interface` is only allowed with wildcard prefix `::/64`.
- Extend smoketests:
- Positive case: `::/64` + `base-interface` commits and renders correctly.
- Negative case: non-`::/64` prefix with `base-interface` fails commit.
Diffstat (limited to 'smoketest/scripts')
| -rwxr-xr-x | smoketest/scripts/cli/test_service_router-advert.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_service_router-advert.py b/smoketest/scripts/cli/test_service_router-advert.py index 54133b5c7..52f0db4ab 100755 --- a/smoketest/scripts/cli/test_service_router-advert.py +++ b/smoketest/scripts/cli/test_service_router-advert.py @@ -376,5 +376,19 @@ class TestServiceRADVD(VyOSUnitTestSHIM.TestCase): tmp = f'autoignoreprefixes' + ' {' self.assertNotIn(tmp, config) + def test_base_interface(self): + self.cli_set(base_path + ['prefix', '::/64']) + self.cli_set(base_path + ['prefix', '::/64', 'base-interface', 'eth0']) + self.cli_commit() + + config = read_file(RADVD_CONF) + self.assertIn('Base6Interface eth0;', config) + + self.cli_set(base_path + ['prefix', '2001:db8:1234::/64']) + self.cli_set( + base_path + ['prefix', '2001:db8:1234::/64', 'base-interface', 'eth0'] + ) + with self.assertRaises(ConfigSessionError): + self.cli_commit() if __name__ == '__main__': unittest.main(verbosity=2, failfast=VyOSUnitTestSHIM.TestCase.debug_on()) |
