diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-01-07 23:41:08 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-01-07 23:41:08 +0100 |
commit | 27e1779dd431bb2144256fa4cab1466967ddf104 (patch) | |
tree | 207cad00565e4ebee4b3e069b4e03c6a208fce62 | |
parent | d7dbf3966887839168ea363c89e97204573297e9 (diff) | |
download | vyos-1x-27e1779dd431bb2144256fa4cab1466967ddf104.tar.gz vyos-1x-27e1779dd431bb2144256fa4cab1466967ddf104.zip |
smoketest: ethernet: bugfixes for dhcpc6 and unknown interfaces
-rw-r--r-- | smoketest/scripts/cli/base_interfaces_test.py | 13 | ||||
-rwxr-xr-x | smoketest/scripts/cli/test_interfaces_ethernet.py | 9 |
2 files changed, 15 insertions, 7 deletions
diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py index 5efa39bd5..5056eb190 100644 --- a/smoketest/scripts/cli/base_interfaces_test.py +++ b/smoketest/scripts/cli/base_interfaces_test.py @@ -366,7 +366,7 @@ class BasicInterfaceTest: self.assertEqual(dad_transmits, tmp) - def test_ipv6_dhcpv6_pd_auto_inc_sla_id(self): + def test_dhcpv6pd_auto_sla_id(self): if not self._test_ipv6: return None @@ -422,14 +422,12 @@ class BasicInterfaceTest: section = Section.section(delegatee) self.session.delete(['interfaces', section, delegatee]) - def test_ipv6_dhcpv6_pd_manual_sla_id(self): + def test_dhcpv6pd_manual_sla_id(self): if not self._test_ipv6: return None - address = '1' prefix_len = '56' sla_len = str(64 - int(prefix_len)) - sla_id = '1' delegatees = ['dum3340', 'dum3341', 'dum3342', 'dum3343', 'dum3344'] @@ -439,6 +437,8 @@ class BasicInterfaceTest: self.session.set(path + option.split()) # prefix delegation stuff + address = '1' + sla_id = '1' pd_base = path + ['dhcpv6-options', 'pd', '0'] self.session.set(pd_base + ['length', prefix_len]) @@ -454,9 +454,10 @@ class BasicInterfaceTest: self.session.commit() - address = '1' - sla_id = '1' + # Verify dhcpc6 client configuration for interface in self._interfaces: + address = '1' + sla_id = '1' dhcpc6_config = read_file(f'/run/dhcp6c/dhcp6c.{interface}.conf') # verify DHCPv6 prefix delegation diff --git a/smoketest/scripts/cli/test_interfaces_ethernet.py b/smoketest/scripts/cli/test_interfaces_ethernet.py index 971d965f5..0f3579c30 100755 --- a/smoketest/scripts/cli/test_interfaces_ethernet.py +++ b/smoketest/scripts/cli/test_interfaces_ethernet.py @@ -19,6 +19,7 @@ import re import unittest from base_interfaces_test import BasicInterfaceTest +from vyos.configsession import ConfigSessionError from vyos.ifconfig import Section from vyos.util import cmd from vyos.util import process_named_running @@ -124,11 +125,17 @@ class EthernetInterfaceTest(BasicInterfaceTest.BaseTest): self.assertEqual(f'{cpus:x}', f'{rps_cpus:x}') def test_non_existing_interface(self): - self.session.set(self._base_path + ['eth667']) + unknonw_interface = self._base_path + ['eth667'] + self.session.set(unknonw_interface) + # check validate() - interface does not exist with self.assertRaises(ConfigSessionError): self.session.commit() + # we need to remove this wrong interface from the configuration + # manually, else tearDown() will have problem in commit() + self.session.delete(unknonw_interface) + def test_eapol_support(self): for interface in self._interfaces: # Enable EAPoL |