]> git.proxmox.com Git - systemd.git/blame - test/TEST-17-UDEV-WANTS/test.sh
New upstream version 240
[systemd.git] / test / TEST-17-UDEV-WANTS / test.sh
CommitLineData
52ad194e
MB
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
4set -e
5TEST_DESCRIPTION="UDEV SYSTEMD_WANTS property"
6TEST_NO_NSPAWN=1
7
8. $TEST_BASE_DIR/test-functions
6e866b33 9QEMU_TIMEOUT=300
52ad194e
MB
10
11test_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]
32Description=Testsuite service
33
34[Service]
35ExecStart=/bin/bash -x /testsuite.sh
36Type=oneshot
37StandardOutput=tty
38StandardError=tty
39EOF
40 cp testsuite.sh $initdir/
41
42 setup_testsuite
43 ) || return 1
44
45 ddebug "umount $TESTDIR/root"
46 umount $TESTDIR/root
47}
48
49do_test "$@"