2020-03-04 10:35:06 +01:00
|
|
|
#!/usr/bin/env bash
|
2017-08-07 21:09:21 +02:00
|
|
|
set -e
|
2013-02-22 18:59:07 +01:00
|
|
|
TEST_DESCRIPTION="Job-related tests"
|
2018-06-05 21:30:19 +02:00
|
|
|
TEST_NO_QEMU=1
|
2013-01-25 20:10:00 +01:00
|
|
|
|
2013-04-23 02:39:40 +02:00
|
|
|
. $TEST_BASE_DIR/test-functions
|
2013-01-25 20:10:00 +01:00
|
|
|
|
|
|
|
test_setup() {
|
2019-07-12 17:47:26 +02:00
|
|
|
create_empty_image_rootdir
|
2013-01-25 20:10:00 +01:00
|
|
|
|
|
|
|
# Create what will eventually be our root filesystem onto an overlay
|
|
|
|
(
|
|
|
|
LOG_LEVEL=5
|
|
|
|
eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
|
|
|
|
|
2013-11-05 23:32:56 +01:00
|
|
|
setup_basic_environment
|
2019-10-08 09:10:12 +02:00
|
|
|
mask_supporting_services
|
2018-11-01 09:26:36 +01:00
|
|
|
|
2013-01-25 20:10:00 +01:00
|
|
|
# setup the testsuite service
|
|
|
|
cat >$initdir/etc/systemd/system/testsuite.service <<EOF
|
|
|
|
[Unit]
|
|
|
|
Description=Testsuite service
|
|
|
|
After=multi-user.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
ExecStart=/test-jobs.sh
|
|
|
|
Type=oneshot
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# copy the units used by this test
|
2013-02-22 18:59:07 +01:00
|
|
|
cp $TEST_BASE_DIR/{hello.service,sleep.service,hello-after-sleep.target,unstoppable.service} \
|
|
|
|
$initdir/etc/systemd/system
|
2013-01-25 20:10:00 +01:00
|
|
|
cp test-jobs.sh $initdir/
|
|
|
|
|
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
|
2013-01-25 20:10:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
do_test "$@"
|