ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
8d419f
From da2408f522a4ea65b30fb86619dd3f11e1308ac4 Mon Sep 17 00:00:00 2001
8d419f
From: Frantisek Sumsal <frantisek@sumsal.cz>
8d419f
Date: Fri, 17 Jun 2022 15:06:59 +0200
8d419f
Subject: [PATCH] test: don't flush debug logs to the console
8d419f
8d419f
Let's keep the debug logs in the journal, while logging only
8d419f
testsute-*.sh stdout/stderr to the console (ba7abf7). This should make
8d419f
the test output log a bit more readable and potentially the tests itself
8d419f
a bit faster by avoiding console oversaturation.
8d419f
8d419f
Also, it should significantly reduce the size of artifacts kept by CIs.
8d419f
8d419f
(cherry picked from commit c84d1c9822bd181c37a5bd26b607edd67096839f)
8d419f
8d419f
Related: #2087652
8d419f
---
8d419f
 test/units/testsuite-20.sh | 1 -
8d419f
 test/units/testsuite-23.sh | 1 -
8d419f
 test/units/testsuite-27.sh | 1 -
8d419f
 test/units/testsuite-30.sh | 1 -
8d419f
 test/units/testsuite-32.sh | 1 -
8d419f
 test/units/testsuite-34.sh | 1 -
8d419f
 test/units/testsuite-38.sh | 1 -
8d419f
 test/units/testsuite-39.sh | 1 -
8d419f
 test/units/testsuite-40.sh | 1 -
8d419f
 test/units/testsuite-41.sh | 1 -
8d419f
 test/units/testsuite-46.sh | 1 -
8d419f
 test/units/testsuite-47.sh | 1 -
8d419f
 test/units/testsuite-52.sh | 1 -
8d419f
 test/units/testsuite-55.sh | 1 -
8d419f
 test/units/testsuite-59.sh | 1 -
8d419f
 test/units/testsuite-62.sh | 1 -
8d419f
 test/units/testsuite-66.sh | 1 -
8d419f
 17 files changed, 17 deletions(-)
8d419f
8d419f
diff --git a/test/units/testsuite-20.sh b/test/units/testsuite-20.sh
8d419f
index fc87c18c4c..338769aacc 100755
8d419f
--- a/test/units/testsuite-20.sh
8d419f
+++ b/test/units/testsuite-20.sh
8d419f
@@ -4,7 +4,6 @@ set -eux
8d419f
 set -o pipefail
8d419f
 
8d419f
 systemd-analyze log-level debug
8d419f
-systemd-analyze log-target console
8d419f
 
8d419f
 test "$(systemctl show -P MainPID testsuite-20.service)" -eq $$
8d419f
 
8d419f
diff --git a/test/units/testsuite-23.sh b/test/units/testsuite-23.sh
8d419f
index 46e45c8780..e8f99ff60d 100755
8d419f
--- a/test/units/testsuite-23.sh
8d419f
+++ b/test/units/testsuite-23.sh
8d419f
@@ -4,7 +4,6 @@ set -eux
8d419f
 set -o pipefail
8d419f
 
8d419f
 systemd-analyze log-level debug
8d419f
-systemd-analyze log-target console
8d419f
 
8d419f
 # Create a binary for which execve() will fail
8d419f
 touch /tmp/brokenbinary
8d419f
diff --git a/test/units/testsuite-27.sh b/test/units/testsuite-27.sh
8d419f
index 3b2f925153..c0701f35c3 100755
8d419f
--- a/test/units/testsuite-27.sh
8d419f
+++ b/test/units/testsuite-27.sh
8d419f
@@ -4,7 +4,6 @@ set -eux
8d419f
 set -o pipefail
8d419f
 
8d419f
 systemd-analyze log-level debug
8d419f
-systemd-analyze log-target console
8d419f
 
8d419f
 systemd-run --wait --unit=test27-one \
8d419f
             -p StandardOutput=file:/tmp/stdout \
8d419f
diff --git a/test/units/testsuite-30.sh b/test/units/testsuite-30.sh
8d419f
index 51b9bdd093..57f46669f9 100755
8d419f
--- a/test/units/testsuite-30.sh
8d419f
+++ b/test/units/testsuite-30.sh
8d419f
@@ -4,7 +4,6 @@ set -eux
8d419f
 set -o pipefail
