From: Yu Watanabe Date: Wed, 24 Sep 2025 15:46:35 +0000 (+0900) Subject: integration tests: do not adjust log level in the test script X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5c60d3011feac20dcc3c66fe2bcafa0a889e33d1;p=thirdparty%2Fsystemd.git integration tests: do not adjust log level in the test script We passes log level through kernel command line. It is not necessary to set to debug level at the beginning, and set to info at the end. This is important when a test has several subtests. If a subtest sets log level to info at the end, then subsequent tests may not generate any useful logs. --- diff --git a/test/units/TEST-07-PID1.poll-limit.sh b/test/units/TEST-07-PID1.poll-limit.sh index ca988b2321d..f7ccc3f8952 100755 --- a/test/units/TEST-07-PID1.poll-limit.sh +++ b/test/units/TEST-07-PID1.poll-limit.sh @@ -3,8 +3,6 @@ set -eux set -o pipefail -systemd-analyze log-level debug - cat >/run/systemd/system/floodme@.service </tmp/test19-exit-cgroup.sh < /tmp/test-extra-fd/1.txt echo "Extra" > /tmp/test-extra-fd/2.txt -systemd-analyze log-level debug - # Open files and assign FD to variables exec {TEST_FD1}/run/systemd/system/testservice-fail-59.service </run/systemd/system.conf.d/50-test-59-reload.conf </run/systemd/system/testservice-fail-restart-debug-59.service </run/systemd/journald.conf.d/99-ratelimit.conf < /tmp/copyme exec {lock}<&- timeout 30 bash -c 'until diff /tmp/copyme /tmp/copied >/dev/null; do sleep .2; done' -systemctl log-level info - touch /testok diff --git a/test/units/TEST-65-ANALYZE.sh b/test/units/TEST-65-ANALYZE.sh index 233b79951a1..e391b765a3e 100755 --- a/test/units/TEST-65-ANALYZE.sh +++ b/test/units/TEST-65-ANALYZE.sh @@ -6,7 +6,6 @@ set -eux # shellcheck source=test/units/util.sh . "$(dirname "$0")"/util.sh -systemctl log-level debug export SYSTEMD_LOG_LEVEL=debug # Sanity checks @@ -1147,6 +1146,4 @@ MAIN_PID=$(systemctl show -p MainPID --value "$UNIT_NAME") OUTPUT=$(systemd-analyze unit-shell "$UNIT_NAME" cat /tmp/testfile) assert_in "Hello from test unit" "$OUTPUT" -systemd-analyze log-level info - touch /testok diff --git a/test/units/TEST-66-DEVICE-ISOLATION.sh b/test/units/TEST-66-DEVICE-ISOLATION.sh index ccdfcb274c1..eb954e3bb5c 100755 --- a/test/units/TEST-66-DEVICE-ISOLATION.sh +++ b/test/units/TEST-66-DEVICE-ISOLATION.sh @@ -5,8 +5,6 @@ set -o pipefail RESULTS_FILE=/tmp/TEST-66-DEVICE-ISOLATION.serviceresults -systemd-analyze log-level debug - systemctl start TEST-66-DEVICE-ISOLATION-device-isolation.service sleep 5 @@ -19,6 +17,4 @@ systemctl stop TEST-66-DEVICE-ISOLATION-device-isolation.service grep -q "thisshouldnotbehere" "$RESULTS_FILE" && exit 42 -systemd-analyze log-level info - touch /testok diff --git a/test/units/TEST-68-PROPAGATE-EXIT-STATUS.sh b/test/units/TEST-68-PROPAGATE-EXIT-STATUS.sh index 70743b78df1..d8fa4a4cba9 100755 --- a/test/units/TEST-68-PROPAGATE-EXIT-STATUS.sh +++ b/test/units/TEST-68-PROPAGATE-EXIT-STATUS.sh @@ -14,7 +14,6 @@ wait_on_state_or_fail() { state=$(systemctl show "$service" --property=ActiveState --value) while [ "$state" != "$expected_state" ]; do if [ "$timeout" = "0" ]; then - systemd-analyze log-level info exit 1 fi timeout=$((timeout - 1)) @@ -23,8 +22,6 @@ wait_on_state_or_fail() { done } -systemd-analyze log-level debug - cat >/run/systemd/system/testservice-failure-68.service < /dev/null ; then exit 0 fi -systemd-analyze log-level debug - UNIT="test-sigqueue-$RANDOM.service" systemd-run -u "$UNIT" -p Type=notify -p DynamicUser=1 -- env --block-signal=SIGRTMIN+7 systemd-notify --exec --ready \; sleep infinity @@ -30,6 +28,4 @@ test "$(grep SigQ: /proc/"$P"/status | cut -d: -f2 | cut -d/ -f1)" -eq 6 systemctl stop $UNIT -systemd-analyze log-level info - touch /testok diff --git a/test/units/TEST-79-MEMPRESS.sh b/test/units/TEST-79-MEMPRESS.sh index 0cf5c37416e..06591609668 100755 --- a/test/units/TEST-79-MEMPRESS.sh +++ b/test/units/TEST-79-MEMPRESS.sh @@ -13,8 +13,6 @@ if ! cat /proc/pressure/memory >/dev/null ; then exit 0 fi -systemd-analyze log-level debug - CGROUP=/sys/fs/cgroup/"$(systemctl show TEST-79-MEMPRESS.service -P ControlGroup)" test -d "$CGROUP" @@ -63,6 +61,4 @@ systemd-run \ rm "$SCRIPT" -systemd-analyze log-level info - touch /testok diff --git a/test/units/TEST-80-NOTIFYACCESS.sh b/test/units/TEST-80-NOTIFYACCESS.sh index 355f6e7e307..a8ecd9fa709 100755 --- a/test/units/TEST-80-NOTIFYACCESS.sh +++ b/test/units/TEST-80-NOTIFYACCESS.sh @@ -98,8 +98,6 @@ systemd-analyze fdstore "$MYUNIT" --json=short | grep -P -q '\[{"fdname":"quux", systemctl stop "$MYUNIT" rm "$MYSCRIPT" -systemd-analyze log-level debug - # Test fdstore pinning (this will pull in fdstore-pin.service fdstore-nopin.service) systemctl start fdstore-pin.target diff --git a/test/units/TEST-82-SOFTREBOOT.sh b/test/units/TEST-82-SOFTREBOOT.sh index 9d6a93f8e8e..274e54a1178 100755 --- a/test/units/TEST-82-SOFTREBOOT.sh +++ b/test/units/TEST-82-SOFTREBOOT.sh @@ -71,8 +71,6 @@ check_device_property() { assert_eq "$count" "$expected_count" } -systemd-analyze log-level debug - export SYSTEMD_LOG_LEVEL=debug if [ -f /run/TEST-82-SOFTREBOOT.touch3 ]; then @@ -325,7 +323,5 @@ EOF exec sleep infinity fi -systemd-analyze log-level info - touch /testok systemctl --no-block exit 123 diff --git a/test/units/TEST-87-AUX-UTILS-VM.pstore.sh b/test/units/TEST-87-AUX-UTILS-VM.pstore.sh index 043d0238565..be5297fa52d 100755 --- a/test/units/TEST-87-AUX-UTILS-VM.pstore.sh +++ b/test/units/TEST-87-AUX-UTILS-VM.pstore.sh @@ -3,8 +3,6 @@ set -eux set -o pipefail -systemctl log-level info - (! systemd-detect-virt -cq) DUMMY_DMESG_0="$(mktemp)"