mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
tests: Make sure child process of 'pivot-root' test exits.
* tests/syscalls.scm ("pivot-root"): Use 'test-equal'. Wrap child body in 'dynamic-wind'.
This commit is contained in:
parent
0d7034ca4f
commit
fe9bdb581e
1 changed files with 20 additions and 15 deletions
|
@ -148,11 +148,15 @@
|
||||||
|
|
||||||
(unless perform-container-tests?
|
(unless perform-container-tests?
|
||||||
(test-skip 1))
|
(test-skip 1))
|
||||||
(test-assert "pivot-root"
|
(test-equal "pivot-root"
|
||||||
|
#t
|
||||||
(match (pipe)
|
(match (pipe)
|
||||||
((in . out)
|
((in . out)
|
||||||
(match (clone (logior CLONE_NEWUSER CLONE_NEWNS SIGCHLD))
|
(match (clone (logior CLONE_NEWUSER CLONE_NEWNS SIGCHLD))
|
||||||
(0
|
(0
|
||||||
|
(dynamic-wind
|
||||||
|
(const #t)
|
||||||
|
(lambda ()
|
||||||
(close in)
|
(close in)
|
||||||
(call-with-temporary-directory
|
(call-with-temporary-directory
|
||||||
(lambda (root)
|
(lambda (root)
|
||||||
|
@ -165,8 +169,9 @@
|
||||||
(pivot-root root put-old)
|
(pivot-root root put-old)
|
||||||
;; The test file should now be located inside the root directory.
|
;; The test file should now be located inside the root directory.
|
||||||
(write (file-exists? "/test") out)
|
(write (file-exists? "/test") out)
|
||||||
(close out))))
|
(close out)))))
|
||||||
(primitive-exit 0))
|
(lambda ()
|
||||||
|
(primitive-exit 0))))
|
||||||
(pid
|
(pid
|
||||||
(close out)
|
(close out)
|
||||||
(let ((result (read in)))
|
(let ((result (read in)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue