From: Lennart Poettering Date: Fri, 24 Nov 2017 21:56:44 +0000 (+0100) Subject: tests: make "test-execute" work in "sudo ninja -C build test" (#7463) X-Git-Tag: v236~118 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2482f88d2af827ffd361c65e78e7a83450bff892;p=thirdparty%2Fsystemd.git 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 --- diff --git a/src/test/test-execute.c b/src/test/test-execute.c index 14e23a32e92..626d3ac8b90 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");