aboutsummaryrefslogtreecommitdiff
path: root/tests/containers.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-04-02 10:34:48 +0200
committerLudovic Courtès <ludo@gnu.org>2019-04-02 18:15:37 +0200
commitaf76c020bf19de5fe2e92f31d8b85cbd55c481de (patch)
tree2810b6d4285bdce32d3ddbdd06167c2f1248d749 /tests/containers.scm
parent36d69ac993a322aea5b9021bc9920c135ab5edbb (diff)
downloadguix-af76c020bf19de5fe2e92f31d8b85cbd55c481de.tar
guix-af76c020bf19de5fe2e92f31d8b85cbd55c481de.tar.gz
linux-container: Make the guest UID and GID a parameter.
* gnu/build/linux-container.scm (initialize-user-namespace): Add #:guest-uid and #:guest-gid parameters and honor them. (run-container): Likewise. (call-with-container): Likewise. * tests/containers.scm ("call-with-container, user namespace, guest UID/GID"): New test.
Diffstat (limited to 'tests/containers.scm')
-rw-r--r--tests/containers.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/containers.scm b/tests/containers.scm
index 5323e5037d..37408f380d 100644
--- a/tests/containers.scm
+++ b/tests/containers.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 David Thompson <davet@gnu.org>
+;;; Copyright © 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -52,6 +53,16 @@
#:namespaces '(user))))
(skip-if-unsupported)
+(test-assert "call-with-container, user namespace, guest UID/GID"
+ (zero?
+ (call-with-container '()
+ (lambda ()
+ (assert-exit (and (= 42 (getuid)) (= 77 (getgid)))))
+ #:guest-uid 42
+ #:guest-gid 77
+ #:namespaces '(user))))
+
+(skip-if-unsupported)
(test-assert "call-with-container, uts namespace"
(zero?
(call-with-container '()