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