2020-03-04 10:35:06 +01:00
|
|
|
#!/usr/bin/env bash
|
2017-08-07 21:09:21 +02:00
|
|
|
set -e
|
2012-05-21 18:55:48 +02:00
|
|
|
TEST_DESCRIPTION="Basic systemd setup"
|
2018-12-23 14:28:01 +01:00
|
|
|
RUN_IN_UNPRIVILEGED_CONTAINER=${RUN_IN_UNPRIVILEGED_CONTAINER:-yes}
|
2012-05-21 18:55:48 +02:00
|
|
|
|
2013-04-23 02:39:40 +02:00
|
|
|
. $TEST_BASE_DIR/test-functions
|
2012-05-21 18:55:48 +02:00
|
|
|
|
|
|
|
test_setup() {
|
2019-07-12 17:47:26 +02:00
|
|
|
create_empty_image_rootdir
|
2012-05-21 18:55:48 +02:00
|
|
|
|
|
|
|
# Create what will eventually be our root filesystem onto an overlay
|
|
|
|
(
|
|
|
|
LOG_LEVEL=5
|
2012-05-25 18:32:55 +02:00
|
|
|
eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
|
|
|
|
|
2013-11-05 23:32:56 +01:00
|
|
|
setup_basic_environment
|
2012-05-21 18:55:48 +02:00
|
|
|
|
|
|
|
# setup the testsuite service
|
2012-05-24 15:27:53 +02:00
|
|
|
cat >$initdir/etc/systemd/system/testsuite.service <<EOF
|
2012-05-21 18:55:48 +02:00
|
|
|
[Unit]
|
|
|
|
Description=Testsuite service
|
|
|
|
After=multi-user.target
|
|
|
|
|
|
|
|
[Service]
|
2019-05-27 19:59:26 +02:00
|
|
|
ExecStart=/bin/sh -e -x -c 'systemctl --state=failed --no-legend --no-pager > /failed ; systemctl daemon-reload ; echo OK > /testok'
|
2012-05-21 18:55:48 +02:00
|
|
|
Type=oneshot
|
|
|
|
EOF
|
2013-01-25 22:19:19 +01:00
|
|
|
|
2013-11-05 23:32:56 +01:00
|
|
|
setup_testsuite
|
2019-07-08 21:11:32 +02:00
|
|
|
)
|
2013-11-05 23:32:56 +01:00
|
|
|
setup_nspawn_root
|
2012-05-21 18:55:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
do_test "$@"
|