]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/TEST-01-BASIC/test.sh
test: don't run TEST-01-BASIC in unprivileged containers on Travis CI
[thirdparty/systemd.git] / test / TEST-01-BASIC / test.sh
CommitLineData
898720b7
HH
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
818567fc 4set -e
898720b7 5TEST_DESCRIPTION="Basic systemd setup"
9103671d 6RUN_IN_UNPRIVILEGED_CONTAINER=${RUN_IN_UNPRIVILEGED_CONTAINER:-yes}
898720b7 7
fff87a35 8. $TEST_BASE_DIR/test-functions
898720b7 9
898720b7 10test_setup() {
889a9042 11 create_empty_image
898720b7
HH
12 mkdir -p $TESTDIR/root
13 mount ${LOOPDEV}p1 $TESTDIR/root
898720b7 14
898720b7
HH
15 # Create what will eventually be our root filesystem onto an overlay
16 (
17 LOG_LEVEL=5
0d6e798a
HH
18 eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
19
889a9042 20 setup_basic_environment
898720b7
HH
21
22 # setup the testsuite service
6b197f2a 23 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
898720b7
HH
24[Unit]
25Description=Testsuite service
26After=multi-user.target
27
28[Service]
ed119049 29ExecStart=/bin/sh -x -c 'systemctl --state=failed --no-legend --no-pager > /failed ; echo OK > /testok'
898720b7 30Type=oneshot
898720b7 31EOF
c90feab4 32
889a9042 33 setup_testsuite
cd949ee7 34 ) || return 1
889a9042 35 setup_nspawn_root
0d6e798a 36
6f9d3b08
DM
37 # mask some services that we do not want to run in these tests
38 ln -s /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
39 ln -s /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
40 ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.service
41 ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
42 ln -s /dev/null $initdir/etc/systemd/system/systemd-resolved.service
43
0d6e798a 44 ddebug "umount $TESTDIR/root"
d9890f4e 45 umount $TESTDIR/root
898720b7
HH
46}
47
898720b7 48do_test "$@"