]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: add function to reduce copied setup boilerplate
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 8 Oct 2019 07:10:12 +0000 (09:10 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 8 Oct 2019 07:10:12 +0000 (09:10 +0200)
Many tests were also masking systemd-machined.service. But machined
should only start when activated, so having it not masked shouldn't be
noticable. TEST-25-IMPORT needs it.

34 files changed:
test/TEST-02-CRYPTSETUP/test.sh
test/TEST-03-JOBS/test.sh
test/TEST-04-JOURNAL/test.sh
test/TEST-05-RLIMITS/test.sh
test/TEST-06-SELINUX/test.sh
test/TEST-07-ISSUE-1981/test.sh
test/TEST-08-ISSUE-2730/test.sh
test/TEST-09-ISSUE-2691/test.sh
test/TEST-10-ISSUE-2467/test.sh
test/TEST-11-ISSUE-3166/test.sh
test/TEST-12-ISSUE-3171/test.sh
test/TEST-13-NSPAWN-SMOKE/test.sh
test/TEST-14-MACHINE-ID/test.sh
test/TEST-15-DROPIN/test.sh
test/TEST-16-EXTEND-TIMEOUT/test.sh
test/TEST-17-UDEV-WANTS/test.sh
test/TEST-18-FAILUREACTION/test.sh
test/TEST-19-DELEGATE/test.sh
test/TEST-20-MAINPIDGAMES/test.sh
test/TEST-22-TMPFILES/test.sh
test/TEST-23-TYPE-EXEC/test.sh
test/TEST-27-STDOUTFILE/test.sh
test/TEST-28-PERCENTJ-WANTEDBY/test.sh
test/TEST-29-UDEV-ID_RENAMING/test.sh
test/TEST-30-ONCLOCKCHANGE/test.sh
test/TEST-31-DEVICE-ENUMERATION/test.sh
test/TEST-32-OOMPOLICY/test.sh
test/TEST-33-CLEAN-UNIT/test.sh
test/TEST-34-DYNAMICUSERMIGRATE/test.sh
test/TEST-36-NUMAPOLICY/test.sh
test/TEST-37-RUNTIMEDIRECTORYPRESERVE/test.sh
test/TEST-39-EXECRELOAD/test.sh
test/TEST-40-EXEC-COMMAND-EX/test.sh
test/test-functions

index 801dc715691f8826451c30bd094bd1909459fe62..a7563f446206a54b86455713569739c5d2224494 100755 (executable)
@@ -40,14 +40,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
index 3359ee68400f994426ae4cda4069b15b49e4ee69..50b7bce3ed910a35f5b95aea59093d4e9224e0da 100755 (executable)
@@ -14,14 +14,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
index cabc71f4ff208f5451ab25ae30f4c97bf1ed678f..a18d21533ed05595b92f85c8eeaf8d2dcb9f7e3d 100755 (executable)
@@ -13,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
index 159c1e0ea84ad7c9990fd964690f3916a29e950a..87fb89e781c11c55981acd65bb6af37d50651cb7 100755 (executable)
@@ -13,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
 
         cat >$initdir/etc/systemd/system.conf <<EOF
 [Manager]
index 2e983f787985b8f078fe93d9b6b4b1cd75b4e634..646dfe024a3be2b58d2fa26d5653b9cedbfabac2 100755 (executable)
@@ -24,6 +24,7 @@ test_setup() {
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
 
         setup_basic_environment
+        mask_supporting_services
 
         # setup the testsuite service
         cat <<EOF >$initdir/etc/systemd/system/testsuite.service
@@ -91,13 +92,6 @@ EOF
         dracut_install runcon
         dracut_install checkmodule semodule semodule_package m4 make /usr/libexec/selinux/hll/pp load_policy sefcontext_compile
     )
-
-    # 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
 }
 
 do_test "$@"
index 2e4f67c5fe54955583cd7030541a1d90a5546482..199b4f85a8896cdfcb64fb2eecf324bf1748ee74 100755 (executable)
@@ -16,14 +16,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
index 8643842e8104a11d2f2aabcdafe31e8594689a0e..a9e6ffa79df1cad0e16725cfa430593105f2a62b 100755 (executable)
@@ -64,12 +64,7 @@ EOF
     mkdir -p $initdir/etc/systemd/system/local-fs.target.wants
     ln -s /etc/systemd/system/-.mount $initdir/etc/systemd/system/local-fs.target.wants/-.mount
 
-    # 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
+    mask_supporting_services
 }
 
 do_test "$@"
index 1a8b9006724f028bd6dcee807f3a4a75676acd36..ca3e69d2caa125c5ad08d8d269c5ecf91c0816ee 100755 (executable)
@@ -15,6 +15,7 @@ test_setup() {
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
 
         setup_basic_environment
+        mask_supporting_services
 
         # setup the testsuite service
         cat >$initdir/etc/systemd/system/testsuite.service <<'EOF'
@@ -31,13 +32,6 @@ EOF
 
         setup_testsuite
     )
