]>
Commit | Line | Data |
---|---|---|
33e40442 | 1 | #!/bin/bash |
818567fc | 2 | set -e |
33e40442 EV |
3 | TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/2467" |
4 | ||
5 | . $TEST_BASE_DIR/test-functions | |
33e40442 | 6 | |
33e40442 EV |
7 | test_setup() { |
8 | create_empty_image | |
9 | mkdir -p $TESTDIR/root | |
10 | mount ${LOOPDEV}p1 $TESTDIR/root | |
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 | |
b35d6d82 | 18 | dracut_install true rm socat |
33e40442 EV |
19 | |
20 | # setup the testsuite service | |
21 | cat >$initdir/etc/systemd/system/testsuite.service <<'EOF' | |
22 | [Unit] | |
23 | Description=Testsuite service | |
33e40442 EV |
24 | |
25 | [Service] | |
26 | Type=oneshot | |
9b45c2bf LP |
27 | StandardOutput=tty |
28 | StandardError=tty | |
b35d6d82 | 29 | ExecStart=/bin/sh -e -x -c 'rm -f /tmp/nonexistent; systemctl start test.socket; printf x > test.file; socat -t20 OPEN:test.file UNIX-CONNECT:/run/test.ctl; >/testok' |
33e40442 EV |
30 | TimeoutStartSec=10s |
31 | EOF | |
32 | ||
33 | cat >$initdir/etc/systemd/system/test.socket <<'EOF' | |
34 | [Socket] | |
b35d6d82 | 35 | ListenStream=/run/test.ctl |
33e40442 EV |
36 | EOF |
37 | ||
38 | cat > $initdir/etc/systemd/system/test.service <<'EOF' | |
39 | [Unit] | |
40 | Requires=test.socket | |
41 | ConditionPathExistsGlob=/tmp/nonexistent | |
42 | ||
43 | [Service] | |
44 | ExecStart=/bin/true | |
45 | EOF | |
46 | ||
47 | setup_testsuite | |
48 | ) || return 1 | |
f2d566b7 | 49 | setup_nspawn_root |
33e40442 EV |
50 | |
51 | # mask some services that we do not want to run in these tests | |
52 | ln -s /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service | |
53 | ln -s /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service | |
54 | ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.service | |
55 | ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.socket | |
56 | ln -s /dev/null $initdir/etc/systemd/system/systemd-resolved.service | |
57 | ||
58 | ddebug "umount $TESTDIR/root" | |
59 | umount $TESTDIR/root | |
60 | } | |
61 | ||
33e40442 | 62 | do_test "$@" |