]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/TEST-20-MAINPIDGAMES/test.sh
core: be stricter when handling PID files and MAINPID sd_notify() messages
[thirdparty/systemd.git] / test / TEST-20-MAINPIDGAMES / test.sh
CommitLineData
db256aab
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
4set -e
5TEST_DESCRIPTION="test changing main PID"
6
7. $TEST_BASE_DIR/test-functions
8
9test_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 # setup the testsuite service
21 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
22[Unit]
23Description=Testsuite service
24
25[Service]
26ExecStart=/bin/bash -x /testsuite.sh
27Type=oneshot
28StandardOutput=tty
29StandardError=tty
30NotifyAccess=all
31EOF
32 cp testsuite.sh $initdir/
33
34 setup_testsuite
35 ) || return 1
36 setup_nspawn_root
37
38 ddebug "umount $TESTDIR/root"
39 umount $TESTDIR/root
40}
41
42do_test "$@"