-
-    # 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
 }
 
 do_test "$@"
index 80b2fd923f932c72cf499b5478fad51ee245434f..7bb256963008982e6e4a879d1bf73693f36a359b 100755 (executable)
@@ -13,6 +13,7 @@ test_setup() {
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
 
         setup_basic_environment
+        mask_supporting_services
         dracut_install true rm socat
 
         # setup the testsuite service
@@ -42,13 +43,6 @@ EOF
         setup_testsuite
     )
     setup_nspawn_root
-
-    # 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
 }
 
 do_test "$@"
index c50efb8c9b174c06c8613c62344dc75dd1beb9f9..81c12a2783c1e4be7feebde7db18f47a1925c504 100755 (executable)
@@ -14,16 +14,9 @@ test_setup() {
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
 
         setup_basic_environment
+        mask_supporting_services
         dracut_install false touch
 
-        # 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
-
         # setup the testsuite service
         cat >$initdir/etc/systemd/system/testsuite.service <<EOF
 [Unit]
index 5b1c3aa3130b4327d198bb8603b55dc4bbfae6de..d9a0e1a3ddcbdf0eff4bd5fd4d0d3fde16756f96 100755 (executable)
@@ -14,16 +14,9 @@ test_setup() {
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
 
         setup_basic_environment
+        mask_supporting_services
         dracut_install cat mv stat nc
 
-        # 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
-
         # setup the testsuite service
         cat >$initdir/etc/systemd/system/testsuite.service <<EOF
 [Unit]
index 4f14bf12e334a8a1f69772aa996d46e42d3dc21f..747d30d952f6eef77f75717505282a1abeaef8b6 100755 (executable)
@@ -14,16 +14,9 @@ test_setup() {
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
 
         setup_basic_environment
+        mask_supporting_services
         dracut_install busybox chmod rmdir unshare ip sysctl
 
-        # 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
-
         cp create-busybox-container $initdir/
 
         ./create-busybox-container $initdir/nc-container
index e52377c79d4d137bc2b9af82b109059379afb0c5..72d7eacbf6f1dd41bc9a8815ea170b30ccfaf66c 100755 (executable)
@@ -14,6 +14,7 @@ test_setup() {
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
 
         setup_basic_environment
+        mask_supporting_services
         printf "556f48e837bc4424a710fa2e2c9d3e3c\ne3d\n" >$initdir/etc/machine-id
         dracut_install mount cmp
 
@@ -72,13 +73,6 @@ chmod +x $initdir/test-machine-id-setup.sh
 
         setup_testsuite
     )
-
-    # 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
 }
 
 do_test "$@"
index 9d5ea138b90df078268115e239767cef8ba657d3..a1d0c618d9544f7a0c567ed889c8406f82e3330c 100755 (executable)
@@ -8,13 +8,7 @@ TEST_NO_QEMU=1
 test_setup() {
     # create the basic filesystem layout
     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
+    mask_supporting_services
 
     # import the test scripts in the rootfs and plug them in systemd
     cp testsuite.service $initdir/etc/systemd/system/
index 368c9e63ca3620db0e85ed56e077e101fdb6c637..c5f8af6ec6124f9b58e93ff2a07c11c09f3aab93 100755 (executable)
@@ -14,6 +14,7 @@ test_setup() {
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
 
         setup_basic_environment
+        mask_supporting_services
 
         for s in success-all success-start success-stop success-runtime \
                  fail-start fail-stop fail-runtime
@@ -27,12 +28,6 @@ test_setup() {
 
         setup_testsuite
     )
-    # 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
 
     setup_nspawn_root
 }
index 36032348b89204124e5105bd5493c1e18918cbbe..1cdbbd2d8a0140738f940527e8faa1fdfa7849b2 100755 (executable)
@@ -14,13 +14,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
+        mask_supporting_services
 
         # setup the testsuite service
         cat >$initdir/etc/systemd/system/testsuite.service <<EOF
index 18b0be82e8e1f1fa24ffd24aafaf23cc6ac3e361..e9f6ee7afe5fd624df1eb4e1dc430559b92cddef 100755 (executable)
@@ -13,6 +13,7 @@ test_setup() {
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
 
         setup_basic_environment
+        mask_supporting_services
 
         # setup the testsuite service
         cat >$initdir/etc/systemd/system/testsuite.service <<EOF
@@ -27,14 +28,8 @@ EOF
 
         setup_testsuite
     )
-    setup_nspawn_root
 
-    # 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
+    setup_nspawn_root
 }
 
 do_test "$@"
index bdd6562a3370c2fbe3c9d4b4d756739b14a58848..706f0e9fbb4457d0c613cb5d9175810c114f354b 100755 (executable)
@@ -15,14 +15,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
index 0f6aef745366ce3b179e66852b7cd6b9f1fd7d2d..0ba30bdb00517a0e38397bdab282edbd95a60b8b 100755 (executable)
@@ -12,14 +12,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
@@ -35,6 +28,7 @@ EOF
 
         setup_testsuite
     )
+
     setup_nspawn_root
 }
 
