]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: allow running all the services with SYSTEMD_LOG_LEVEL
authorEvgeny Vereshchagin <evvers@ya.ru>
Tue, 15 Feb 2022 01:13:10 +0000 (01:13 +0000)
committerEvgeny Vereshchagin <evvers@ya.ru>
Wed, 16 Feb 2022 04:50:51 +0000 (07:50 +0300)
It should make it easier to figure out what exactly services do there.
For example, with SYSTEMD_LOG_LEVEL=debug userdbd (v249) prints
```
varlink-5: New incoming message: {"method":"io.systemd.UserDatabase.GetUserRecord","parameters":{}}
```
before it crashes and systemd-resolved prints
```
varlink-21: New incoming message: {"method":"io.systemd.Resolve.ResolveAddress","parameters":{"address":[127,0,0,1],"flags":0,"ifindex":1000000,"family":0}}
```
and those messages are helpful (especially when scripts causing them
aren't clever enough to keep track of random stuff they send to systemd
:-))

test/test-functions

index dbd6371622a5ad79658c19e2b22bca389bae7adf..c8bf96d65a250e68a110202e76bdc46c53fe10d5 100644 (file)
@@ -1157,6 +1157,9 @@ install_systemd() {
 
     # enable debug logging in PID1
     echo LogLevel=debug >>"$initdir/etc/systemd/system.conf"
+    if [[ -n "$TEST_SYSTEMD_LOG_LEVEL" ]]; then
+        echo DefaultEnvironment=SYSTEMD_LOG_LEVEL="$TEST_SYSTEMD_LOG_LEVEL" >>"$initdir/etc/systemd/system.conf"
+    fi
     # store coredumps in journal
     echo Storage=journal >>"$initdir/etc/systemd/coredump.conf"
     # Propagate SYSTEMD_UNIT_PATH to user systemd managers