aboutsummaryrefslogtreecommitdiff
path: root/tests/containers.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-02-10 17:40:25 +0100
committerLudovic Courtès <ludo@gnu.org>2017-02-10 17:40:25 +0100
commit768f0ac9dd9993827430d62d0f72a5020f476892 (patch)
tree600f7ca7cedb221147edfc92356e11bc6c56f311 /tests/containers.scm
parent955ba55c6bf3a22264b56274ec22cad1551c1ce6 (diff)
parent49dbae548e92e0521ae125239282a04d8ea924cf (diff)
downloadguix-768f0ac9dd9993827430d62d0f72a5020f476892.tar
guix-768f0ac9dd9993827430d62d0f72a5020f476892.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'tests/containers.scm')
-rw-r--r--tests/containers.scm27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/containers.scm b/tests/containers.scm
index 745b56b710..0b3a4be12b 100644
--- a/tests/containers.scm
+++ b/tests/containers.scm
@@ -180,4 +180,31 @@
(lambda ()
(primitive-exit 42))))
+(skip-if-unsupported)
+(test-assert "container-excursion*"
+ (call-with-temporary-directory
+ (lambda (root)
+ (define (namespaces pid)
+ (let ((pid (number->string pid)))
+ (map (lambda (ns)
+ (readlink (string-append "/proc/" pid "/ns/" ns)))
+ '("user" "ipc" "uts" "net" "pid" "mnt"))))
+
+ (let* ((pid (run-container root '()
+ %namespaces 1
+ (lambda ()
+ (sleep 100))))
+ (result (container-excursion* pid
+ (lambda ()
+ (namespaces 1)))))
+ (kill pid SIGKILL)
+ (equal? result (namespaces pid))))))
+
+(skip-if-unsupported)
+(test-equal "container-excursion*, same namespaces"
+ 42
+ (container-excursion* (getpid)
+ (lambda ()
+ (* 6 7))))
+
(test-end)