]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-30-ONCLOCKCHANGE/test.sh
test: make directory for drop-in config
[thirdparty/systemd.git] / test / TEST-30-ONCLOCKCHANGE / test.sh
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="test OnClockChange= + OnTimezoneChange="
6 TEST_NO_NSPAWN=1
7
8 . $TEST_BASE_DIR/test-functions
9
10 test_setup() {
11 create_empty_image
12 mkdir -p $TESTDIR/root
13 mount ${LOOPDEV}p1 $TESTDIR/root
14
15 (
16 LOG_LEVEL=5
17 eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
18
19 inst_any /usr/share/zoneinfo/Europe/Kiev
20 inst_any /usr/share/zoneinfo/Europe/Berlin
21
22 setup_basic_environment
23
24 # mask some services that we do not want to run in these tests
25 ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
26 ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
27 ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
28 ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
29 ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
30 ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service
31
32 # extend the watchdog
33 mkdir -p $initdir/etc/systemd/system/systemd-timedated.service.d
34 cat >$initdir/etc/systemd/system/systemd-timedated.service.d/watchdog.conf <<EOF
35 [Service]
36 WatchdogSec=10min
37 EOF
38
39 # setup the testsuite service
40 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
41 [Unit]
42 Description=Testsuite service
43
44 [Service]
45 ExecStart=/testsuite.sh
46 Type=oneshot
47 StandardOutput=tty
48 StandardError=tty
49 NotifyAccess=all
50 EOF
51 cp testsuite.sh $initdir/
52
53 setup_testsuite
54 ) || return 1
55
56 ddebug "umount $TESTDIR/root"
57 umount $TESTDIR/root
58 }
59
60 do_test "$@"