diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-10-19 20:55:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-19 20:55:55 +0200 |
| commit | 063dbd32777d83635ac1ca82bc25fbb56bebb035 (patch) | |
| tree | 6dd8d1ffdd9b8ab0ec8812071f2e9da494fe88a2 /smoketest/scripts/cli | |
| parent | 5608c8026f49bdd23b3fe80ca4aa6e6554c921f1 (diff) | |
| parent | c33e993f187f20407f2258ca08e0447c78aba885 (diff) | |
| download | vyos-1x-063dbd32777d83635ac1ca82bc25fbb56bebb035.tar.gz vyos-1x-063dbd32777d83635ac1ca82bc25fbb56bebb035.zip | |
Merge pull request #5581 from jvoss/isis-srv6-no-sr-mpls
isis: T9485: only enable SR-MPLS when MPLS segment-routing configured
Diffstat (limited to 'smoketest/scripts/cli')
| -rwxr-xr-x | smoketest/scripts/cli/test_protocols_isis.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_protocols_isis.py b/smoketest/scripts/cli/test_protocols_isis.py index 8296e2732..d190c23d4 100755 --- a/smoketest/scripts/cli/test_protocols_isis.py +++ b/smoketest/scripts/cli/test_protocols_isis.py @@ -462,6 +462,8 @@ class TestProtocolsISIS(VyOSUnitTestSHIM.TestCase): self.assertIn(f' net {net}', tmp) self.assertIn(f' segment-routing srv6', tmp) self.assertIn(f' locator {locator}', tmp) + # SRv6 alone must not enable SR-MPLS + self.assertNotIn(' segment-routing on', tmp) # Commit for isis self.cli_commit() @@ -530,6 +532,8 @@ class TestProtocolsISIS(VyOSUnitTestSHIM.TestCase): self.assertIn(' segment-routing srv6', tmp) self.assertIn(f' locator {locator}', tmp) self.assertIn(f' interface {dum_iface}', tmp) + # SRv6 alone must not enable SR-MPLS + self.assertNotIn(' segment-routing on', tmp) # Test node-msd configuration self.cli_set(srv6_base_path + ['node-msd', 'max-end-d', '40']) @@ -544,6 +548,7 @@ class TestProtocolsISIS(VyOSUnitTestSHIM.TestCase): self.assertIn(' max-end-pop 50', tmp) self.assertIn(' max-h-encaps 60', tmp) self.assertIn(' max-segs-left 70', tmp) + self.assertNotIn(' segment-routing on', tmp) def test_isis_15_distribute_link_state(self): interface = 'lo' @@ -603,6 +608,44 @@ class TestProtocolsISIS(VyOSUnitTestSHIM.TestCase): self.assertIn(f' mpls-te router-address {te_address}', tmp) self.assertIn(' mpls-te export', tmp) + def test_isis_16_segment_routing_srv6_and_mpls(self): + locator = 'TEST' + msd = '5' + sr_base = ['protocols', 'segment-routing'] + self.cli_set(sr_base + ['srv6', 'locator', locator, 'prefix', '2001:db8::/64']) + self.cli_set(sr_base + ['interface', 'lo']) + + # The dummy interface used to install SRv6 SIDs in the Linux data plane + dum_iface = 'dum6' + self.cli_set(['interfaces', 'dummy', dum_iface]) + + self.cli_set(base_path + ['net', net]) + self.cli_set(base_path + ['interface', 'lo']) + + # SRv6 and SR-MPLS side by side + sr_path = base_path + ['segment-routing'] + self.cli_set(sr_path + ['srv6', 'locator', locator]) + self.cli_set(sr_path + ['srv6', 'interface', dum_iface]) + self.cli_set(sr_path + ['maximum-label-depth', msd]) + self.cli_commit() + + tmp = self.getFRRconfig(f'router isis {domain}', stop_section='^exit') + self.assertIn(' segment-routing on', tmp) + self.assertIn(f' segment-routing node-msd {msd}', tmp) + self.assertIn(' segment-routing srv6', tmp) + self.assertIn(f' locator {locator}', tmp) + self.assertIn(f' interface {dum_iface}', tmp) + + # Removing the only SR-MPLS option must disable SR-MPLS again. Not + # global-block: FRR rejects the "no" form frr-reload.py derives for it + self.cli_delete(sr_path + ['maximum-label-depth']) + self.cli_commit() + + tmp = self.getFRRconfig(f'router isis {domain}', stop_section='^exit') + self.assertNotIn(' segment-routing on', tmp) + self.assertNotIn(' segment-routing node-msd', tmp) + self.assertIn(' segment-routing srv6', tmp) + if __name__ == '__main__': unittest.main(verbosity=2, failfast=VyOSUnitTestSHIM.TestCase.debug_on()) |
