]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/TEST-17-UDEV-WANTS/test.sh
test: add function to reduce copied setup boilerplate
[thirdparty/systemd.git] / test / TEST-17-UDEV-WANTS / test.sh
CommitLineData
3ac62a0e 1#!/bin/bash
3ac62a0e
LP
2set -e
3TEST_DESCRIPTION="UDEV SYSTEMD_WANTS property"
4TEST_NO_NSPAWN=1
5
6. $TEST_BASE_DIR/test-functions
f775f613 7QEMU_TIMEOUT=300
3ac62a0e
LP
8
9test_setup() {
ec4cab49 10 create_empty_image_rootdir
3ac62a0e
LP
11
12 (
13 LOG_LEVEL=5
14 eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
15
16 setup_basic_environment
51fa8591 17 mask_supporting_services
3ac62a0e
LP
18
19 # setup the testsuite service
20 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
21[Unit]
22Description=Testsuite service
23
24[Service]
23209bcd 25ExecStart=/bin/bash -x /testsuite.sh
3ac62a0e 26Type=oneshot
3ac62a0e
LP
27EOF
28 cp testsuite.sh $initdir/
29
30 setup_testsuite
cc469c3d 31 )
3ac62a0e
LP
32}
33
34do_test "$@"