]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-41-ONESHOT-RESTART/test.sh
treewide: more portable bash shebangs
[thirdparty/systemd.git] / test / TEST-41-ONESHOT-RESTART / test.sh
1 #!/usr/bin/env bash
2 set -e
3 TEST_DESCRIPTION="Test oneshot unit restart on failure"
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
14 mask_supporting_services
15
16 # setup the testsuite service
17 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
18 [Unit]
19 Description=Testsuite service
20
21 [Service]
22 ExecStart=/testsuite.sh
23 Type=oneshot
24 EOF
25 cp testsuite.sh $initdir/
26
27 setup_testsuite
28 )
29 setup_nspawn_root
30 }
31
32 do_test "$@"