]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-18-FAILUREACTION/test.sh
5c9ca9e4270441585690fd4b1980ce49c673635b
[thirdparty/systemd.git] / test / TEST-18-FAILUREACTION / test.sh
1 #!/bin/bash
2 set -e
3 TEST_DESCRIPTION="FailureAction= operation"
4
5 . $TEST_BASE_DIR/test-functions
6 QEMU_TIMEOUT=180
7
8 test_setup() {
9 create_empty_image_rootdir
10
11 (
12 LOG_LEVEL=5
13 eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
14
15 setup_basic_environment
16
17 # setup the testsuite service
18 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
19 [Unit]
20 Description=Testsuite service
21
22 [Service]
23 ExecStart=/bin/bash -x /testsuite.sh
24 Type=oneshot
25 StandardOutput=tty
26 StandardError=tty
27 EOF
28 cp testsuite.sh $initdir/
29
30 setup_testsuite
31 )
32 setup_nspawn_root
33
34 # mask some services that we do not want to run in these tests
35 ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
36 ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
37 ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
38 ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
39 ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
40 }
41
42 do_test "$@"