8d419f
 
8d419f
 systemd-analyze log-level debug
8d419f
-systemd-analyze log-target console
8d419f
 
8d419f
 systemctl disable --now systemd-timesyncd.service
8d419f
 
8d419f
diff --git a/test/units/testsuite-32.sh b/test/units/testsuite-32.sh
8d419f
index 20ab67f6f1..5c289d0abf 100755
8d419f
--- a/test/units/testsuite-32.sh
8d419f
+++ b/test/units/testsuite-32.sh
8d419f
@@ -11,7 +11,6 @@ set -o pipefail
8d419f
 
8d419f
 if test -f /sys/fs/cgroup/system.slice/testsuite-32.service/memory.oom.group; then
8d419f
     systemd-analyze log-level debug
8d419f
-    systemd-analyze log-target console
8d419f
 
8d419f
     # Run a service that is guaranteed to be the first candidate for OOM killing
8d419f
     systemd-run --unit=oomtest.service \
8d419f
diff --git a/test/units/testsuite-34.sh b/test/units/testsuite-34.sh
8d419f
index 57a7b950a0..e6171beaa6 100755
8d419f
--- a/test/units/testsuite-34.sh
8d419f
+++ b/test/units/testsuite-34.sh
8d419f
@@ -4,7 +4,6 @@ set -eux
8d419f
 set -o pipefail
8d419f
 
8d419f
 systemd-analyze log-level debug
8d419f
-systemd-analyze log-target console
8d419f
 
