summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_vrf.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-07-20 11:26:35 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-07-20 14:21:20 +0000
commit44e5a11979fd1eb6854603f5bc674bec50cc5dcc (patch)
tree2601126049b50bd5a33c5959be7f4bf022159b70 /smoketest/scripts/cli/test_vrf.py
parent1b3350788ceeace52e2d693a18d92d82464220c0 (diff)
downloadvyos-1x-44e5a11979fd1eb6854603f5bc674bec50cc5dcc.tar.gz
vyos-1x-44e5a11979fd1eb6854603f5bc674bec50cc5dcc.zip
utils: migrate to new get_vrf_tableid() helper
Commit 452068ce7 ("interfaces: T6592: moving an interface between VRF instances failed") introduced a new helper to retrieve the VRF table ID from the Kernel. This commit migrates the old code path where the individual fields got queried to the new helper vyos.utils.network.get_vrf_tableid(). (cherry picked from commit 36f3791e0c15267483d59a3bb74465811d08df88)
Diffstat (limited to 'smoketest/scripts/cli/test_vrf.py')
-rwxr-xr-xsmoketest/scripts/cli/test_vrf.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/smoketest/scripts/cli/test_vrf.py b/smoketest/scripts/cli/test_vrf.py
index 243397dc2..176882ca5 100755
--- a/smoketest/scripts/cli/test_vrf.py
+++ b/smoketest/scripts/cli/test_vrf.py
@@ -25,6 +25,7 @@ from vyos.ifconfig import Interface
from vyos.ifconfig import Section
from vyos.utils.file import read_file
from vyos.utils.network import get_interface_config
+from vyos.utils.network import get_vrf_tableid
from vyos.utils.network import is_intf_addr_assigned
from vyos.utils.network import interface_exists
from vyos.utils.system import sysctl_read
@@ -111,8 +112,7 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
frrconfig = self.getFRRconfig(f'vrf {vrf}')
self.assertIn(f' vni {table}', frrconfig)
- tmp = get_interface_config(vrf)
- self.assertEqual(int(table), tmp['linkinfo']['info_data']['table'])
+ self.assertEqual(int(table), get_vrf_tableid(vrf))
# Increment table ID for the next run
table = str(int(table) + 1)
@@ -266,8 +266,7 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
for address in addresses:
self.assertTrue(is_intf_addr_assigned(interface, address))
# Verify VRF table ID
- tmp = get_interface_config(vrf)
- self.assertEqual(int(table), tmp['linkinfo']['info_data']['table'])
+ self.assertEqual(int(table), get_vrf_tableid(vrf))
# Verify interface is assigned to VRF
tmp = get_interface_config(interface)