diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-02-28 10:50:06 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-02-28 18:10:08 +0100 |
commit | f13cc56d665a91ff3fac47df260301afefb1a3a5 (patch) | |
tree | fbf18680d85364b2b6e2964604aa37e85299c767 /smoketest/scripts/cli/base_interfaces_test.py | |
parent | 458e71dd7b1af3354a7643a0d26e651a9e7ccfcf (diff) | |
download | vyos-1x-f13cc56d665a91ff3fac47df260301afefb1a3a5.tar.gz vyos-1x-f13cc56d665a91ff3fac47df260301afefb1a3a5.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()
Diffstat (limited to 'smoketest/scripts/cli/base_interfaces_test.py')
-rw-r--r-- | smoketest/scripts/cli/base_interfaces_test.py | 4 |
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 1426e80c2..0c6f43427 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 @@ -317,7 +317,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: |