]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - test/TEST-30-ONCLOCKCHANGE/test.sh
test: add function to reduce copied setup boilerplate
[thirdparty/systemd.git] / test / TEST-30-ONCLOCKCHANGE / test.sh
index 47f1fff1d3d1cec6f6f071ffe4a1a8bc86a50868..8976e9530835badadb06cdee75d759200b28f56c 100755 (executable)
@@ -6,9 +6,7 @@ TEST_NO_NSPAWN=1
 . $TEST_BASE_DIR/test-functions
 
 test_setup() {
-    create_empty_image
-    mkdir -p $TESTDIR/root
-    mount ${LOOPDEV}p1 $TESTDIR/root
+    create_empty_image_rootdir
 
     (
         LOG_LEVEL=5
@@ -18,14 +16,7 @@ test_setup() {
         inst_any /usr/share/zoneinfo/Europe/Berlin
 
         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
 
         # extend the watchdog
         mkdir -p $initdir/etc/systemd/system/systemd-timedated.service.d
@@ -42,17 +33,11 @@ Description=Testsuite service
 [Service]
 ExecStart=/testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
-NotifyAccess=all
 EOF
         cp testsuite.sh $initdir/
 
         setup_testsuite
     )
-
-    ddebug "umount $TESTDIR/root"
-    umount $TESTDIR/root
 }
 
 do_test "$@"