From 7d67e8609471b6a5c9761a99301f368bd6747e13 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 14 Mar 2021 11:12:07 +0100 Subject: vyos.util: rename get_json_iface_options() -> get_interface_config() --- smoketest/scripts/cli/base_interfaces_test.py | 4 ++-- smoketest/scripts/cli/test_interfaces_erspan.py | 6 +++--- smoketest/scripts/cli/test_interfaces_geneve.py | 4 ++-- smoketest/scripts/cli/test_interfaces_macsec.py | 4 ++-- smoketest/scripts/cli/test_interfaces_tunnel.py | 12 ++++++------ smoketest/scripts/cli/test_interfaces_vxlan.py | 4 ++-- smoketest/scripts/cli/test_protocols_static.py | 4 ++-- 7 files changed, 19 insertions(+), 19 deletions(-) (limited to 'smoketest/scripts') diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py index d038e9cb8..50cfa2607 100644 --- a/smoketest/scripts/cli/base_interfaces_test.py +++ b/smoketest/scripts/cli/base_interfaces_test.py @@ -29,7 +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.util import get_interface_config 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 = get_json_iface_options(f'{interface}.{vif_s}') + tmp = get_interface_config(f'{interface}.{vif_s}') self.assertEqual(dict_search('linkinfo.info_data.protocol', tmp), '802.1ad') for vif_c in self._vlan_range: diff --git a/smoketest/scripts/cli/test_interfaces_erspan.py b/smoketest/scripts/cli/test_interfaces_erspan.py index cbb41d0c9..4575c61ce 100755 --- a/smoketest/scripts/cli/test_interfaces_erspan.py +++ b/smoketest/scripts/cli/test_interfaces_erspan.py @@ -18,7 +18,7 @@ import unittest from vyos.configsession import ConfigSession from vyos.configsession import ConfigSessionError -from vyos.util import get_json_iface_options +from vyos.util import get_interface_config from base_interfaces_test import BasicInterfaceTest @@ -52,7 +52,7 @@ class ERSPanTunnelInterfaceTest(BasicInterfaceTest.BaseTest): self.session.commit() - conf = get_json_iface_options(interface) + conf = get_interface_config(interface) self.assertEqual(interface, conf['ifname']) self.assertEqual(encapsulation, conf['linkinfo']['info_kind']) self.assertEqual(mtu, conf['mtu']) @@ -73,7 +73,7 @@ class ERSPanTunnelInterfaceTest(BasicInterfaceTest.BaseTest): self.session.commit() - conf = get_json_iface_options(interface) + conf = get_interface_config(interface) self.assertEqual(interface, conf['ifname']) self.assertEqual(encapsulation, conf['linkinfo']['info_kind']) self.assertEqual(mtu, conf['mtu']) diff --git a/smoketest/scripts/cli/test_interfaces_geneve.py b/smoketest/scripts/cli/test_interfaces_geneve.py index 7edd4528e..e8e8e5a2c 100755 --- a/smoketest/scripts/cli/test_interfaces_geneve.py +++ b/smoketest/scripts/cli/test_interfaces_geneve.py @@ -18,7 +18,7 @@ import unittest from vyos.configsession import ConfigSession from vyos.ifconfig import Interface -from vyos.util import get_json_iface_options +from vyos.util import get_interface_config from base_interfaces_test import BasicInterfaceTest @@ -51,7 +51,7 @@ class GeneveInterfaceTest(BasicInterfaceTest.BaseTest): ttl = 20 for interface in self._interfaces: - options = get_json_iface_options(interface) + options = get_interface_config(interface) vni = options['linkinfo']['info_data']['id'] self.assertIn(f'vni {vni}', self._options[interface]) diff --git a/smoketest/scripts/cli/test_interfaces_macsec.py b/smoketest/scripts/cli/test_interfaces_macsec.py index 2f1898b6f..31071a0f7 100755 --- a/smoketest/scripts/cli/test_interfaces_macsec.py +++ b/smoketest/scripts/cli/test_interfaces_macsec.py @@ -25,7 +25,7 @@ from vyos.configsession import ConfigSessionError from vyos.ifconfig import Section from vyos.util import cmd from vyos.util import read_file -from vyos.util import get_json_iface_options +from vyos.util import get_interface_config from vyos.util import process_named_running def get_config_value(interface, key): @@ -34,7 +34,7 @@ def get_config_value(interface, key): return tmp[0] def get_cipher(interface): - tmp = get_json_iface_options(interface) + tmp = get_interface_config(interface) return tmp['linkinfo']['info_data']['cipher_suite'].lower() class MACsecInterfaceTest(BasicInterfaceTest.BaseTest): diff --git a/smoketest/scripts/cli/test_interfaces_tunnel.py b/smoketest/scripts/cli/test_interfaces_tunnel.py index cad6764e6..3dddb5ef0 100755 --- a/smoketest/scripts/cli/test_interfaces_tunnel.py +++ b/smoketest/scripts/cli/test_interfaces_tunnel.py @@ -18,7 +18,7 @@ import unittest from vyos.configsession import ConfigSession from vyos.configsession import ConfigSessionError -from vyos.util import get_json_iface_options +from vyos.util import get_interface_config from vyos.template import inc_ip from base_interfaces_test import BasicInterfaceTest @@ -84,7 +84,7 @@ class TunnelInterfaceTest(BasicInterfaceTest.BaseTest): # Check if commit is ok self.session.commit() - conf = get_json_iface_options(interface) + conf = get_interface_config(interface) if encapsulation not in ['sit', 'gretap']: self.assertEqual(source_if, conf['link']) @@ -132,7 +132,7 @@ class TunnelInterfaceTest(BasicInterfaceTest.BaseTest): # Check if commit is ok self.session.commit() - conf = get_json_iface_options(interface) + conf = get_interface_config(interface) if encapsulation not in ['ip6gretap']: self.assertEqual(source_if, conf['link']) @@ -192,7 +192,7 @@ class TunnelInterfaceTest(BasicInterfaceTest.BaseTest): # Check if commit is ok self.session.commit() - conf = get_json_iface_options(interface) + conf = get_interface_config(interface) self.assertEqual(mtu, conf['mtu']) self.assertEqual(interface, conf['ifname']) self.assertEqual(encapsulation, conf['linkinfo']['info_kind']) @@ -214,7 +214,7 @@ class TunnelInterfaceTest(BasicInterfaceTest.BaseTest): # Check if commit is ok self.session.commit() - conf = get_json_iface_options(interface) + conf = get_interface_config(interface) self.assertEqual(mtu, conf['mtu']) self.assertEqual(interface, conf['ifname']) self.assertEqual(encapsulation, conf['linkinfo']['info_kind']) @@ -228,7 +228,7 @@ class TunnelInterfaceTest(BasicInterfaceTest.BaseTest): # Check if commit is ok self.session.commit() - conf = get_json_iface_options(interface) + conf = get_interface_config(interface) self.assertEqual(new_remote, conf['linkinfo']['info_data']['remote']) if __name__ == '__main__': diff --git a/smoketest/scripts/cli/test_interfaces_vxlan.py b/smoketest/scripts/cli/test_interfaces_vxlan.py index b66315c5e..2a04b0477 100755 --- a/smoketest/scripts/cli/test_interfaces_vxlan.py +++ b/smoketest/scripts/cli/test_interfaces_vxlan.py @@ -18,7 +18,7 @@ import unittest from vyos.configsession import ConfigSession from vyos.ifconfig import Interface -from vyos.util import get_json_iface_options +from vyos.util import get_interface_config from base_interfaces_test import BasicInterfaceTest @@ -52,7 +52,7 @@ class VXLANInterfaceTest(BasicInterfaceTest.BaseTest): ttl = 20 for interface in self._interfaces: - options = get_json_iface_options(interface) + options = get_interface_config(interface) vni = options['linkinfo']['info_data']['id'] self.assertIn(f'vni {vni}', self._options[interface]) diff --git a/smoketest/scripts/cli/test_protocols_static.py b/smoketest/scripts/cli/test_protocols_static.py index e68b86024..28ae5e2dd 100755 --- a/smoketest/scripts/cli/test_protocols_static.py +++ b/smoketest/scripts/cli/test_protocols_static.py @@ -21,7 +21,7 @@ from vyos.configsession import ConfigSession from vyos.configsession import ConfigSessionError from vyos.template import is_ipv6 from vyos.util import cmd -from vyos.util import get_json_iface_options +from vyos.util import get_interface_config base_path = ['protocols', 'static'] vrf_path = ['protocols', 'vrf'] @@ -340,7 +340,7 @@ class StaticRouteTest(unittest.TestCase): self.session.commit() for vrf, vrf_config in vrfs.items(): - tmp = get_json_iface_options(vrf) + tmp = get_interface_config(vrf) # Compare VRF table ID self.assertEqual(tmp['linkinfo']['info_data']['table'], int(vrf_config['table'])) -- cgit v1.2.3