594167
From fdd32f48af7993305f65989162dedd75a929966a Mon Sep 17 00:00:00 2001
594167
From: Evgeny Vereshchagin <evvers@ya.ru>
594167
Date: Tue, 15 Feb 2022 01:13:10 +0000
594167
Subject: [PATCH] tests: allow running all the services with SYSTEMD_LOG_LEVEL
594167
594167
It should make it easier to figure out what exactly services do there.
594167
For example, with SYSTEMD_LOG_LEVEL=debug userdbd (v249) prints
594167
```
594167
varlink-5: New incoming message: {"method":"io.systemd.UserDatabase.GetUserRecord","parameters":{}}
594167
```
594167
before it crashes and systemd-resolved prints
594167
```
594167
varlink-21: New incoming message: {"method":"io.systemd.Resolve.ResolveAddress","parameters":{"address":[127,0,0,1],"flags":0,"ifindex":1000000,"family":0}}
594167
```
594167
and those messages are helpful (especially when scripts causing them
594167
aren't clever enough to keep track of random stuff they send to systemd
594167
:-))
594167
594167
(cherry picked from commit bf6ef6b6a9156e5f52ee69ce0c529a246f103e54)
594167
594167
Related: #2017035
594167
---
594167
 test/test-functions | 3 +++
594167
 1 file changed, 3 insertions(+)
594167
594167
diff --git a/test/test-functions b/test/test-functions
594167
index dcc893733c..a299f5ff1f 100644
594167
--- a/test/test-functions
594167
+++ b/test/test-functions
594167
@@ -1142,6 +1142,9 @@ install_systemd() {
594167
 
594167
     # enable debug logging in PID1
594167
     echo LogLevel=debug >>"$initdir/etc/systemd/system.conf"
594167
+    if [[ -n "$TEST_SYSTEMD_LOG_LEVEL" ]]; then
594167
+        echo DefaultEnvironment=SYSTEMD_LOG_LEVEL="$TEST_SYSTEMD_LOG_LEVEL" >>"$initdir/etc/systemd/system.conf"
594167
+    fi
594167
     # store coredumps in journal
594167
     echo Storage=journal >>"$initdir/etc/systemd/coredump.conf"
594167
     # Propagate SYSTEMD_UNIT_PATH to user systemd managers