]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/TEST-10-ISSUE-2467/test.sh
scripts: use 4 space indentation
[thirdparty/systemd.git] / test / TEST-10-ISSUE-2467 / test.sh
CommitLineData
33e40442 1#!/bin/bash
818567fc 2set -e
33e40442
EV
3TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/2467"
4
5. $TEST_BASE_DIR/test-functions
33e40442 6
33e40442
EV
7test_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]
23Description=Testsuite service
33e40442
EV
24
25[Service]
26Type=oneshot
9b45c2bf
LP
27StandardOutput=tty
28StandardError=tty
b35d6d82 29ExecStart=/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
30TimeoutStartSec=10s
31EOF
32
33 cat >$initdir/etc/systemd/system/test.socket <<'EOF'
34[Socket]
b35d6d82 35ListenStream=/run/test.ctl
33e40442
EV
36EOF
37
38 cat > $initdir/etc/systemd/system/test.service <<'EOF'
39[Unit]
40Requires=test.socket
41ConditionPathExistsGlob=/tmp/nonexistent
42
43[Service]
44ExecStart=/bin/true
45EOF
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 62do_test "$@"