test: Don't allocate scope if already running in unit with delegated cgroup

If we're already running in a unit with delegation turned on, let's
skip allocation of a scope unit and cgroup subroot. This allows journald
to correctly attribute the logs of all subprocesses spawned by tests such
as test-execute to the test-execute service when the test is running in a service.
This commit is contained in:
Daan De Meyer
2024-04-22 09:42:29 +02:00
parent b8c6c35804
commit 7a7d7a2e22
3 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -256,7 +256,7 @@ fail:
return r;
}
static bool stderr_is_journal(void) {
bool stderr_is_journal(void) {
_cleanup_free_ char *w = NULL;
const char *e;
uint64_t dev, ino;