Systemd/test/TEST-15-DROPIN/test.sh
Dan Streetman ec4cab49c9 test: add create_empty_image_rootdir() to simplify testcase setup
Almost all tests were manually mounting/unmounting $TESTDIR/root
from the loopback image; this moves all that into test-functions
so the test setup functions are simplier.

Also add test_setup_cleanup() function, to cleanup what is mounted
by create_empty_image_rootdir()
2019-07-16 18:05:15 -04:00

29 lines
926 B
Bash
Executable file

#!/bin/bash
set -e
TEST_DESCRIPTION="Dropin tests"
TEST_NO_QEMU=1
. $TEST_BASE_DIR/test-functions
test_setup() {
# create the basic filesystem layout
setup_basic_environment
# mask some services that we do not want to run in these tests
ln -s /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
ln -s /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.service
ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
ln -s /dev/null $initdir/etc/systemd/system/systemd-resolved.service
# import the test scripts in the rootfs and plug them in systemd
cp testsuite.service $initdir/etc/systemd/system/
cp test-dropin.sh $initdir/
setup_testsuite
# create dedicated rootfs for nspawn (located in $TESTDIR/nspawn-root)
setup_nspawn_root
}
do_test "$@"