unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] tests: Skip container tests if namespaces are not available.
@ 2015-07-20 16:09 David Thompson
  2015-07-20 20:02 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: David Thompson @ 2015-07-20 16:09 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 317 bytes --]

Repairing the damage I've done to the test suite.  I don't have a
GNU/Linux machine with an old enough kernel to check that the tests are
indeed skipped, but I did verify that the tests still run when user
namespaces are available.

Ludovic, this is exactly the code you suggested on IRC.  Does it still
look OK? :)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-tests-Skip-container-tests-if-namespaces-are-not-ava.patch --]
[-- Type: text/x-patch, Size: 808 bytes --]

From 8bff3d1e44dfe72f1f74a8a1a4aa1cac4013b9c0 Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson2@worcester.edu>
Date: Mon, 20 Jul 2015 12:05:23 -0400
Subject: [PATCH] tests: Skip container tests if namespaces are not available.

* tests/containers.scm: Skip all tests if user namespaces do not exist.
---
 tests/containers.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/containers.scm b/tests/containers.scm
index 43401a5..cb1aedd 100644
--- a/tests/containers.scm
+++ b/tests/containers.scm
@@ -26,6 +26,10 @@
 (define (assert-exit x)
   (primitive-exit (if x 0 1)))
 
+;; Skip these tests unless user namespaces are available.
+(unless (file-exists? "/proc/self/ns/user")
+  (exit 77))
+
 (test-begin "containers")
 
 (test-assert "call-with-container, user namespace"
-- 
2.4.3


[-- Attachment #3: Type: text/plain, Size: 38 bytes --]


-- 
David Thompson
GPG Key: 0FF1D807

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tests: Skip container tests if namespaces are not available.
  2015-07-20 16:09 [PATCH] tests: Skip container tests if namespaces are not available David Thompson
@ 2015-07-20 20:02 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2015-07-20 20:02 UTC (permalink / raw)
  To: David Thompson; +Cc: guix-devel

David Thompson <dthompson2@worcester.edu> skribis:

> Ludovic, this is exactly the code you suggested on IRC.  Does it still
> look OK? :)

It does, thanks.  :-)

Ludo’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-20 20:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-20 16:09 [PATCH] tests: Skip container tests if namespaces are not available David Thompson
2015-07-20 20:02 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).