summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/base_interfaces_test.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-02-28 10:50:06 +0100
committerChristian Poessinger <christian@poessinger.com>2021-03-06 09:28:41 +0100
commitbab4537ae4c64dd622e69b43c97b79e8e6e63863 (patch)
tree526d8dc0746e15b7e7facfb2991584cccde7fe37 /smoketest/scripts/cli/base_interfaces_test.py
parentf2f60b1d72456d7bb416240a5095bb1bb32bdd0a (diff)
downloadvyos-1x-bab4537ae4c64dd622e69b43c97b79e8e6e63863.tar.gz
vyos-1x-bab4537ae4c64dd622e69b43c97b79e8e6e63863.zip
vyos.util: provide single implementation for get_json_iface_options()
There had been four implementations of "ip -d -j link show interface" scattered accross the codebase. Those implementations have now been combined into a new helper: vyos.util.get_json_iface_options() (cherry picked from commit f13cc56d665a91ff3fac47df260301afefb1a3a5)
Diffstat (limited to 'smoketest/scripts/cli/base_interfaces_test.py')
-rw-r--r--smoketest/scripts/cli/base_interfaces_test.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py
index 3e10f220e..4e11c193a 100644
--- a/smoketest/scripts/cli/base_interfaces_test.py
+++ b/smoketest/scripts/cli/base_interfaces_test.py
@@ -14,7 +14,6 @@
import os
import unittest
-import json
from binascii import hexlify
@@ -30,6 +29,7 @@ from vyos.util import read_file
from vyos.util import cmd
from vyos.util import dict_search
from vyos.util import process_named_running
+from vyos.util import get_json_iface_options
from vyos.validate import is_intf_addr_assigned
from vyos.validate import is_ipv6_link_local
@@ -353,7 +353,7 @@ class BasicInterfaceTest:
for interface in self._interfaces:
for vif_s in self._qinq_range:
- tmp = json.loads(cmd(f'ip -d -j link show dev {interface}.{vif_s}'))[0]
+ tmp = get_json_iface_options(f'{interface}.{vif_s}')
self.assertEqual(dict_search('linkinfo.info_data.protocol', tmp), '802.1ad')
for vif_c in self._vlan_range: