]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/TEST-04-JOURNAL/test.sh
scripts: use 4 space indentation
[thirdparty/systemd.git] / test / TEST-04-JOURNAL / test.sh
CommitLineData
1c36b4a7 1#!/bin/bash
818567fc 2set -e
1c36b4a7
EV
3TEST_DESCRIPTION="Journal-related tests"
4
5. $TEST_BASE_DIR/test-functions
6
1c36b4a7
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
18
056ae881
YW
19 # mask some services that we do not want to run in these tests
20 ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
21 ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
22 ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
23 ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
24 ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
25 ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service
26
1c36b4a7
EV
27 # setup the testsuite service
28 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
29[Unit]
30Description=Testsuite service
1c36b4a7
EV
31
32[Service]
33ExecStart=/test-journal.sh
34Type=oneshot
3889613e
EV
35EOF
36
37 cat >$initdir/etc/systemd/system/forever-print-hola.service <<EOF
38[Unit]
39Description=ForeverPrintHola service
40
41[Service]
42Type=simple
43ExecStart=/bin/sh -x -c 'while :; do printf "Hola\n" || touch /i-lose-my-logs; sleep 1; done'
1c36b4a7
EV
44EOF
45
46 cp test-journal.sh $initdir/
47
48 setup_testsuite
c7bb2873 49 ) || return 1
1c36b4a7
EV
50 setup_nspawn_root
51
52 ddebug "umount $TESTDIR/root"
53 umount $TESTDIR/root
54}
55
1c36b4a7 56do_test "$@"