5 # Check if homectl is installed, and if it isn't bail out early instead of failing
6 if ! test -x /usr
/bin
/homectl
; then
12 # As updating disk-size-related attributes can take some time on some
13 # filesystems, let's drop these fields before comparing the outputs to
14 # avoid unexpected fails. To see the full outputs of both homectl &
15 # userdbctl (for debugging purposes) drop the fields just before the
17 local USERNAME
="${1:?missing argument}"
18 homectl inspect
"$USERNAME" |
tee /tmp
/a
19 userdbctl user
"$USERNAME" |
tee /tmp
/b
21 diff -I '/^\s*Disk (Size|Free|Floor|Ceiling):/' /tmp
/{a
,b
}
25 systemd-analyze log-level debug
26 systemd-analyze log-target console
28 NEWPASSWORD
=xEhErW0ndafV4s homectl create test-user
--disk-size=20M
31 PASSWORD
=xEhErW0ndafV4s homectl authenticate test-user
33 PASSWORD
=xEhErW0ndafV4s homectl activate test-user
36 PASSWORD
=xEhErW0ndafV4s homectl update test-user
--real-name="Inline test"
39 homectl deactivate test-user
42 PASSWORD
=xEhErW0ndafV4s NEWPASSWORD
=yPN4N0fYNKUkOq homectl passwd test-user
45 PASSWORD
=yPN4N0fYNKUkOq homectl activate test-user
48 SYSTEMD_LOG_LEVEL
=debug PASSWORD
=yPN4N0fYNKUkOq NEWPASSWORD
=xEhErW0ndafV4s homectl passwd test-user
51 homectl deactivate test-user
54 PASSWORD
=xEhErW0ndafV4s homectl activate test-user
57 PASSWORD
=xEhErW0ndafV4s homectl deactivate test-user
60 PASSWORD
=xEhErW0ndafV4s homectl update test-user
--real-name="Offline test"
63 PASSWORD
=xEhErW0ndafV4s homectl activate test-user
66 PASSWORD
=xEhErW0ndafV4s homectl deactivate test-user
69 PASSWORD
=xEhErW0ndafV4s homectl with test-user
-- test ! -f /home
/test-user
/xyz
70 PASSWORD
=xEhErW0ndafV4s homectl with test-user
-- test -f /home
/test-user
/xyz \
71 && { echo 'unexpected success'; exit 1; }
72 PASSWORD
=xEhErW0ndafV4s homectl with test-user
-- touch /home
/test-user
/xyz
73 PASSWORD
=xEhErW0ndafV4s homectl with test-user
-- test -f /home
/test-user
/xyz
74 PASSWORD
=xEhErW0ndafV4s homectl with test-user
-- rm /home
/test-user
/xyz
75 PASSWORD
=xEhErW0ndafV4s homectl with test-user
-- test ! -f /home
/test-user
/xyz
76 PASSWORD
=xEhErW0ndafV4s homectl with test-user
-- test -f /home
/test-user
/xyz \
77 && { echo 'unexpected success'; exit 1; }
79 homectl remove test-user
81 systemd-analyze log-level info