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