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