diff options
author | Mark H Weaver <mhw@netris.org> | 2016-10-19 10:54:36 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2016-10-19 10:54:36 -0400 |
commit | d2478b4cdd6f1db44f4725b39489aca89d3d9180 (patch) | |
tree | bc4714453fd9b7a2e64fcd5f58c24d371dbb91d8 /tests/syscalls.scm | |
parent | c9a71c6fdab6914dd648b76c349c3af9018cad35 (diff) | |
parent | 152ffe7cb6ba02915d8645102e0f6dfeb639090d (diff) | |
download | gnu-guix-d2478b4cdd6f1db44f4725b39489aca89d3d9180.tar gnu-guix-d2478b4cdd6f1db44f4725b39489aca89d3d9180.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'tests/syscalls.scm')
-rw-r--r-- | tests/syscalls.scm | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm index 73fa8a7acf..1b31d87f23 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm @@ -148,25 +148,30 @@ (unless perform-container-tests? (test-skip 1)) -(test-assert "pivot-root" +(test-equal "pivot-root" + #t (match (pipe) ((in . out) (match (clone (logior CLONE_NEWUSER CLONE_NEWNS SIGCHLD)) (0 - (close in) - (call-with-temporary-directory - (lambda (root) - (let ((put-old (string-append root "/real-root"))) - (mount "none" root "tmpfs") - (mkdir put-old) - (call-with-output-file (string-append root "/test") - (lambda (port) - (display "testing\n" port))) - (pivot-root root put-old) - ;; The test file should now be located inside the root directory. - (write (file-exists? "/test") out) - (close out)))) - (primitive-exit 0)) + (dynamic-wind + (const #t) + (lambda () + (close in) + (call-with-temporary-directory + (lambda (root) + (let ((put-old (string-append root "/real-root"))) + (mount "none" root "tmpfs") + (mkdir put-old) + (call-with-output-file (string-append root "/test") + (lambda (port) + (display "testing\n" port))) + (pivot-root root put-old) + ;; The test file should now be located inside the root directory. + (write (file-exists? "/test") out) + (close out))))) + (lambda () + (primitive-exit 0)))) (pid (close out) (let ((result (read in))) |