Skip login shell detection when login shell is set to nologin

This commit is contained in:
Kovid Goyal 2022-05-28 08:09:30 +05:30
parent 8540ca3990
commit 27906ea853
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -196,6 +196,8 @@ copy --exclude */w.* d1
self.assertTrue(methods) self.assertTrue(methods)
import pwd import pwd
expected_login_shell = pwd.getpwuid(os.geteuid()).pw_shell expected_login_shell = pwd.getpwuid(os.geteuid()).pw_shell
if os.path.basename(expected_login_shell) == 'nologin':
self.skipTest('Skipping login shell detection as login shell is set to nologin')
for m in methods: for m in methods:
for sh in self.all_possible_sh: for sh in self.all_possible_sh:
if 'python' in sh: if 'python' in sh: