]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-18-FAILUREACTION/test.sh
test: add function to reduce copied setup boilerplate
[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=600
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 mask_supporting_services
17
18 # setup the testsuite service
19 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
20 [Unit]
21 Description=Testsuite service
22
23 [Service]
24 ExecStart=/bin/bash -x /testsuite.sh
25 Type=oneshot
26 EOF
27 cp testsuite.sh $initdir/
28
29 setup_testsuite
30 )
31
32 setup_nspawn_root
33 }
34
35 do_test "$@"