diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-11-13 14:50:09 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-11-13 14:50:11 +0100 |
commit | 6962bc53fa246f3e5c081ffec5f996fcb821273b (patch) | |
tree | c5eb5ffb11cb9dd633c39e8ddafde27083e8acf1 /smoketest/scripts/cli/test_interfaces_openvpn.py | |
parent | 943a4a5016cfc75a352bb3711b5c4c8bfe32b740 (diff) | |
download | vyos-1x-6962bc53fa246f3e5c081ffec5f996fcb821273b.tar.gz vyos-1x-6962bc53fa246f3e5c081ffec5f996fcb821273b.zip |
vyos.template: provide general is_ip(v4|v6) helpers
We had two places were the is_ip, is_ipv4 and is_ipv6 helpers had been defined.
All places now have been converged into vyos.template as they are used both
in the Jinja2 templates and also in our scripts.
Diffstat (limited to 'smoketest/scripts/cli/test_interfaces_openvpn.py')
-rwxr-xr-x | smoketest/scripts/cli/test_interfaces_openvpn.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_openvpn.py b/smoketest/scripts/cli/test_interfaces_openvpn.py index 63deef5c2..4f2526977 100755 --- a/smoketest/scripts/cli/test_interfaces_openvpn.py +++ b/smoketest/scripts/cli/test_interfaces_openvpn.py @@ -26,11 +26,11 @@ from vyos.configsession import ConfigSessionError from vyos.util import cmd from vyos.util import process_named_running from vyos.util import read_file -from vyos.template import vyos_inc_ip -from vyos.template import vyos_address_from_cidr -from vyos.template import vyos_netmask_from_cidr -from vyos.template import vyos_last_host_address -from vyos.template import vyos_inc_ip +from vyos.template import inc_ip +from vyos.template import address_from_cidr +from vyos.template import netmask_from_cidr +from vyos.template import last_host_address +from vyos.template import inc_ip PROCESS_NAME = 'openvpn' @@ -319,7 +319,7 @@ class TestInterfacesOpenVPN(unittest.TestCase): for ii in num_range: interface = f'vtun{ii}' subnet = f'192.0.{ii}.0/24' - client_ip = vyos_inc_ip(subnet, '5') + client_ip = inc_ip(subnet, '5') path = base_path + [interface] port = str(2000 + ii) @@ -349,11 +349,11 @@ class TestInterfacesOpenVPN(unittest.TestCase): interface = f'vtun{ii}' subnet = f'192.0.{ii}.0/24' - start_addr = vyos_inc_ip(subnet, '2') - stop_addr = vyos_last_host_address(subnet) + start_addr = inc_ip(subnet, '2') + stop_addr = last_host_address(subnet) - client_ip = vyos_inc_ip(subnet, '5') - client_netmask = vyos_netmask_from_cidr(subnet) + client_ip = inc_ip(subnet, '5') + client_netmask = netmask_from_cidr(subnet) port = str(2000 + ii) @@ -387,7 +387,7 @@ class TestInterfacesOpenVPN(unittest.TestCase): self.assertIn(f'ifconfig-push {client_ip} {client_netmask}', client_config) for route in client1_routes: - self.assertIn('iroute {} {}'.format(vyos_address_from_cidr(route), vyos_netmask_from_cidr(route)), client_config) + self.assertIn('iroute {} {}'.format(address_from_cidr(route), netmask_from_cidr(route)), client_config) self.assertTrue(process_named_running(PROCESS_NAME)) self.assertEqual(get_vrf(interface), vrf_name) @@ -434,8 +434,8 @@ class TestInterfacesOpenVPN(unittest.TestCase): for ii in num_range: interface = f'vtun{ii}' subnet = f'192.0.{ii}.0/24' - start_addr = vyos_inc_ip(subnet, '4') - stop_addr = vyos_last_host_address(subnet) + start_addr = inc_ip(subnet, '4') + stop_addr = last_host_address(subnet) port = str(2000 + ii) config_file = f'/run/openvpn/{interface}.conf' |