From de27f4c8b8dd230a936f1b467a1da275f6fe024b Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 22 Dec 2021 16:52:47 +0900 Subject: [PATCH] test: wait for user inactive The user may be busy when auto-rebalancing the user's home device. Workaround for #21589. --- Dec 01 15:03:15 H systemd-homework[1078]: Provided password unlocks user record. Dec 01 15:03:15 H systemd-homework[1078]: Image file '/home/test-user.home' already locked, can't use. Dec 01 15:03:15 H systemd-homed[240]: Worker reported error code EADDRINUSE. Dec 01 15:03:15 H systemd-homed[240]: Activation failed: Address already in use --- --- test/units/testsuite-46.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/units/testsuite-46.sh b/test/units/testsuite-46.sh index d0bedc63d5e..c3e57cec95c 100755 --- a/test/units/testsuite-46.sh +++ b/test/units/testsuite-46.sh @@ -153,13 +153,20 @@ if ! systemd-detect-virt -cq ; then inspect test-user2 fi +wait_for_state test-user inactive PASSWORD=xEhErW0ndafV4s homectl with test-user -- test ! -f /home/test-user/xyz +wait_for_state test-user inactive PASSWORD=xEhErW0ndafV4s homectl with test-user -- test -f /home/test-user/xyz \ && { echo 'unexpected success'; exit 1; } +wait_for_state test-user inactive PASSWORD=xEhErW0ndafV4s homectl with test-user -- touch /home/test-user/xyz +wait_for_state test-user inactive PASSWORD=xEhErW0ndafV4s homectl with test-user -- test -f /home/test-user/xyz +wait_for_state test-user inactive PASSWORD=xEhErW0ndafV4s homectl with test-user -- rm /home/test-user/xyz +wait_for_state test-user inactive PASSWORD=xEhErW0ndafV4s homectl with test-user -- test ! -f /home/test-user/xyz +wait_for_state test-user inactive PASSWORD=xEhErW0ndafV4s homectl with test-user -- test -f /home/test-user/xyz \ && { echo 'unexpected success'; exit 1; } -- 2.47.3