]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-31-DEVICE-ENUMERATION/test.sh
test: add function to reduce copied setup boilerplate
[thirdparty/systemd.git] / test / TEST-31-DEVICE-ENUMERATION / test.sh
1 #!/bin/bash
2 set -e
3 TEST_DESCRIPTION="plugged -> dead -> plugged issue #11997"
4 TEST_NO_NSPAWN=1
5
6 . $TEST_BASE_DIR/test-functions
7 QEMU_TIMEOUT=300
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 )
32 }
33
34 do_test "$@"