8d419f
 function test_directory() {
8d419f
     local directory="$1"
8d419f
diff --git a/test/units/testsuite-38.sh b/test/units/testsuite-38.sh
8d419f
index f2f61b961f..438990d1c5 100755
8d419f
--- a/test/units/testsuite-38.sh
8d419f
+++ b/test/units/testsuite-38.sh
8d419f
@@ -5,7 +5,6 @@ set -eux
8d419f
 set -o pipefail
8d419f
 
8d419f
 systemd-analyze log-level debug
8d419f
-systemd-analyze log-target console
8d419f
 
8d419f
 unit=testsuite-38-sleep.service
8d419f
 
8d419f
diff --git a/test/units/testsuite-39.sh b/test/units/testsuite-39.sh
8d419f
index 03abf391f1..5b77bbbaf1 100755
8d419f
--- a/test/units/testsuite-39.sh
8d419f
+++ b/test/units/testsuite-39.sh
8d419f
@@ -4,7 +4,6 @@ set -eux
8d419f
 set -o pipefail
8d419f
 
8d419f
 systemd-analyze log-level debug
8d419f
-systemd-analyze log-target console
8d419f
 
8d419f
 export SYSTEMD_PAGER=
8d419f
 SERVICE_PATH="$(mktemp /etc/systemd/system/execreloadXXX.service)"
8d419f
diff --git a/test/units/testsuite-40.sh b/test/units/testsuite-40.sh
8d419f
index dd54fa174c..cec1fd3a7a 100755
8d419f
--- a/test/units/testsuite-40.sh
8d419f
+++ b/test/units/testsuite-40.sh
8d419f
@@ -4,7 +4,6 @@ set -eux
8d419f
 set -o pipefail
8d419f
 
8d419f
 systemd-analyze log-level debug
8d419f
-systemd-analyze log-target console
8d419f
 
8d419f
 declare -A property
8d419f
 
8d419f
diff --git a/test/units/testsuite-41.sh b/test/units/testsuite-41.sh
8d419f
index 3b41db03f5..13bc684c2d 100755
8d419f
--- a/test/units/testsuite-41.sh
8d419f
+++ b/test/units/testsuite-41.sh
8d419f
@@ -7,7 +7,6 @@ set -o pipefail
8d419f
 MAX_SECS=60
8d419f
 
8d419f
 systemd-analyze log-level debug
8d419f
-systemd-analyze log-target console
8d419f
 
8d419f
 # test one: Restart=on-failure should restart the service
8d419f
 systemd-run --unit=one -p Type=oneshot -p Restart=on-failure /bin/bash -c "exit 1" \
8d419f
diff --git a/test/units/testsuite-46.sh b/test/units/testsuite-46.sh
8d419f
index 3724a3b5f6..658613abb6 100755
8d419f
--- a/test/units/testsuite-46.sh
8d419f
+++ b/test/units/testsuite-46.sh
8d419f
@@ -34,7 +34,6 @@ wait_for_state() {
8d419f
 }
8d419f
 
8d419f
 systemd-analyze log-level debug
8d419f
-systemd-analyze log-target console
8d419f
 systemctl service-log-level systemd-homed debug
8d419f
 
8d419f
 # Create a tmpfs to use as backing store for the home dir. That way we can enforce a size limit nicely.
8d419f
diff --git a/test/units/testsuite-47.sh b/test/units/testsuite-47.sh
8d419f
index ff10602df7..529e9617a5 100755
8d419f
--- a/test/units/testsuite-47.sh
8d419f
+++ b/test/units/testsuite-47.sh
8d419f
@@ -4,7 +4,6 @@ set -eux
8d419f
 set -o pipefail
8d419f
 
8d419f
 systemd-analyze log-level debug
8d419f
-systemd-analyze log-target console
8d419f
 
8d419f
 systemctl start testsuite-47-repro
8d419f
 sleep 4
8d419f
diff --git a/test/units/testsuite-52.sh b/test/units/testsuite-52.sh
8d419f
index 8a76ff6ed6..d78fdd53ba 100755
8d419f
--- a/test/units/testsuite-52.sh
8d419f
+++ b/test/units/testsuite-52.sh
8d419f
@@ -4,7 +4,6 @@ set -ex
8d419f
 set -o pipefail
8d419f
 
8d419f
 systemd-analyze log-level debug
8d419f
-systemd-analyze log-target console
8d419f
 
8d419f
 systemctl enable test-honor-first-shutdown.service
8d419f
 systemctl start test-honor-first-shutdown.service
8d419f
diff --git a/test/units/testsuite-55.sh b/test/units/testsuite-55.sh
8d419f
index 379ea9e569..74dd285460 100755
8d419f
--- a/test/units/testsuite-55.sh
8d419f
+++ b/test/units/testsuite-55.sh
8d419f
@@ -4,7 +4,6 @@ set -eux
8d419f
 set -o pipefail
8d419f
 
8d419f
 systemd-analyze log-level debug
8d419f
-systemd-analyze log-target console
8d419f
 
8d419f
 # Loose checks to ensure the environment has the necessary features for systemd-oomd
8d419f
 [[ -e /proc/pressure ]] || echo "no PSI" >>/skipped
8d419f
diff --git a/test/units/testsuite-59.sh b/test/units/testsuite-59.sh
8d419f
index 143e44ec63..83db053107 100755
8d419f
--- a/test/units/testsuite-59.sh
8d419f
+++ b/test/units/testsuite-59.sh
8d419f
@@ -28,7 +28,6 @@ wait_on_state_or_fail () {
8d419f
 }
8d419f
 
8d419f
 systemd-analyze log-level debug
8d419f
-systemd-analyze log-target console
8d419f
 
8d419f
 
8d419f
 cat >/run/systemd/system/testservice-fail-59.service <
8d419f
diff --git a/test/units/testsuite-62.sh b/test/units/testsuite-62.sh
8d419f
index da40c2f1e7..04b79b7e77 100755
8d419f
--- a/test/units/testsuite-62.sh
8d419f
+++ b/test/units/testsuite-62.sh
8d419f
@@ -5,7 +5,6 @@ set -o pipefail
8d419f
 
8d419f
 setup() {
8d419f
     systemd-analyze log-level debug
8d419f
-    systemd-analyze log-target console
8d419f
 
8d419f
     for i in {0..3};
8d419f
     do
8d419f
diff --git a/test/units/testsuite-66.sh b/test/units/testsuite-66.sh
8d419f
index fba42d15df..7a88e5bcba 100755
8d419f
--- a/test/units/testsuite-66.sh
8d419f
+++ b/test/units/testsuite-66.sh
8d419f
@@ -6,7 +6,6 @@ set -o pipefail
8d419f
 RESULTS_FILE=/tmp/testsuite66serviceresults
8d419f
 
8d419f
 systemd-analyze log-level debug
8d419f
-systemd-analyze log-target console
8d419f
 
8d419f
 systemctl start testsuite-66-deviceisolation.service
8d419f