guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: Skip container tests if namespaces are not available.


From: David Thompson
Subject: [PATCH] tests: Skip container tests if namespaces are not available.
Date: Mon, 20 Jul 2015 12:09:03 -0400
User-agent: Notmuch/0.19 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu)

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? :)

>From 8bff3d1e44dfe72f1f74a8a1a4aa1cac4013b9c0 Mon Sep 17 00:00:00 2001
From: David Thompson <address@hidden>
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

-- 
David Thompson
GPG Key: 0FF1D807

reply via email to

[Prev in Thread] Current Thread [Next in Thread]