2013-01-25 20:10:00 +01:00
#!/bin/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-22 20:39:40 -04:00
. $TEST_BASE_DIR /test-functions
2013-01-25 20:10:00 +01:00
test_setup( ) {
2019-07-12 11:47:26 -04: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
2013-01-25 20:10:00 +01:00
2018-11-01 17:26:36 +09:00
# mask some services that we do not want to run in these tests
ln -fs /dev/null $initdir /etc/systemd/system/systemd-hwdb-update.service
ln -fs /dev/null $initdir /etc/systemd/system/systemd-journal-catalog-update.service
ln -fs /dev/null $initdir /etc/systemd/system/systemd-networkd.service
ln -fs /dev/null $initdir /etc/systemd/system/systemd-networkd.socket
ln -fs /dev/null $initdir /etc/systemd/system/systemd-resolved.service
ln -fs /dev/null $initdir /etc/systemd/system/systemd-machined.service
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
2018-06-06 10:16:42 +02:00
StandardOutput = tty
StandardError = tty
2013-01-25 20:10:00 +01:00
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 " $@ "