summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-07-10 23:36:26 +0200
committerLudovic Courtès <ludo@gnu.org>2015-07-10 23:46:52 +0200
commitb62a3ebcdd2ffdd48462096ff84c96493776d5c3 (patch)
tree3e41811acfb9106d85baf0970f52b76f1562f7cc
parent6c413c92f2da6e564bfe2dcf4b359192f21faed9 (diff)
downloadguix-b62a3ebcdd2ffdd48462096ff84c96493776d5c3.tar.gz
guix-b62a3ebcdd2ffdd48462096ff84c96493776d5c3.tar.xz
tests: Skip namespace-related tests when that feature is missing.
* tests/syscalls.scm ("clone", "setns", "pivot-root"): Skip unless (user-namespace (getpid)) exists.
-rw-r--r--tests/syscalls.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index 8598f747f1..6b614a5211 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -80,6 +80,8 @@
(define (user-namespace pid)
(string-append "/proc/" (number->string pid) "/ns/user"))
+(unless (file-exists? (user-namespace (getpid)))
+ (test-skip 1))
(test-assert "clone"
(match (clone (logior CLONE_NEWUSER SIGCHLD))
(0 (primitive-exit 42))
@@ -91,6 +93,8 @@
((_ . status)
(= 42 (status:exit-val status))))))))
+(unless (file-exists? (user-namespace (getpid)))
+ (test-skip 1))
(test-assert "setns"
(match (clone (logior CLONE_NEWUSER SIGCHLD))
(0 (primitive-exit 0))
@@ -118,6 +122,8 @@
(waitpid fork-pid)
result))))))))
+(unless (file-exists? (user-namespace (getpid)))
+ (test-skip 1))
(test-assert "pivot-root"
(match (pipe)
((in . out)