]>
Commit | Line | Data |
---|---|---|
ff12a795 | 1 | #!/usr/bin/env bash |
818567fc | 2 | set -e |
898720b7 | 3 | TEST_DESCRIPTION="Basic systemd setup" |
9103671d | 4 | RUN_IN_UNPRIVILEGED_CONTAINER=${RUN_IN_UNPRIVILEGED_CONTAINER:-yes} |
898720b7 | 5 | |
fff87a35 | 6 | . $TEST_BASE_DIR/test-functions |
898720b7 | 7 | |
898720b7 | 8 | test_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] |
21 | Description=Testsuite service | |
22 | After=multi-user.target | |
23 | ||
24 | [Service] | |
d0533a31 | 25 | ExecStart=/bin/sh -e -x -c 'systemctl --state=failed --no-legend --no-pager > /failed ; systemctl daemon-reload ; echo OK > /testok' |
898720b7 | 26 | Type=oneshot |
898720b7 | 27 | EOF |
c90feab4 | 28 | |
889a9042 | 29 | setup_testsuite |
cc469c3d | 30 | ) |
889a9042 | 31 | setup_nspawn_root |
898720b7 HH |
32 | } |
33 | ||
898720b7 | 34 | do_test "$@" |