From f13cc56d665a91ff3fac47df260301afefb1a3a5 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 28 Feb 2021 10:50:06 +0100 Subject: 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() --- smoketest/scripts/cli/base_interfaces_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'smoketest/scripts/cli/base_interfaces_test.py') 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: -- cgit v1.2.3