diff options
| author | Daniil Baturin <daniil@vyos.io> | 2023-04-21 13:38:13 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-21 13:38:13 +0100 |
| commit | 821bc4f511460123e958b8eaa2e588e4623fbfe6 (patch) | |
| tree | ca5283d32a34969fa95b9ee1f1421bf7f28db5bd /smoketest/scripts/cli/test_system_login.py | |
| parent | dcba3685345b0624c13f83211628136076feac79 (diff) | |
| parent | 97ef83ada9c42913bae3c80e0f2432bdf901312a (diff) | |
| download | veeos-1x-821bc4f511460123e958b8eaa2e588e4623fbfe6.tar.gz veeos-1x-821bc4f511460123e958b8eaa2e588e4623fbfe6.zip | |
Merge branch 'current' into current
Diffstat (limited to 'smoketest/scripts/cli/test_system_login.py')
| -rwxr-xr-x | smoketest/scripts/cli/test_system_login.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_system_login.py b/smoketest/scripts/cli/test_system_login.py index 6006fe0f6..a1d2ba2ad 100755 --- a/smoketest/scripts/cli/test_system_login.py +++ b/smoketest/scripts/cli/test_system_login.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2019-2022 VyOS maintainers and contributors +# Copyright (C) 2019-2023 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -264,5 +264,26 @@ class TestSystemLogin(VyOSUnitTestSHIM.TestCase): tmp = re.findall(r'group:\s+mapname\s+files', nsswitch_conf) self.assertTrue(tmp) + def test_system_login_max_login_session(self): + max_logins = '2' + timeout = '600' + + self.cli_set(base_path + ['max-login-session', max_logins]) + + # 'max-login-session' must be only with 'timeout' option + with self.assertRaises(ConfigSessionError): + self.cli_commit() + + self.cli_set(base_path + ['timeout', timeout]) + + self.cli_commit() + + security_limits = read_file('/etc/security/limits.d/10-vyos.conf') + self.assertIn(f'* - maxsyslogins {max_logins}', security_limits) + + self.cli_delete(base_path + ['timeout']) + self.cli_delete(base_path + ['max-login-session']) + + if __name__ == '__main__': unittest.main(verbosity=2) |
