]>
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 | 7 | test_setup() { |
ec4cab49 | 8 | create_empty_image_rootdir |
33e40442 EV |
9 | |
10 | # Create what will eventually be our root filesystem onto an overlay | |
11 | ( | |
12 | LOG_LEVEL=5 | |
13 | eval $(udevadm info --export --query=env --name=${LOOPDEV}p2) | |
14 | ||
15 | setup_basic_environment | |
51fa8591 | 16 | mask_supporting_services |
b35d6d82 | 17 | dracut_install true rm socat |
33e40442 EV |
18 | |
19 | # setup the testsuite service | |
20 | cat >$initdir/etc/systemd/system/testsuite.service <<'EOF' | |
21 | [Unit] | |
22 | Description=Testsuite service | |
33e40442 EV |
23 | |
24 | [Service] | |
25 | Type=oneshot | |
b35d6d82 | 26 | 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 |
27 | EOF |
28 | ||
29 | cat >$initdir/etc/systemd/system/test.socket <<'EOF' | |
30 | [Socket] | |
b35d6d82 | 31 | ListenStream=/run/test.ctl |
33e40442 EV |
32 | EOF |
33 | ||
34 | cat > $initdir/etc/systemd/system/test.service <<'EOF' | |
35 | [Unit] | |
36 | Requires=test.socket | |
37 | ConditionPathExistsGlob=/tmp/nonexistent | |
38 | ||
39 | [Service] | |
40 | ExecStart=/bin/true | |
41 | EOF | |
42 | ||
43 | setup_testsuite | |
cc469c3d | 44 | ) |
f2d566b7 | 45 | setup_nspawn_root |
33e40442 EV |
46 | } |
47 | ||
33e40442 | 48 | do_test "$@" |