]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-17-UDEV-WANTS/test.sh
scripts: use 4 space indentation
[thirdparty/systemd.git] / test / TEST-17-UDEV-WANTS / test.sh
1 #!/bin/bash
2 set -e
3 TEST_DESCRIPTION="UDEV SYSTEMD_WANTS property"
4 TEST_NO_NSPAWN=1
5
6 . $TEST_BASE_DIR/test-functions
7 QEMU_TIMEOUT=300
8
9 test_setup() {
10 create_empty_image
11 mkdir -p $TESTDIR/root
12 mount ${LOOPDEV}p1 $TESTDIR/root
13
14 (
15 LOG_LEVEL=5
16 eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
17
18 setup_basic_environment
19
20 # mask some services that we do not want to run in these tests
21 ln -s /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
22 ln -s /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
23 ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.service
24 ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
25 ln -s /dev/null $initdir/etc/systemd/system/systemd-resolved.service
26
27 # setup the testsuite service
28 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
29 [Unit]
30 Description=Testsuite service
31
32 [Service]
33 ExecStart=/bin/bash -x /testsuite.sh
34 Type=oneshot
35 StandardOutput=tty
36 StandardError=tty
37 EOF
38 cp testsuite.sh $initdir/
39
40 setup_testsuite
41 ) || return 1
42
43 ddebug "umount $TESTDIR/root"
44 umount $TESTDIR/root
45 }
46
47 do_test "$@"