]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-27-STDOUTFILE/test.sh
scripts: use 4 space indentation
[thirdparty/systemd.git] / test / TEST-27-STDOUTFILE / test.sh
1 #!/bin/bash
2 set -e
3 TEST_DESCRIPTION="test StandardOutput=file:"
4
5 . $TEST_BASE_DIR/test-functions
6
7 test_setup() {
8 create_empty_image
9 mkdir -p $TESTDIR/root
10 mount ${LOOPDEV}p1 $TESTDIR/root
11
12 (
13 LOG_LEVEL=5
14 eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
15
16 inst_binary cmp
17
18 setup_basic_environment
19
20 # mask some services that we do not want to run in these tests
21 ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
22 ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
23 ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
24 ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
25 ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
26 ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service
27
28 # setup the testsuite service
29 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
30 [Unit]
31 Description=Testsuite service
32
33 [Service]
34 ExecStart=/testsuite.sh
35 Type=oneshot
36 StandardOutput=tty
37 StandardError=tty
38 NotifyAccess=all
39 EOF
40 cp testsuite.sh $initdir/
41
42 setup_testsuite
43 ) || return 1
44 setup_nspawn_root
45
46 ddebug "umount $TESTDIR/root"
47 umount $TESTDIR/root
48 }
49
50 do_test "$@"