dcavalca / rpms / systemd

Forked from rpms/systemd 4 months ago
Clone
Brian Stinson 2593d8
From c748b95f5a00b6d9c46026c3d251c40437e6b64a Mon Sep 17 00:00:00 2001
Brian Stinson 2593d8
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Brian Stinson 2593d8
Date: Thu, 1 Nov 2018 17:26:36 +0900
Brian Stinson 2593d8
Subject: [PATCH] test: mask several unnecessary services
Brian Stinson 2593d8
Brian Stinson 2593d8
This may make CIs run faster.
Brian Stinson 2593d8
Brian Stinson 2593d8
(cherry picked from commit 056ae88152a722bdbea54ff33db815d585c8b9c6)
Brian Stinson 2593d8
Brian Stinson 2593d8
Related: #1761519
Brian Stinson 2593d8
---
Brian Stinson 2593d8
 test/TEST-02-CRYPTSETUP/test.sh    | 8 ++++++++
Brian Stinson 2593d8
 test/TEST-03-JOBS/test.sh          | 8 ++++++++
Brian Stinson 2593d8
 test/TEST-04-JOURNAL/test.sh       | 8 ++++++++
Brian Stinson 2593d8
 test/TEST-05-RLIMITS/test.sh       | 8 ++++++++
Brian Stinson 2593d8
 test/TEST-07-ISSUE-1981/test.sh    | 8 ++++++++
Brian Stinson 2593d8
 test/TEST-11-ISSUE-3166/test.sh    | 8 ++++++++
Brian Stinson 2593d8
 test/TEST-12-ISSUE-3171/test.sh    | 8 ++++++++
Brian Stinson 2593d8
 test/TEST-13-NSPAWN-SMOKE/test.sh  | 8 ++++++++
Brian Stinson 2593d8
 test/TEST-18-FAILUREACTION/test.sh | 7 +++++++
Brian Stinson 2593d8
 test/TEST-19-DELEGATE/test.sh      | 8 ++++++++
Brian Stinson 2593d8
 test/TEST-20-MAINPIDGAMES/test.sh  | 8 ++++++++
Brian Stinson 2593d8
 test/TEST-23-TYPE-EXEC/test.sh     | 8 ++++++++
Brian Stinson 2593d8
 12 files changed, 95 insertions(+)
