]>
Commit | Line | Data |
---|---|---|
33e40442 EV |
1 | #!/bin/bash |
2 | # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- | |
3 | # ex: ts=8 sw=4 sts=4 et filetype=sh | |
818567fc | 4 | set -e |
33e40442 EV |
5 | TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/2467" |
6 | ||
7 | . $TEST_BASE_DIR/test-functions | |
8 | SKIP_INITRD=yes | |
9 | ||
33e40442 EV |
10 | test_setup() { |
11 | create_empty_image | |
12 | mkdir -p $TESTDIR/root | |
13 | mount ${LOOPDEV}p1 $TESTDIR/root | |
14 | ||
15 | # Create what will eventually be our root filesystem onto an overlay | |
16 | ( | |
17 | LOG_LEVEL=5 | |
18 | eval $(udevadm info --export --query=env --name=${LOOPDEV}p2) | |
19 | ||
20 | setup_basic_environment | |
9b45c2bf | 21 | dracut_install true rm |
33e40442 EV |
22 | |
23 | # setup the testsuite service | |
24 | cat >$initdir/etc/systemd/system/testsuite.service <<'EOF' | |
25 | [Unit] | |
26 | Description=Testsuite service | |
27 | After=multi-user.target | |
28 | ||
29 | [Service] | |
30 | Type=oneshot | |
9b45c2bf LP |
31 | StandardOutput=tty |
32 | StandardError=tty | |
33 | ExecStart=/bin/sh -e -x -c 'rm -f /tmp/nonexistent; systemctl start test.socket; echo > /run/test.ctl; >/testok' | |
33e40442 EV |
34 | TimeoutStartSec=10s |
35 | EOF | |
36 | ||
37 | cat >$initdir/etc/systemd/system/test.socket <<'EOF' | |
38 | [Socket] | |
9b45c2bf | 39 | ListenFIFO=/run/test.ctl |
33e40442 EV |
40 | EOF |
41 | ||
42 | cat > $initdir/etc/systemd/system/test.service <<'EOF' | |
43 | [Unit] | |
44 | Requires=test.socket | |
45 | ConditionPathExistsGlob=/tmp/nonexistent | |
46 | ||
47 | [Service] | |
48 | ExecStart=/bin/true | |
49 | EOF | |
50 | ||
51 | setup_testsuite | |
52 | ) || return 1 | |
f2d566b7 | 53 | setup_nspawn_root |
33e40442 EV |
54 | |
55 | # mask some services that we do not want to run in these tests | |
56 | ln -s /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service | |
57 | ln -s /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service | |
58 | ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.service | |
59 | ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.socket | |
60 | ln -s /dev/null $initdir/etc/systemd/system/systemd-resolved.service | |
61 | ||
62 | ddebug "umount $TESTDIR/root" | |
63 | umount $TESTDIR/root | |
64 | } | |
65 | ||
33e40442 | 66 | do_test "$@" |