index 5c509f63fb8adb9ec3d349f264585df70ddfa044..32c3abdeab335f83804c662bf4e51d5e1586638c 100755 (executable)
@@ -8,6 +8,7 @@ TEST_NO_QEMU=1
 test_setup() {
     # create the basic filesystem layout
     setup_basic_environment
+    mask_supporting_services
     inst_binary mv
     inst_binary stat
     inst_binary seq
@@ -15,14 +16,6 @@ test_setup() {
     inst_binary mkfifo
     inst_binary readlink
 
-    # 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
-
     # setup the testsuite service
     cp testsuite.service $initdir/etc/systemd/system/
     setup_testsuite
index 2b10b9ad7033349d5b545578f78bccd55f7aea06..127d39319a5ab0c28eb612eadbccddeb4eb55bfc 100755 (executable)
@@ -12,14 +12,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
index a796dcd79e4fdf2abed562522a9c1a103b405867..c8338736bb05f402e607580b79d5a393c2d74bfd 100755 (executable)
@@ -11,17 +11,9 @@ test_setup() {
         LOG_LEVEL=5
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
 
-        inst_binary cmp
-
         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
+        inst_binary cmp
 
         # setup the testsuite service
         cat >$initdir/etc/systemd/system/testsuite.service <<EOF
index 1fb9825bf8e61ef1f1e3e3cff9c11b8e198042ec..3427ba7a91de2306308d53311b8c626159ddad99 100755 (executable)
@@ -14,6 +14,7 @@ test_setup() {
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
 
         setup_basic_environment
+        mask_supporting_services
 
         # Set up the services.
         cat >$initdir/etc/systemd/system/specifier-j-wants.service << EOF
@@ -48,14 +49,8 @@ EOF
 
         setup_testsuite
     )
-    setup_nspawn_root
 
-        # 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
+    setup_nspawn_root
 }
 
 do_test "$@"
index 2a483bbc3ddba457a5eda345c7678174134be85b..7d173c8422ae8f7f9b9db080d24fdf1b2ca19ea9 100755 (executable)
@@ -14,13 +14,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
+        mask_supporting_services
 
         # setup the testsuite service
         cat >$initdir/etc/systemd/system/testsuite.service <<EOF
index 67e074af4c802f24377ca53c329d111169bfc0a2..8976e9530835badadb06cdee75d759200b28f56c 100755 (executable)
@@ -16,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
index 855ec42266c8359677e82ab6fa48cc97328437be..e88e0c367a656314632194fab06e45146b51d33c 100755 (executable)
@@ -14,13 +14,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
+        mask_supporting_services
 
         # setup the testsuite service
         cat >$initdir/etc/systemd/system/testsuite.service <<EOF
index 4578916762d2cad2095e49ef218d85c4b45468ca..1726b21fc3bf0dc9c58ddd3a43315d327d1367d6 100755 (executable)
@@ -15,14 +15,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
index 90dd495c0a5208a2c3e2b8db67ffe4065043f979..b3316bdc2673ed5da2721ff366903164873c4b00 100755 (executable)
@@ -14,14 +14,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
index 0bff59fcb7fb1fa778dcd2906e695126d8860e22..c7c1b29d8613e3b3469352268b8d6b713a0345ac 100755 (executable)
@@ -12,14 +12,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
index 14cbe5f3860af6b96cc15f6c1bf929be25cad34f..e4c0e45ebe0d6d593458ee22af23859d2c92e763 100755 (executable)
@@ -15,16 +15,9 @@ test_setup() {
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
 
         setup_basic_environment
+        mask_supporting_services
         dracut_install mktemp
 
-        # 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
-
         # setup the testsuite service
         cat >$initdir/etc/systemd/system/testsuite.service <<EOF
 [Unit]
index b7a3ab8ce498627c3ab9d3b580e2717375073f84..ffe0ee9499f7fdbb47001ee208b77770a6bda2e2 100755 (executable)
@@ -14,14 +14,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
index e6bb7baedfd3f204a2666b5d2949ac186866d4ec..d2b1663aa3c47e61705db1c5819bf8969cf5ea80 100755 (executable)
@@ -13,16 +13,9 @@ test_setup() {
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
 
         setup_basic_environment
+        mask_supporting_services
         dracut_install mktemp
 
-        # 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
-
         # setup the testsuite service
         cat >$initdir/etc/systemd/system/testsuite.service <<EOF
 [Unit]
index 4e73fbaee933de730125efa0de35b870ba783c07..01d725eb5e9bd5da7e43f288934414aeef705d90 100755 (executable)
@@ -12,14 +12,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
index 359fd4026e460b68c855e5fe53f370701824a5ed..3afc3241106ef8491e83d1f80586722d80d9024d 100644 (file)
@@ -913,6 +913,15 @@ setup_basic_dirs() {
     ln -sfn /run/lock "$initdir/var/lock"
 }
 
+mask_supporting_services() {
+    # 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
+}
+
 inst_libs() {
     local _bin=$1
     local _so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)'