summaryrefslogtreecommitdiff
path: root/test/units
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-12-22 15:43:05 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-12-22 17:30:03 +0900
commita75a4148a8d8d682fd93127e5828d64d70f12c8f (patch)
treefd45e96b685f0000813f38b7d384efad39ccbff9 /test/units
parent367649ee669b77793bdaf3d50effcc03f0ae9706 (diff)
downloadsystemd-a75a4148a8d8d682fd93127e5828d64d70f12c8f.tar.gz
test: remove test-user2
Otherwise, we cannot run the test multiple times.
Diffstat (limited to 'test/units')
-rwxr-xr-xtest/units/testsuite-46.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/units/testsuite-46.sh b/test/units/testsuite-46.sh
index 3313c18167..d0bedc63d5 100755
--- a/test/units/testsuite-46.sh
+++ b/test/units/testsuite-46.sh
@@ -26,6 +26,13 @@ inspect() {
homectl inspect --json=pretty "$USERNAME"
}
+wait_for_state() {
+ for ((i=0;i<10;i++)) ; do
+ homectl inspect "$1" | grep -qF "State: $2" && break
+ sleep .5
+ done
+}
+
systemd-analyze log-level debug
systemd-analyze log-target console
systemctl service-log-level systemd-homed debug
@@ -156,8 +163,16 @@ PASSWORD=xEhErW0ndafV4s homectl with test-user -- test ! -f /home/test-user/xyz
PASSWORD=xEhErW0ndafV4s homectl with test-user -- test -f /home/test-user/xyz \
&& { echo 'unexpected success'; exit 1; }
+wait_for_state test-user inactive
homectl remove test-user
+if ! systemd-detect-virt -cq ; then
+ wait_for_state test-user2 active
+ homectl deactivate test-user2
+ wait_for_state test-user2 inactive
+ homectl remove test-user2
+fi
+
systemd-analyze log-level info
echo OK >/testok