diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-07-23 19:31:30 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-07-23 19:31:30 +0200 |
commit | 7292631373ea50f9908796ef2eda32e672d1df2e (patch) | |
tree | 41ce8f67b1795f89bb3cd1f5aa30530489d249c3 /smoketest | |
parent | ed63951fc63fe58cd1ec1f4b26f3fe955315e0cb (diff) | |
download | vyos-1x-7292631373ea50f9908796ef2eda32e672d1df2e.tar.gz vyos-1x-7292631373ea50f9908796ef2eda32e672d1df2e.zip |
login: T3699: verify system username does not conflict with Linux base users
Diffstat (limited to 'smoketest')
-rwxr-xr-x | smoketest/scripts/cli/test_system_login.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_system_login.py b/smoketest/scripts/cli/test_system_login.py index bb6f57fc2..dfa56e971 100755 --- a/smoketest/scripts/cli/test_system_login.py +++ b/smoketest/scripts/cli/test_system_login.py @@ -44,6 +44,17 @@ class TestSystemLogin(unittest.TestCase): self.session.commit() del self.session + def test_add_linux_system_user(self): + system_user = 'backup' + self.session.set(base_path + ['user', system_user, 'authentication', 'plaintext-password', system_user]) + + # check validate() - can not add username which exists on the Debian + # base system (UID < 1000) + with self.assertRaises(ConfigSessionError): + self.session.commit() + + self.session.delete(base_path + ['user', system_user]) + def test_system_login_user(self): # Check if user can be created and we can SSH to localhost self.session.set(['service', 'ssh', 'port', '22']) |