]>
Commit | Line | Data |
---|---|---|
b5da077d MS |
1 | #!/bin/bash |
2 | # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- | |
3 | # ex: ts=8 sw=4 sts=4 et filetype=sh | |
818567fc | 4 | set -e |
d710d363 | 5 | TEST_DESCRIPTION="Job-related tests" |
b5da077d | 6 | |
fff87a35 | 7 | . $TEST_BASE_DIR/test-functions |
b5da077d | 8 | |
b5da077d | 9 | test_setup() { |
889a9042 | 10 | create_empty_image |
b5da077d MS |
11 | mkdir -p $TESTDIR/root |
12 | mount ${LOOPDEV}p1 $TESTDIR/root | |
b5da077d MS |
13 | |
14 | # Create what will eventually be our root filesystem onto an overlay | |
15 | ( | |
16 | LOG_LEVEL=5 | |
b5da077d MS |
17 | eval $(udevadm info --export --query=env --name=${LOOPDEV}p2) |
18 | ||
889a9042 | 19 | setup_basic_environment |
b5da077d MS |
20 | |
21 | # setup the testsuite service | |
22 | cat >$initdir/etc/systemd/system/testsuite.service <<EOF | |
23 | [Unit] | |
24 | Description=Testsuite service | |
25 | After=multi-user.target | |
26 | ||
27 | [Service] | |
28 | ExecStart=/test-jobs.sh | |
29 | Type=oneshot | |
30 | EOF | |
31 | ||
32 | # copy the units used by this test | |
d710d363 MS |
33 | cp $TEST_BASE_DIR/{hello.service,sleep.service,hello-after-sleep.target,unstoppable.service} \ |
34 | $initdir/etc/systemd/system | |
b5da077d MS |
35 | cp test-jobs.sh $initdir/ |
36 | ||
889a9042 | 37 | setup_testsuite |
cd949ee7 | 38 | ) || return 1 |
889a9042 | 39 | setup_nspawn_root |
b5da077d MS |
40 | |
41 | ddebug "umount $TESTDIR/root" | |
42 | umount $TESTDIR/root | |
43 | } | |
44 | ||
b5da077d | 45 | do_test "$@" |