Brian Stinson 2593d8
Brian Stinson 2593d8
diff --git a/test/TEST-02-CRYPTSETUP/test.sh b/test/TEST-02-CRYPTSETUP/test.sh
Brian Stinson 2593d8
index c38e56f72e..97eb2f409e 100755
Brian Stinson 2593d8
--- a/test/TEST-02-CRYPTSETUP/test.sh
Brian Stinson 2593d8
+++ b/test/TEST-02-CRYPTSETUP/test.sh
Brian Stinson 2593d8
@@ -45,6 +45,14 @@ test_setup() {
Brian Stinson 2593d8
 
Brian Stinson 2593d8
         setup_basic_environment
Brian Stinson 2593d8
 
Brian Stinson 2593d8
+        # mask some services that we do not want to run in these tests
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service
Brian Stinson 2593d8
+
Brian Stinson 2593d8
         # setup the testsuite service
Brian Stinson 2593d8
         cat >$initdir/etc/systemd/system/testsuite.service <
Brian Stinson 2593d8
 [Unit]
Brian Stinson 2593d8
diff --git a/test/TEST-03-JOBS/test.sh b/test/TEST-03-JOBS/test.sh
Brian Stinson 2593d8
index 08e5cfe6c8..93a387df59 100755
Brian Stinson 2593d8
--- a/test/TEST-03-JOBS/test.sh
Brian Stinson 2593d8
+++ b/test/TEST-03-JOBS/test.sh
Brian Stinson 2593d8
@@ -19,6 +19,14 @@ test_setup() {
Brian Stinson 2593d8
 
Brian Stinson 2593d8
         setup_basic_environment
Brian Stinson 2593d8
 
Brian Stinson 2593d8
+        # mask some services that we do not want to run in these tests
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service
Brian Stinson 2593d8
+
Brian Stinson 2593d8
         # setup the testsuite service
Brian Stinson 2593d8
         cat >$initdir/etc/systemd/system/testsuite.service <
Brian Stinson 2593d8
 [Unit]
Brian Stinson 2593d8
diff --git a/test/TEST-04-JOURNAL/test.sh b/test/TEST-04-JOURNAL/test.sh
Brian Stinson 2593d8
index 30e7b181b2..80e5fb0a73 100755
Brian Stinson 2593d8
--- a/test/TEST-04-JOURNAL/test.sh
Brian Stinson 2593d8
+++ b/test/TEST-04-JOURNAL/test.sh
Brian Stinson 2593d8
@@ -18,6 +18,14 @@ test_setup() {
Brian Stinson 2593d8
 
Brian Stinson 2593d8
         setup_basic_environment
Brian Stinson 2593d8
 
Brian Stinson 2593d8
+        # mask some services that we do not want to run in these tests
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service
Brian Stinson 2593d8
+
Brian Stinson 2593d8
         # setup the testsuite service
Brian Stinson 2593d8
         cat >$initdir/etc/systemd/system/testsuite.service <
Brian Stinson 2593d8
 [Unit]
Brian Stinson 2593d8
diff --git a/test/TEST-05-RLIMITS/test.sh b/test/TEST-05-RLIMITS/test.sh
Brian Stinson 2593d8
index a1b855c5fb..711f87f585 100755
Brian Stinson 2593d8
--- a/test/TEST-05-RLIMITS/test.sh
Brian Stinson 2593d8
+++ b/test/TEST-05-RLIMITS/test.sh
Brian Stinson 2593d8
@@ -18,6 +18,14 @@ test_setup() {
Brian Stinson 2593d8
 
Brian Stinson 2593d8
         setup_basic_environment
Brian Stinson 2593d8
 
Brian Stinson 2593d8
+        # mask some services that we do not want to run in these tests
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service
Brian Stinson 2593d8
+
Brian Stinson 2593d8
         cat >$initdir/etc/systemd/system.conf <
Brian Stinson 2593d8
 [Manager]
Brian Stinson 2593d8
 DefaultLimitNOFILE=10000:16384
Brian Stinson 2593d8
diff --git a/test/TEST-07-ISSUE-1981/test.sh b/test/TEST-07-ISSUE-1981/test.sh
Brian Stinson 2593d8
index 88d143e479..8d3ed04712 100755
Brian Stinson 2593d8
--- a/test/TEST-07-ISSUE-1981/test.sh
Brian Stinson 2593d8
+++ b/test/TEST-07-ISSUE-1981/test.sh
Brian Stinson 2593d8
@@ -21,6 +21,14 @@ test_setup() {
Brian Stinson 2593d8
 
Brian Stinson 2593d8
         setup_basic_environment
Brian Stinson 2593d8
 
Brian Stinson 2593d8
+        # mask some services that we do not want to run in these tests
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service
Brian Stinson 2593d8
+
Brian Stinson 2593d8
         # setup the testsuite service
Brian Stinson 2593d8
         cat >$initdir/etc/systemd/system/testsuite.service <
Brian Stinson 2593d8
 [Unit]
Brian Stinson 2593d8
diff --git a/test/TEST-11-ISSUE-3166/test.sh b/test/TEST-11-ISSUE-3166/test.sh
Brian Stinson 2593d8
index 8aae4d5ed9..e6e96101aa 100755
Brian Stinson 2593d8
--- a/test/TEST-11-ISSUE-3166/test.sh
Brian Stinson 2593d8
+++ b/test/TEST-11-ISSUE-3166/test.sh
Brian Stinson 2593d8
@@ -20,6 +20,14 @@ test_setup() {
Brian Stinson 2593d8
         setup_basic_environment
Brian Stinson 2593d8
         dracut_install false touch
Brian Stinson 2593d8
 
Brian Stinson 2593d8
+        # mask some services that we do not want to run in these tests
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service
Brian Stinson 2593d8
+
Brian Stinson 2593d8
         # setup the testsuite service
Brian Stinson 2593d8
         cat >$initdir/etc/systemd/system/testsuite.service <
Brian Stinson 2593d8
 [Unit]
Brian Stinson 2593d8
diff --git a/test/TEST-12-ISSUE-3171/test.sh b/test/TEST-12-ISSUE-3171/test.sh
Brian Stinson 2593d8
index 559fa469cd..915cc21cd8 100755
Brian Stinson 2593d8
--- a/test/TEST-12-ISSUE-3171/test.sh
Brian Stinson 2593d8
+++ b/test/TEST-12-ISSUE-3171/test.sh
Brian Stinson 2593d8
@@ -20,6 +20,14 @@ test_setup() {
Brian Stinson 2593d8
         setup_basic_environment
Brian Stinson 2593d8
         dracut_install cat mv stat nc
Brian Stinson 2593d8
 
Brian Stinson 2593d8
+        # mask some services that we do not want to run in these tests
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service
Brian Stinson 2593d8
+
Brian Stinson 2593d8
         # setup the testsuite service
Brian Stinson 2593d8
         cat >$initdir/etc/systemd/system/testsuite.service <
Brian Stinson 2593d8
 [Unit]
Brian Stinson 2593d8
diff --git a/test/TEST-13-NSPAWN-SMOKE/test.sh b/test/TEST-13-NSPAWN-SMOKE/test.sh
Brian Stinson 2593d8
index a676384bfc..cec59fa24d 100755
Brian Stinson 2593d8
--- a/test/TEST-13-NSPAWN-SMOKE/test.sh
Brian Stinson 2593d8
+++ b/test/TEST-13-NSPAWN-SMOKE/test.sh
Brian Stinson 2593d8
@@ -20,6 +20,14 @@ test_setup() {
Brian Stinson 2593d8
         setup_basic_environment
Brian Stinson 2593d8
         dracut_install busybox chmod rmdir unshare ip sysctl
Brian Stinson 2593d8
 
Brian Stinson 2593d8
+        # mask some services that we do not want to run in these tests
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service
Brian Stinson 2593d8
+
Brian Stinson 2593d8
         cp create-busybox-container $initdir/
Brian Stinson 2593d8
 
Brian Stinson 2593d8
         ./create-busybox-container $initdir/nc-container
Brian Stinson 2593d8
diff --git a/test/TEST-18-FAILUREACTION/test.sh b/test/TEST-18-FAILUREACTION/test.sh
Brian Stinson 2593d8
index e48ba9bac3..783b3aac6e 100755
Brian Stinson 2593d8
--- a/test/TEST-18-FAILUREACTION/test.sh
Brian Stinson 2593d8
+++ b/test/TEST-18-FAILUREACTION/test.sh
Brian Stinson 2593d8
@@ -35,6 +35,13 @@ EOF
Brian Stinson 2593d8
     ) || return 1
Brian Stinson 2593d8
     setup_nspawn_root
Brian Stinson 2593d8
 
Brian Stinson 2593d8
+    # mask some services that we do not want to run in these tests
Brian Stinson 2593d8
+    ln -s /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
Brian Stinson 2593d8
+    ln -s /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
Brian Stinson 2593d8
+    ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.service
Brian Stinson 2593d8
+    ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
Brian Stinson 2593d8
+    ln -s /dev/null $initdir/etc/systemd/system/systemd-resolved.service
Brian Stinson 2593d8
+
Brian Stinson 2593d8
     ddebug "umount $TESTDIR/root"
Brian Stinson 2593d8
     umount $TESTDIR/root
Brian Stinson 2593d8
 }
Brian Stinson 2593d8
diff --git a/test/TEST-19-DELEGATE/test.sh b/test/TEST-19-DELEGATE/test.sh
Brian Stinson 2593d8
index 841a29c06f..ef1d99932a 100755
Brian Stinson 2593d8
--- a/test/TEST-19-DELEGATE/test.sh
Brian Stinson 2593d8
+++ b/test/TEST-19-DELEGATE/test.sh
Brian Stinson 2593d8
@@ -20,6 +20,14 @@ test_setup() {
Brian Stinson 2593d8
 
Brian Stinson 2593d8
         setup_basic_environment
Brian Stinson 2593d8
 
Brian Stinson 2593d8
+        # mask some services that we do not want to run in these tests
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service
Brian Stinson 2593d8
+
Brian Stinson 2593d8
         # setup the testsuite service
Brian Stinson 2593d8
         cat >$initdir/etc/systemd/system/testsuite.service <
Brian Stinson 2593d8
 [Unit]
Brian Stinson 2593d8
diff --git a/test/TEST-20-MAINPIDGAMES/test.sh b/test/TEST-20-MAINPIDGAMES/test.sh
Brian Stinson 2593d8
index b14083a256..4ec8081478 100755
Brian Stinson 2593d8
--- a/test/TEST-20-MAINPIDGAMES/test.sh
Brian Stinson 2593d8
+++ b/test/TEST-20-MAINPIDGAMES/test.sh
Brian Stinson 2593d8
@@ -17,6 +17,14 @@ test_setup() {
Brian Stinson 2593d8
 
Brian Stinson 2593d8
         setup_basic_environment
Brian Stinson 2593d8
 
Brian Stinson 2593d8
+        # mask some services that we do not want to run in these tests
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service
Brian Stinson 2593d8
+
Brian Stinson 2593d8
         # setup the testsuite service
Brian Stinson 2593d8
         cat >$initdir/etc/systemd/system/testsuite.service <
Brian Stinson 2593d8
 [Unit]
Brian Stinson 2593d8
diff --git a/test/TEST-23-TYPE-EXEC/test.sh b/test/TEST-23-TYPE-EXEC/test.sh
Brian Stinson 2593d8
index bdcea239a7..2e76451f5b 100755
Brian Stinson 2593d8
--- a/test/TEST-23-TYPE-EXEC/test.sh
Brian Stinson 2593d8
+++ b/test/TEST-23-TYPE-EXEC/test.sh
Brian Stinson 2593d8
@@ -17,6 +17,14 @@ test_setup() {
Brian Stinson 2593d8
 
Brian Stinson 2593d8
         setup_basic_environment
Brian Stinson 2593d8
 
Brian Stinson 2593d8
+        # mask some services that we do not want to run in these tests
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
Brian Stinson 2593d8
+        ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service
Brian Stinson 2593d8
+
Brian Stinson 2593d8
         # setup the testsuite service
Brian Stinson 2593d8
         cat >$initdir/etc/systemd/system/testsuite.service <
Brian Stinson 2593d8
 [Unit]