If we're not debugging tests, there's no point in persisting the journal,
so let's use the volatile journal storage mode in that case to avoid doing
unnecessary work.
We don't disable journal storage alltogether since various tests check
that stuff is written to the journal.
SYSTEMD_ENABLE_LOG_CONTEXT=yes
[Host]
+Credentials=journal.storage=persistent
@Incremental=yes
@RuntimeBuildSources=yes
@QemuSmp=2
+++ /dev/null
-# SPDX-License-Identifier: LGPL-2.1-or-later
-
-# We only ship /usr in the image so /var/log/journal won't exist on boot which means systemd-journald won't
-# persist any logs as the default Storage= setting is "auto". We can't create /var/log/journal using tmpfiles
-# as systemd-journal-flush.service runs before systemd-tmpfiles-setup.service so instead we explicitly set
-# Storage= to persistent to have systemd-journald create /var/log/journal itself.
-[Journal]
-Storage=persistent
f"SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/testsuite-{args.test_number}.units:/usr/lib/systemd/tests/testdata/units:",
f"systemd.unit={test_unit}",
]),
+ '--credential', f"journal.storage={'persistent' if sys.stderr.isatty() else 'runtime'}" ,
*args.mkosi_args,
'qemu',
*(['-no-reboot'] if not sys.stderr.isatty() else [])