]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/TEST-01-BASIC/test.sh
treewide: more portable bash shebangs
[thirdparty/systemd.git] / test / TEST-01-BASIC / test.sh
CommitLineData
ff12a795 1#!/usr/bin/env bash
818567fc 2set -e
898720b7 3TEST_DESCRIPTION="Basic systemd setup"
9103671d 4RUN_IN_UNPRIVILEGED_CONTAINER=${RUN_IN_UNPRIVILEGED_CONTAINER:-yes}
898720b7 5
fff87a35 6. $TEST_BASE_DIR/test-functions
898720b7 7
898720b7 8test_setup() {
ec4cab49 9 create_empty_image_rootdir
898720b7 10
898720b7
HH
11 # Create what will eventually be our root filesystem onto an overlay
12 (
13 LOG_LEVEL=5
0d6e798a
HH
14 eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
15
889a9042 16 setup_basic_environment
898720b7
HH
17
18 # setup the testsuite service
6b197f2a 19 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
898720b7
HH
20[Unit]
21Description=Testsuite service
22After=multi-user.target
23
24[Service]
d0533a31 25ExecStart=/bin/sh -e -x -c 'systemctl --state=failed --no-legend --no-pager > /failed ; systemctl daemon-reload ; echo OK > /testok'
898720b7 26Type=oneshot
898720b7 27EOF
c90feab4 28
889a9042 29 setup_testsuite
cc469c3d 30 )
889a9042 31 setup_nspawn_root
898720b7
HH
32}
33
898720b7 34do_test "$@"