]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-18-FAILUREACTION/test.sh
scripts: use 4 space indentation
[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
10 mkdir -p $TESTDIR/root
11 mount ${LOOPDEV}p1 $TESTDIR/root
12
13 (
14 LOG_LEVEL=5
15 eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
16
17 setup_basic_environment
18
19 # setup the testsuite service
20 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
21 [Unit]
22 Description=Testsuite service
23
24 [Service]
25 ExecStart=/bin/bash -x /testsuite.sh
26 Type=oneshot
27 StandardOutput=tty
28 StandardError=tty
29 EOF
30 cp testsuite.sh $initdir/
31
32 setup_testsuite
33 ) || return 1
34 setup_nspawn_root
35
36 # mask some services that we do not want to run in these tests
37 ln -s /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
38 ln -s /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
39 ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.service
40 ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
41 ln -s /dev/null $initdir/etc/systemd/system/systemd-resolved.service
42
43 ddebug "umount $TESTDIR/root"
44 umount $TESTDIR/root
45 }
46
47 do_test "$@"