summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2025-10-13 10:39:21 +0200
committerLudovic Courtès <ludo@gnu.org>2025-10-13 14:48:26 +0200
commite0e64be8de3d220a12612b3a2e4aee428277d865 (patch)
treed55858b5e6ebd050907c1f51188d7575b9e0048e /tests
parent73cbebfaede2d31e22a6e75d395c37768d6382d1 (diff)
linux-container: Remove #:lock-mounts? and related code.
This reverts commits 437bb9ece55f37d4b5a62cafc98c0c3b848a53ce and a57ed987ffd1452ba5a4d70feb54893e99b8e076, which were reported in guix/guix#1169 to occasionally cause errors like: guix shell: error: unshare : 268566528: Invalid argument
Diffstat (limited to 'tests')
-rw-r--r--tests/containers.scm33
1 files changed, 4 insertions, 29 deletions
diff --git a/tests/containers.scm b/tests/containers.scm
index 6edea9631dc..1e915d517e8 100644
--- a/tests/containers.scm
+++ b/tests/containers.scm
@@ -1,6 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 David Thompson <davet@gnu.org> 2;;; Copyright © 2015 David Thompson <davet@gnu.org>
3;;; Copyright © 2016-2017, 2019, 2023, 2025 Ludovic Courtès <ludo@gnu.org> 3;;; Copyright © 2016, 2017, 2019, 2023 Ludovic Courtès <ludo@gnu.org>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
6;;; 6;;;
@@ -111,26 +111,6 @@
111 #:namespaces '(user mnt)))) 111 #:namespaces '(user mnt))))
112 112
113(skip-if-unsupported) 113(skip-if-unsupported)
114(test-equal "call-with-container, mnt namespace, locked mounts"
115 EINVAL
116 ;; umount(2) fails with EINVAL when targeting a mount point that is
117 ;; "locked".
118 (status:exit-val
119 (call-with-container (list (file-system
120 (device "none")
121 (mount-point "/testing")
122 (type "tmpfs")
123 (check? #f)))
124 (lambda ()
125 (primitive-exit (catch 'system-error
126 (lambda ()
127 (umount "/testing")
128 0)
129 (lambda args
130 (system-error-errno args)))))
131 #:namespaces '(user mnt))))
132
133(skip-if-unsupported)
134(test-equal "call-with-container, mnt namespace, wrong bind mount" 114(test-equal "call-with-container, mnt namespace, wrong bind mount"
135 `(system-error ,ENOENT) 115 `(system-error ,ENOENT)
136 ;; An exception should be raised; see <http://bugs.gnu.org/23306>. 116 ;; An exception should be raised; see <http://bugs.gnu.org/23306>.
@@ -189,8 +169,7 @@
189 #:namespaces '(user mnt)))) 169 #:namespaces '(user mnt))))
190 170
191(skip-if-unsupported) 171(skip-if-unsupported)
192(test-equal "container-excursion" 172(test-assert "container-excursion"
193 0
194 (call-with-temporary-directory 173 (call-with-temporary-directory
195 (lambda (root) 174 (lambda (root)
196 ;; Two pipes: One for the container to signal that the test can begin, 175 ;; Two pipes: One for the container to signal that the test can begin,
@@ -214,11 +193,7 @@
214 (readlink (string-append "/proc/" pid "/ns/" ns))) 193 (readlink (string-append "/proc/" pid "/ns/" ns)))
215 '("user" "ipc" "uts" "net" "pid" "mnt")))) 194 '("user" "ipc" "uts" "net" "pid" "mnt"))))
216 195
217 (let* ((pid (run-container root '() %namespaces 1 container 196 (let* ((pid (run-container root '() %namespaces 1 container))
218 ;; Do not lock mounts so the user namespace
219 ;; appears to be the same seen from inside
220 ;; and from outside.
221 #:lock-mounts? #f))
222 (container-namespaces (namespaces pid)) 197 (container-namespaces (namespaces pid))
223 (result 198 (result
224 (begin 199 (begin
@@ -238,7 +213,7 @@
238 (write 'done end-out) 213 (write 'done end-out)
239 (close end-out) 214 (close end-out)
240 (waitpid pid) 215 (waitpid pid)
241 result)))))) 216 (zero? result)))))))
242 217
243(skip-if-unsupported) 218(skip-if-unsupported)
244(test-equal "container-excursion, same namespaces" 219(test-equal "container-excursion, same namespaces"