]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-09-ISSUE-2691/test.sh
test: add function to reduce copied setup boilerplate
[thirdparty/systemd.git] / test / TEST-09-ISSUE-2691 / test.sh
1 #!/bin/bash
2 set -e
3 TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/2691"
4 TEST_NO_NSPAWN=1
5
6 . $TEST_BASE_DIR/test-functions
7 QEMU_TIMEOUT=180
8
9 test_setup() {
10 create_empty_image_rootdir
11
12 # Create what will eventually be our root filesystem onto an overlay
13 (
14 LOG_LEVEL=5
15 eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
16
17 setup_basic_environment
18 mask_supporting_services
19
20 # setup the testsuite service
21 cat >$initdir/etc/systemd/system/testsuite.service <<'EOF'
22 [Unit]
23 Description=Testsuite service
24
25 [Service]
26 Type=oneshot
27 ExecStart=/bin/sh -c '>/testok'
28 RemainAfterExit=yes
29 ExecStop=/bin/sh -c 'kill -SEGV $$$$'
30 TimeoutStopSec=270s
31 EOF
32
33 setup_testsuite
34 )
35 }
36
37 do_test "$@"