]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-03-JOBS/test.sh
scripts: use 4 space indentation
[thirdparty/systemd.git] / test / TEST-03-JOBS / test.sh
1 #!/bin/bash
2 set -e
3 TEST_DESCRIPTION="Job-related tests"
4 TEST_NO_QEMU=1
5
6 . $TEST_BASE_DIR/test-functions
7
8 test_setup() {
9 create_empty_image
10 mkdir -p $TESTDIR/root
11 mount ${LOOPDEV}p1 $TESTDIR/root
12
13 # Create what will eventually be our root filesystem onto an overlay
14 (
15 LOG_LEVEL=5
16 eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
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 After=multi-user.target
33
34 [Service]
35 ExecStart=/test-jobs.sh
36 Type=oneshot
37 StandardOutput=tty
38 StandardError=tty
39 EOF
40
41 # copy the units used by this test
42 cp $TEST_BASE_DIR/{hello.service,sleep.service,hello-after-sleep.target,unstoppable.service} \
43 $initdir/etc/systemd/system
44 cp test-jobs.sh $initdir/
45
46 setup_testsuite
47 ) || return 1
48 setup_nspawn_root
49
50 ddebug "umount $TESTDIR/root"
51 umount $TESTDIR/root
52 }
53
54 do_test "$@"