]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-03-JOBS/test.sh
test: add function to reduce copied setup boilerplate
[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_rootdir
10
11 # Create what will eventually be our root filesystem onto an overlay
12 (
13 LOG_LEVEL=5
14 eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
15
16 setup_basic_environment
17 mask_supporting_services
18
19 # setup the testsuite service
20 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
21 [Unit]
22 Description=Testsuite service
23 After=multi-user.target
24
25 [Service]
26 ExecStart=/test-jobs.sh
27 Type=oneshot
28 EOF
29
30 # copy the units used by this test
31 cp $TEST_BASE_DIR/{hello.service,sleep.service,hello-after-sleep.target,unstoppable.service} \
32 $initdir/etc/systemd/system
33 cp test-jobs.sh $initdir/
34
35 setup_testsuite
36 )
37 setup_nspawn_root
38 }
39
40 do_test "$@"