From 4791195ae206483f3de1e1b602feefe354834222 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 23 Jul 2021 19:31:30 +0200 Subject: login: T3699: verify system username does not conflict with Linux base users (cherry picked from commit 7292631373ea50f9908796ef2eda32e672d1df2e) --- smoketest/scripts/cli/test_system_login.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'smoketest/scripts') diff --git a/smoketest/scripts/cli/test_system_login.py b/smoketest/scripts/cli/test_system_login.py index aa97511e0..8327235fb 100755 --- a/smoketest/scripts/cli/test_system_login.py +++ b/smoketest/scripts/cli/test_system_login.py @@ -41,6 +41,17 @@ class TestSystemLogin(VyOSUnitTestSHIM.TestCase): self.cli_commit() + def test_add_linux_system_user(self): + system_user = 'backup' + self.cli_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.cli_commit() + + self.cli_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.cli_set(['service', 'ssh', 'port', '22']) -- cgit v1.2.3