From 2482f88d2af827ffd361c65e78e7a83450bff892 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 24 Nov 2017 22:56:44 +0100 Subject: [PATCH] tests: make "test-execute" work in "sudo ninja -C build test" (#7463) In this mode USER/LOGNAME still point to the original caller, and our tests get confused by that. Follow-up for: #7450 --- src/test/test-execute.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/test-execute.c b/src/test/test-execute.c index 14e23a32e9..626d3ac8b9 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -560,6 +560,9 @@ int main(int argc, char *argv[]) { log_parse_environment(); log_open(); + (void) unsetenv("USER"); + (void) unsetenv("LOGNAME"); + /* It is needed otherwise cgroup creation fails */ if (getuid() != 0) { puts("Skipping test: not root"); -- 2.25.1