]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-33-CLEAN-UNIT/test.sh
test: add function to reduce copied setup boilerplate
[thirdparty/systemd.git] / test / TEST-33-CLEAN-UNIT / test.sh
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
4 set -e
5 TEST_DESCRIPTION="test CleanUnit"
6
7 . $TEST_BASE_DIR/test-functions
8
9 test_setup() {
10 create_empty_image_rootdir
11
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
24 [Service]
25 ExecStart=/bin/bash -x /testsuite.sh
26 Type=oneshot
27 EOF
28 cp testsuite.sh $initdir/
29
30 setup_testsuite
31 ) || return 1
32 setup_nspawn_root
33 }
34
35 do_test "$@"