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