diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-06-13 19:42:09 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-06-13 19:42:09 +0200 |
commit | 0361c3ac449f183476f7aee31439417d9f7f8012 (patch) | |
tree | fa8f8249359589900da752611ffc1deeb3c18956 /smoketest/scripts | |
parent | b42b42e6c6cca00c9d8e6808822504ac72d588e7 (diff) | |
download | vyos-1x-0361c3ac449f183476f7aee31439417d9f7f8012.tar.gz vyos-1x-0361c3ac449f183476f7aee31439417d9f7f8012.zip |
pppoe: T3621: validate that both username and password are set
A validator is missing checking that if authentication is used on a PPPoE
interface, both username and password are set.
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-x | smoketest/scripts/cli/test_interfaces_pppoe.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_pppoe.py b/smoketest/scripts/cli/test_interfaces_pppoe.py index 6bfe35d86..f7fa73ea2 100755 --- a/smoketest/scripts/cli/test_interfaces_pppoe.py +++ b/smoketest/scripts/cli/test_interfaces_pppoe.py @@ -158,5 +158,19 @@ class PPPoEInterfaceTest(unittest.TestCase): tmp = re.findall(f'systemctl restart dhcp6c@{interface}.service', tmp) self.assertTrue(tmp) + def test_pppoe_authentication(self): + # When username or password is set - so must be the other + interface = 'pppoe0' + self.session.set(base_path + [interface, 'authentication', 'user', 'vyos']) + self.session.set(base_path + [interface, 'source-interface', self._source_interface]) + self.session.set(base_path + [interface, 'ipv6', 'address', 'autoconf']) + + # check validate() - if user is set, so must be the password + with self.assertRaises(ConfigSessionError): + self.session.commit() + + self.session.set(base_path + [interface, 'authentication', 'password', 'vyos']) + self.session.commit() + if __name__ == '__main__': unittest.main(verbosity=2) |