]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/units/testsuite-29.sh
test: merge udev tests
[thirdparty/systemd.git] / test / units / testsuite-29.sh
1 #!/usr/bin/env bash
2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
4 set -ex
5 set -o pipefail
6
7 export SYSTEMD_LOG_LEVEL=debug
8
9 portablectl attach --now --runtime /usr/share/minimal_0.raw app0
10
11 systemctl is-active app0.service
12 systemctl is-active app0-foo.service
13 set +o pipefail
14 set +e
15 systemctl is-active app0-bar.service && exit 1
16 set -e
17 set -o pipefail
18
19 portablectl reattach --now --runtime /usr/share/minimal_1.raw app0
20
21 systemctl is-active app0.service
22 systemctl is-active app0-bar.service
23 set +o pipefail
24 set +e
25 systemctl is-active app0-foo.service && exit 1
26 set -e
27 set -o pipefail
28
29 portablectl list | grep -q -F "minimal_1"
30
31 portablectl detach --now --runtime /usr/share/minimal_1.raw app0
32
33 portablectl list | grep -q -F "No images."
34
35 # portablectl also works with directory paths rather than images
36
37 unsquashfs -dest /tmp/minimal_0 /usr/share/minimal_0.raw
38 unsquashfs -dest /tmp/minimal_1 /usr/share/minimal_1.raw
39
40 portablectl attach --copy=symlink --now --runtime /tmp/minimal_0 app0
41
42 systemctl is-active app0.service
43 systemctl is-active app0-foo.service
44 set +o pipefail
45 set +e
46 systemctl is-active app0-bar.service && exit 1
47 set -e
48 set -o pipefail
49
50 portablectl reattach --now --enable --runtime /tmp/minimal_1 app0
51
52 systemctl is-active app0.service
53 systemctl is-active app0-bar.service
54 set +o pipefail
55 set +e
56 systemctl is-active app0-foo.service && exit 1
57 set -e
58 set -o pipefail
59
60 portablectl list | grep -q -F "minimal_1"
61
62 portablectl detach --now --enable --runtime /tmp/minimal_1 app0
63
64 portablectl list | grep -q -F "No images."
65
66 echo OK > /testok
67
68 exit 0