]>
Commit | Line | Data |
---|---|---|
a49ad4c4 FB |
1 | #!/bin/bash |
2 | set -e | |
3 | TEST_DESCRIPTION="Test PrivateUsers=yes on user manager" | |
4 | . $TEST_BASE_DIR/test-functions | |
5 | ||
6 | test_setup() { | |
7 | create_empty_image_rootdir | |
8 | ||
9 | ( | |
10 | LOG_LEVEL=5 | |
11 | eval $(udevadm info --export --query=env --name=${LOOPDEV}p2) | |
12 | ||
13 | setup_basic_environment | |
e5f10caf | 14 | inst_binary stat |
a49ad4c4 FB |
15 | |
16 | mask_supporting_services | |
17 | ||
18 | usermod --root $initdir -d /home/nobody -s /bin/bash nobody | |
19 | mkdir $initdir/home $initdir/home/nobody | |
20 | # Ubuntu's equivalent is nogroup | |
21 | chown nobody:nobody $initdir/home/nobody || chown nobody:nogroup $initdir/home/nobody | |
22 | ||
23 | enable_user_manager nobody | |
24 | ||
25 | nobody_uid=$(id -u nobody) | |
26 | ||
27 | # setup the testsuite service | |
28 | cat >$initdir/etc/systemd/system/testsuite.service <<EOF | |
29 | [Unit] | |
30 | Description=Testsuite service | |
31 | After=systemd-logind.service user@$nobody_uid.service | |
32 | ||
33 | [Service] | |
34 | ExecStart=/testsuite.sh | |
35 | Type=oneshot | |
36 | EOF | |
37 | cp testsuite.sh $initdir/ | |
38 | ||
39 | setup_testsuite | |
40 | ) | |
41 | setup_nspawn_root | |
42 | } | |
43 | ||
44 | has_user_dbus_socket || exit 0 | |
45 | ||
46 | do_test "$@" |