diff options
| author | Daniil Baturin <daniil@vyos.io> | 2026-03-24 15:12:47 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-24 15:12:47 +0000 |
| commit | 5c070bcf12f9ba0194331898d351fb0f61cb1078 (patch) | |
| tree | 17e4a4a46c3f5b41cbb31470836a40b968a5dc9f /smoketest/scripts/cli | |
| parent | a2d3459413d47a418d3bb1dec9516b85f3e5e380 (diff) | |
| parent | 51a1b87e973808e47b6b1bee6736394a5ee77dcc (diff) | |
| download | vyos-1x-5c070bcf12f9ba0194331898d351fb0f61cb1078.tar.gz vyos-1x-5c070bcf12f9ba0194331898d351fb0f61cb1078.zip | |
Merge pull request #5077 from c-po/system-login-default-password
login: T8415: show Warning() if default password is used when adding user
Diffstat (limited to 'smoketest/scripts/cli')
| -rwxr-xr-x | smoketest/scripts/cli/test_system_login.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/smoketest/scripts/cli/test_system_login.py b/smoketest/scripts/cli/test_system_login.py index 77027ef01..592e21ece 100755 --- a/smoketest/scripts/cli/test_system_login.py +++ b/smoketest/scripts/cli/test_system_login.py @@ -31,6 +31,7 @@ from subprocess import PIPE from vyos.configsession import ConfigSessionError from vyos.configquery import ConfigTreeQuery +from vyos.utils.auth import DEFAULT_PASSWORD from vyos.utils.auth import get_current_user from vyos.utils.auth import get_local_passwd_entries from vyos.utils.process import cmd @@ -235,14 +236,22 @@ class TestSystemLogin(VyOSUnitTestSHIM.TestCase): self.assertIn(f'{locked_user} P ', tmp) def test_system_login_weak_password_warning(self): + username = weak_passwd_user[0] self.cli_set(base_path + [ - 'user', weak_passwd_user[0], 'authentication', + 'user', username, 'authentication', 'plaintext-password', weak_passwd_user[1] ]) out = self.cli_commit().strip() + self.assertIn(f'WARNING: User "{username}" - The password complexity is too low', out) + + self.cli_set(base_path + [ + 'user', username, 'authentication', + 'plaintext-password', DEFAULT_PASSWORD]) + + out = self.cli_commit().strip() + self.assertIn(f'WARNING: Default password used for user "{username}"', out) - self.assertIn('WARNING: The password complexity is too low', out) self.cli_delete(base_path + ['user', weak_passwd_user[0]]) def test_system_login_otp(self): |
