kitty_tests/ssh.py: skip login shell detection if getpwuid() fails
This commit is contained in:
parent
fda2646dd3
commit
31319f0b65
@ -173,7 +173,11 @@ env COLORTERM
|
|||||||
methods.append('using_passwd')
|
methods.append('using_passwd')
|
||||||
self.assertTrue(methods)
|
self.assertTrue(methods)
|
||||||
import pwd
|
import pwd
|
||||||
|
try:
|
||||||
expected_login_shell = pwd.getpwuid(os.geteuid()).pw_shell
|
expected_login_shell = pwd.getpwuid(os.geteuid()).pw_shell
|
||||||
|
except KeyError:
|
||||||
|
with suppress(Exception):
|
||||||
|
self.skipTest('Skipping login shell detection as getpwuid() failed to read login shell')
|
||||||
if os.path.basename(expected_login_shell) == 'nologin':
|
if os.path.basename(expected_login_shell) == 'nologin':
|
||||||
self.skipTest('Skipping login shell detection as login shell is set to nologin')
|
self.skipTest('Skipping login shell detection as login shell is set to nologin')
|
||||||
for m in methods:
|
for m in methods:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user