summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_vrf.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-10-06 15:17:17 +0200
committerChristian Breunig <christian@breunig.cc>2024-12-16 22:21:36 +0100
commit81923562a8a164f7ff9761e976c20420a585907a (patch)
tree8fe525e8ab4bb0d07f9eb52b52816e50bcb956cf /smoketest/scripts/cli/test_vrf.py
parent7538fd4c518271a517b6753dd664fd07cd86bddd (diff)
downloadvyos-1x-81923562a8a164f7ff9761e976c20420a585907a.tar.gz
vyos-1x-81923562a8a164f7ff9761e976c20420a585907a.zip
frr: T6747: make daemon definitions re-usable for both conf-mode and smoketests
Diffstat (limited to 'smoketest/scripts/cli/test_vrf.py')
-rwxr-xr-xsmoketest/scripts/cli/test_vrf.py35
1 files changed, 18 insertions, 17 deletions
diff --git a/smoketest/scripts/cli/test_vrf.py b/smoketest/scripts/cli/test_vrf.py
index 2bb6c91c1..3cab5248e 100755
--- a/smoketest/scripts/cli/test_vrf.py
+++ b/smoketest/scripts/cli/test_vrf.py
@@ -23,6 +23,7 @@ from json import loads
from jmespath import search
from vyos.configsession import ConfigSessionError
+from vyos.frr import mgmt_daemon
from vyos.ifconfig import Interface
from vyos.ifconfig import Section
from vyos.utils.file import read_file
@@ -112,7 +113,7 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
regex = f'{table}\s+{vrf}\s+#\s+{description}'
self.assertTrue(re.findall(regex, iproute2_config))
- frrconfig = self.getFRRconfig(f'vrf {vrf}')
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon=mgmt_daemon)
self.assertIn(f' vni {table}', frrconfig)
self.assertEqual(int(table), get_vrf_tableid(vrf))
@@ -233,7 +234,7 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
self.assertTrue(interface_exists(vrf))
- frrconfig = self.getFRRconfig(f'vrf {vrf}')
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon=mgmt_daemon)
self.assertIn(f' vni {table}', frrconfig)
self.assertIn(f' ip route {prefix} {next_hop}', frrconfig)
@@ -317,7 +318,7 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
# Verify route-map properly applied to FRR
for vrf in vrfs:
- frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon='zebra')
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon=mgmt_daemon)
self.assertIn(f'vrf {vrf}', frrconfig)
for protocol in v4_protocols:
self.assertIn(f' ip protocol {protocol} route-map route-map-{vrf}-{protocol}', frrconfig)
@@ -332,8 +333,8 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
# Verify route-map properly is removed from FRR
for vrf in vrfs:
- frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon='zebra')
- self.assertNotIn(f'vrf {vrf}', frrconfig)
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon=mgmt_daemon)
+ self.assertNotIn(f' ip protocol', frrconfig)
def test_vrf_ip_ipv6_protocol_non_existing_route_map(self):
table = '6100'
@@ -380,7 +381,7 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
# Verify route-map properly applied to FRR
for vrf in vrfs:
- frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon='zebra')
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon=mgmt_daemon)
self.assertIn(f'vrf {vrf}', frrconfig)
for protocol in v6_protocols:
# VyOS and FRR use a different name for OSPFv3 (IPv6)
@@ -399,8 +400,8 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
# Verify route-map properly is removed from FRR
for vrf in vrfs:
- frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon='zebra')
- self.assertNotIn(f'vrf {vrf}', frrconfig)
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon=mgmt_daemon)
+ self.assertNotIn(f' ipv6 protocol', frrconfig)
def test_vrf_vni_duplicates(self):
base_table = '6300'
@@ -429,7 +430,7 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
for vrf in vrfs:
self.assertTrue(interface_exists(vrf))
- frrconfig = self.getFRRconfig(f'vrf {vrf}')
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon=mgmt_daemon)
self.assertIn(f' vni {table}', frrconfig)
# Increment table ID for the next run
table = str(int(table) + 1)
@@ -451,7 +452,7 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
for vrf in vrfs:
self.assertTrue(interface_exists(vrf))
- frrconfig = self.getFRRconfig(f'vrf {vrf}')
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon=mgmt_daemon)
self.assertIn(f' vni {table}', frrconfig)
# Increment table ID for the next run
table = str(int(table) + 1)
@@ -474,7 +475,7 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
for vrf in vrfs:
self.assertTrue(interface_exists(vrf))
- frrconfig = self.getFRRconfig(f'vrf {vrf}')
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon=mgmt_daemon)
self.assertIn(f' vni {table}', frrconfig)
# Increment table ID for the next run
table = str(int(table) + 2)
@@ -494,7 +495,7 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
for vrf in vrfs:
self.assertTrue(interface_exists(vrf))
- frrconfig = self.getFRRconfig(f'vrf {vrf}')
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon=mgmt_daemon)
self.assertIn(f' vni {table}', frrconfig)
# Increment table ID for the next run
table = str(int(table) + 2)
@@ -502,7 +503,7 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
# Verify purple VRF/VNI
self.assertTrue(interface_exists(purple))
table = str(int(table) + 10)
- frrconfig = self.getFRRconfig(f'vrf {purple}')
+ frrconfig = self.getFRRconfig(f'vrf {purple}', daemon=mgmt_daemon)
self.assertIn(f' vni {table}', frrconfig)
# Now delete all the VNIs
@@ -517,12 +518,12 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
for vrf in vrfs:
self.assertTrue(interface_exists(vrf))
- frrconfig = self.getFRRconfig(f'vrf {vrf}')
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon=mgmt_daemon)
self.assertNotIn('vni', frrconfig)
# Verify purple VNI remains
self.assertTrue(interface_exists(purple))
- frrconfig = self.getFRRconfig(f'vrf {purple}')
+ frrconfig = self.getFRRconfig(f'vrf {purple}', daemon=mgmt_daemon)
self.assertIn(f' vni {table}', frrconfig)
def test_vrf_ip_ipv6_nht(self):
@@ -540,7 +541,7 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
# Verify route-map properly applied to FRR
for vrf in vrfs:
- frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon='zebra')
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon=mgmt_daemon)
self.assertIn(f'vrf {vrf}', frrconfig)
self.assertIn(f' no ip nht resolve-via-default', frrconfig)
self.assertIn(f' no ipv6 nht resolve-via-default', frrconfig)
@@ -555,7 +556,7 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
# Verify route-map properly is removed from FRR
for vrf in vrfs:
- frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon='zebra')
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon=mgmt_daemon)
self.assertNotIn(f' no ip nht resolve-via-default', frrconfig)
self.assertNotIn(f' no ipv6 nht resolve-via-default', frrconfig)