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