summaryrefslogtreecommitdiff
path: root/src/test/test-util.c
diff options
context:
space:
mode:
authorJan Synacek <jsynacek@redhat.com>2014-12-10 10:20:11 +0100
committerLennart Poettering <lennart@poettering.net>2014-12-10 13:36:10 +0100
commit0eb3cc88504b5d8f740764047ac5162b67992386 (patch)
tree541783ac0192d5022d88c0291042cf6f9a66afdb /src/test/test-util.c
parent536bfdab4cca38916ec8b112a6f80b0c068cc806 (diff)
test: fix some tests when running inside a container
Diffstat (limited to 'src/test/test-util.c')
-rw-r--r--src/test/test-util.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/test-util.c b/src/test/test-util.c
index 20e711d41..fe54586ee 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -35,6 +35,7 @@
#include "def.h"
#include "fileio.h"
#include "conf-parser.h"
+#include "virt.h"
static void test_streq_ptr(void) {
assert_se(streq_ptr(NULL, NULL));
@@ -544,7 +545,8 @@ static void test_get_process_comm(void) {
assert_se(r >= 0 || r == -EACCES);
log_info("self strlen(environ): '%zd'", strlen(env));
- assert_se(get_ctty_devnr(1, &h) == -ENOENT);
+ if (!detect_container(NULL))
+ assert_se(get_ctty_devnr(1, &h) == -ENOENT);
getenv_for_pid(1, "PATH", &i);
log_info("pid1 $PATH: '%s'", strna(i));