mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
tests: Skip namespace-related tests when that feature is missing.
* tests/syscalls.scm ("clone", "setns", "pivot-root"): Skip unless (user-namespace (getpid)) exists.
This commit is contained in:
parent
6c413c92f2
commit
b62a3ebcdd
1 changed files with 6 additions and 0 deletions
|
@ -80,6 +80,8 @@ (define-module (test-syscalls)
|
||||||
(define (user-namespace pid)
|
(define (user-namespace pid)
|
||||||
(string-append "/proc/" (number->string pid) "/ns/user"))
|
(string-append "/proc/" (number->string pid) "/ns/user"))
|
||||||
|
|
||||||
|
(unless (file-exists? (user-namespace (getpid)))
|
||||||
|
(test-skip 1))
|
||||||
(test-assert "clone"
|
(test-assert "clone"
|
||||||
(match (clone (logior CLONE_NEWUSER SIGCHLD))
|
(match (clone (logior CLONE_NEWUSER SIGCHLD))
|
||||||
(0 (primitive-exit 42))
|
(0 (primitive-exit 42))
|
||||||
|
@ -91,6 +93,8 @@ (define (user-namespace pid)
|
||||||
((_ . status)
|
((_ . status)
|
||||||
(= 42 (status:exit-val status))))))))
|
(= 42 (status:exit-val status))))))))
|
||||||
|
|
||||||
|
(unless (file-exists? (user-namespace (getpid)))
|
||||||
|
(test-skip 1))
|
||||||
(test-assert "setns"
|
(test-assert "setns"
|
||||||
(match (clone (logior CLONE_NEWUSER SIGCHLD))
|
(match (clone (logior CLONE_NEWUSER SIGCHLD))
|
||||||
(0 (primitive-exit 0))
|
(0 (primitive-exit 0))
|
||||||
|
@ -118,6 +122,8 @@ (define (user-namespace pid)
|
||||||
(waitpid fork-pid)
|
(waitpid fork-pid)
|
||||||
result))))))))
|
result))))))))
|
||||||
|
|
||||||
|
(unless (file-exists? (user-namespace (getpid)))
|
||||||
|
(test-skip 1))
|
||||||
(test-assert "pivot-root"
|
(test-assert "pivot-root"
|
||||||
(match (pipe)
|
(match (pipe)
|
||||||
((in . out)
|
((in . out)
|
||||||
|
|
Loading…
Reference in a new issue