diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-11-15 16:45:27 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-11-15 16:45:30 +0100 |
commit | 4dc93212f77c00433330f5e90d4c5383c883f644 (patch) | |
tree | 6c16dad5ecaa300435f5e20a785e4a2014fbc36e /smoketest/scripts/cli/test_interfaces_tunnel.py | |
parent | 273fedf74156a0249d672c80b3b43c4df6f6d966 (diff) | |
download | vyos-1x-4dc93212f77c00433330f5e90d4c5383c883f644.tar.gz vyos-1x-4dc93212f77c00433330f5e90d4c5383c883f644.zip |
smoketest: tunnel: local-ip and dhcp-interface can not be used together
Diffstat (limited to 'smoketest/scripts/cli/test_interfaces_tunnel.py')
-rwxr-xr-x | smoketest/scripts/cli/test_interfaces_tunnel.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_tunnel.py b/smoketest/scripts/cli/test_interfaces_tunnel.py index c11426d01..4817321cf 100755 --- a/smoketest/scripts/cli/test_interfaces_tunnel.py +++ b/smoketest/scripts/cli/test_interfaces_tunnel.py @@ -156,7 +156,7 @@ class TunnelInterfaceTest(BasicInterfaceTest.BaseTest): self.assertEqual(self.local_v6, conf['linkinfo']['info_data']['local']) self.assertEqual(remote_ip6, conf['linkinfo']['info_data']['remote']) - def test_ipv4_local_remove_addr(self): + def test_verify_ipv4_local_remote_addr(self): """ When running tests ensure that for certain encapsulation types the local and remote IP address is actually an IPv4 address """ @@ -185,7 +185,7 @@ class TunnelInterfaceTest(BasicInterfaceTest.BaseTest): self.session.delete(self._base_path + [interface]) self.session.commit() - def test_ipv6_local_remove_addr(self): + def test_verify_ipv6_local_remote_addr(self): """ When running tests ensure that for certain encapsulation types the local and remote IP address is actually an IPv6 address """ @@ -214,6 +214,26 @@ class TunnelInterfaceTest(BasicInterfaceTest.BaseTest): self.session.delete(self._base_path + [interface]) self.session.commit() + def test_verify_local_dhcp(self): + """ We can not use local-ip and dhcp-interface at the same time """ + + interface = f'tun1020' + local_if_addr = f'10.0.0.1/24' + + self.session.set(self._base_path + [interface, 'address', local_if_addr]) + self.session.set(self._base_path + [interface, 'encapsulation', 'gre']) + self.session.set(self._base_path + [interface, 'local-ip', self.local_v4]) + self.session.set(self._base_path + [interface, 'remote-ip', remote_ip4]) + self.session.set(self._base_path + [interface, 'dhcp-interface', 'eth0']) + + # local-ip and dhcp-interface can not be used at the same time + with self.assertRaises(ConfigSessionError): + self.session.commit() + self.session.delete(self._base_path + [interface, 'dhcp-interface']) + + # Check if commit is ok + self.session.commit() + def test_ip6ip6(self): interface = 'tun120' encapsulation = 'ip6ip6' |