summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_service_ssh.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-12-09 23:15:15 +0100
committerChristian Breunig <christian@breunig.cc>2025-12-17 21:27:23 +0100
commit5566e6035b42e99eb874c3c5a35fe72e8435df38 (patch)
tree1ffcb1016fcf4b028021d28846f06d465882dba4 /smoketest/scripts/cli/test_service_ssh.py
parentcd11ba957a33933742304b4efbba77461e803cb3 (diff)
downloadvyos-1x-5566e6035b42e99eb874c3c5a35fe72e8435df38.tar.gz
vyos-1x-5566e6035b42e99eb874c3c5a35fe72e8435df38.zip
login: T8086: replace getpwall() occurances with get_local_passwd_entries()
Switch to our custom implementation to avoid NSS/TACACS timeouts as explained in commit 4c9eaaa96e06 ("login: replace getpwall() user enumeration to avoid NSS/TACACS timeouts").
Diffstat (limited to 'smoketest/scripts/cli/test_service_ssh.py')
-rwxr-xr-xsmoketest/scripts/cli/test_service_ssh.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/smoketest/scripts/cli/test_service_ssh.py b/smoketest/scripts/cli/test_service_ssh.py
index 4ef3dd51d..8cd4a2178 100755
--- a/smoketest/scripts/cli/test_service_ssh.py
+++ b/smoketest/scripts/cli/test_service_ssh.py
@@ -19,12 +19,11 @@ import paramiko
import re
import unittest
-from pwd import getpwall
-
from base_vyostest_shim import VyOSUnitTestSHIM
from vyos.configsession import ConfigSessionError
from vyos.defaults import config_files
+from vyos.utils.auth import get_local_passwd_entries
from vyos.utils.process import cmd
from vyos.utils.process import is_systemd_service_running
from vyos.utils.process import process_named_running
@@ -311,7 +310,7 @@ class TestServiceSSH(VyOSUnitTestSHIM.TestCase):
self.cli_commit()
# After deletion the test user is not allowed to remain in /etc/passwd
- usernames = [x[0] for x in getpwall()]
+ usernames = [x.pw_name for x in get_local_passwd_entries()]
self.assertNotIn(test_user, usernames)
def test_ssh_dynamic_protection(self):