]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - test/TEST-04-JOURNAL/test.sh
test: add function to reduce copied setup boilerplate
[thirdparty/systemd.git] / test / TEST-04-JOURNAL / test.sh
index a5ba7c84349813cb0aa6889e06847ffa79d01816..a18d21533ed05595b92f85c8eeaf8d2dcb9f7e3d 100755 (executable)
@@ -5,9 +5,7 @@ TEST_DESCRIPTION="Journal-related tests"
 . $TEST_BASE_DIR/test-functions
 
 test_setup() {
-    create_empty_image
-    mkdir -p $TESTDIR/root
-    mount ${LOOPDEV}p1 $TESTDIR/root
+    create_empty_image_rootdir
 
     # Create what will eventually be our root filesystem onto an overlay
     (
@@ -15,14 +13,7 @@ test_setup() {
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
 
         setup_basic_environment
-
-        # 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
+        mask_supporting_services
 
         # setup the testsuite service
         cat >$initdir/etc/systemd/system/testsuite.service <<EOF
@@ -48,9 +39,6 @@ EOF
         setup_testsuite
     )
     setup_nspawn_root
-
-    ddebug "umount $TESTDIR/root"
-    umount $TESTDIR/root
 }
 
 do_test "$@"