systemd/SOURCES/0248-test-don-t-flush-debug-logs-to-the-console.patch
2022-11-15 07:41:42 +00:00

240 lines
7.4 KiB
Diff

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