TEST-46-HOMED: fix 2 minute timeout in cleanup

The test passes but for two minutes the cleanup function just logs:
Failed to inspect home: No home for user homedsshtest known
Failed to inspect home: No home for user homedsshtest known
Failed to inspect home: No home for user homedsshtest known
...

Do not wait for the user to become inactive or remove the user if 'homectl
inspect' doesn't find the user. This brings a successfull run from 176 s
to 58 s here.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-01-04 16:04:54 +01:00
parent fd99348353
commit 689391f8c8
+4 -2
View File
@@ -578,8 +578,10 @@ cleanup_ssh() (
systemctl is-active -q mysshserver.socket && systemctl stop mysshserver.socket
rm -f /tmp/homed.id_ecdsa /run/systemd/system/mysshserver{@.service,.socket}
systemctl daemon-reload
wait_for_state homedsshtest inactive
homectl remove homedsshtest
if homectl inspect homedsshtest &>/dev/null; then
wait_for_state homedsshtest inactive
homectl remove homedsshtest
fi
for dir in /etc /usr/lib; do
if [[ -f "$dir/pam.d/sshd.bak" ]]; then
mv "$dir/pam.d/sshd.bak" "$dir/pam.d/sshd"