summaryrefslogtreecommitdiff
path: root/smoketest/scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-11-01 10:46:46 +0100
committerChristian Poessinger <christian@poessinger.com>2020-11-01 13:51:44 +0100
commitbb76575715682594d4d6d73d8b9e87692bdc6841 (patch)
tree8c68a41f00708bcd1fdecdd967308e0edcbfe58c /smoketest/scripts
parent68c97eed91204904b7b2314dd9b357069db4eda5 (diff)
downloadvyos-1x-bb76575715682594d4d6d73d8b9e87692bdc6841.tar.gz
vyos-1x-bb76575715682594d4d6d73d8b9e87692bdc6841.zip
openvpn: T2994: remove workarounds for individual ipv4 and ipv6 keys
Remove workaround which split (local|remote)_address and also subnet keys into individual keys for the assigned IP address family (4/6). During template rendering check IP version by introducing new ipv4 and ipv6 Jinja2 filters {% if foo | ipv4 %} or {% if bar | ipv6 %} options.
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_openvpn.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_openvpn.py b/smoketest/scripts/cli/test_interfaces_openvpn.py
index 2dbad21cd..9485cb913 100755
--- a/smoketest/scripts/cli/test_interfaces_openvpn.py
+++ b/smoketest/scripts/cli/test_interfaces_openvpn.py
@@ -382,6 +382,7 @@ class TestInterfacesOpenVPN(unittest.TestCase):
with self.assertRaises(ConfigSessionError):
self.session.commit()
self.session.set(path + ['local-address', '10.0.0.1'])
+ self.session.set(path + ['local-address', '2001:db8:1::1'])
# check validate() - cannot specify more than 1 IPv4 local-address
self.session.set(path + ['local-address', '10.0.0.2'])
@@ -389,11 +390,18 @@ class TestInterfacesOpenVPN(unittest.TestCase):
self.session.commit()
self.session.delete(path + ['local-address', '10.0.0.2'])
+ # check validate() - cannot specify more than 1 IPv6 local-address
+ self.session.set(path + ['local-address', '2001:db8:1::2'])
+ with self.assertRaises(ConfigSessionError):
+ self.session.commit()
+ self.session.delete(path + ['local-address', '2001:db8:1::2'])
+
# check validate() - IPv4 "local-address" requires IPv4 "remote-address"
# or IPv4 "local-address subnet"
with self.assertRaises(ConfigSessionError):
self.session.commit()
self.session.set(path + ['remote-address', '192.168.0.1'])
+ self.session.set(path + ['remote-address', '2001:db8:ffff::1'])
# check validate() - Cannot specify more than 1 IPv4 "remote-address"
self.session.set(path + ['remote-address', '192.168.0.2'])
@@ -401,6 +409,12 @@ class TestInterfacesOpenVPN(unittest.TestCase):
self.session.commit()
self.session.delete(path + ['remote-address', '192.168.0.2'])
+ # check validate() - Cannot specify more than 1 IPv6 "remote-address"
+ self.session.set(path + ['remote-address', '2001:db8:ffff::2'])
+ with self.assertRaises(ConfigSessionError):
+ self.session.commit()
+ self.session.delete(path + ['remote-address', '2001:db8:ffff::2'])
+
# check validate() - Must specify one of "shared-secret-key-file" and "tls"
with self.assertRaises(ConfigSessionError):
self.session.commit()