]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-46-HOMED: cleanup homedsshtest earlier
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 20 Aug 2025 18:14:29 +0000 (03:14 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 3 Sep 2025 10:10:48 +0000 (12:10 +0200)
(cherry picked from commit 5fb7b67556b10ae261d37504c202832027ca1317)

test/units/TEST-46-HOMED.sh

index 96b33109e1e5b7489ee1d577d78733722daaa02b..6c01ad48c1cc761a8e5ebc18cedc2dd553cb88f6 100755 (executable)
@@ -535,6 +535,7 @@ if command -v ssh &>/dev/null && command -v sshd &>/dev/null && ! [[ -v ASAN_OPT
         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
         for dir in /etc /usr/lib; do
             if [[ -f "$dir/pam.d/sshd.bak" ]]; then
@@ -623,8 +624,8 @@ EOF
         -o "SetEnv PASSWORD=hunter4711" -o "StrictHostKeyChecking no" \
         homedsshtest@localhost env
 
-    wait_for_state homedsshtest inactive
-    homectl remove homedsshtest
+    trap - EXIT
+    at_exit
 fi
 
 systemd-analyze log-level info