summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-11-17 20:57:22 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-11-17 20:57:22 -0500
commit347ebd02974ec4d2d7c4a6a388012a223b14583c (patch)
tree3833ec8f96ac395c1d7b7988644c332b6a009eaa /src/test
parent9a4550e2589bddb12cea93693b83211d805444e1 (diff)
test-process-util: bind mount fails under selinux, skip test
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-process-util.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/test/test-process-util.c b/src/test/test-process-util.c
index 9ada46b1e9..7242b2c8b5 100644
--- a/src/test/test-process-util.c
+++ b/src/test/test-process-util.c
@@ -193,7 +193,14 @@ static void test_get_process_cmdline_harder(void) {
fd = mkostemp(path, O_CLOEXEC);
assert_se(fd >= 0);
- assert_se(mount(path, "/proc/self/cmdline", "bind", MS_BIND, NULL) >= 0);
+
+ if (mount(path, "/proc/self/cmdline", "bind", MS_BIND, NULL) < 0) {
+ /* This happens under selinux… Abort the test in this case. */
+ log_warning_errno(errno, "mount(..., \"/proc/self/cmdline\", \"bind\", ...) failed: %m");
+ assert(errno == EACCES);
+ return;
+ }
+
assert_se(unlink(path) >= 0);
assert_se(prctl(PR_SET_NAME, "testa") >= 0);