]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/TEST-03-JOBS/test.sh
test: add testcase for environment file variables with backslashes
[thirdparty/systemd.git] / test / TEST-03-JOBS / test.sh
CommitLineData
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 4set -e
d710d363 5TEST_DESCRIPTION="Job-related tests"
b5da077d 6
fff87a35 7. $TEST_BASE_DIR/test-functions
b5da077d 8
b5da077d 9test_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]
24Description=Testsuite service
25After=multi-user.target
26
27[Service]
28ExecStart=/test-jobs.sh
29Type=oneshot
30EOF
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 45do_test "$@"