From 01497dfe6c0a2ce69287d0fd0008747965a000df Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 27 Jun 2016 09:30:01 +0200 Subject: Merge branch 'master' into core-updates --- tests/containers.scm | 17 +++++++++++++---- tests/packages.scm | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/containers.scm b/tests/containers.scm index 5a0f9937bb..bbcff3f51f 100644 --- a/tests/containers.scm +++ b/tests/containers.scm @@ -30,15 +30,18 @@ ;; Skip these tests unless user namespaces are available and the setgroups ;; file (introduced in Linux 3.19 to address a security issue) exists. -(unless (and (user-namespace-supported?) - (unprivileged-user-namespace-supported?) - (setgroups-supported?)) - (test-skip 7)) +(define (skip-if-unsupported) + (unless (and (user-namespace-supported?) + (unprivileged-user-namespace-supported?) + (setgroups-supported?)) + (test-skip 1))) +(skip-if-unsupported) (test-assert "call-with-container, exit with 0 when there is no error" (zero? (call-with-container '() (const #t) #:namespaces '(user)))) +(skip-if-unsupported) (test-assert "call-with-container, user namespace" (zero? (call-with-container '() @@ -47,6 +50,7 @@ (assert-exit (and (zero? (getuid)) (zero? (getgid))))) #:namespaces '(user)))) +(skip-if-unsupported) (test-assert "call-with-container, uts namespace" (zero? (call-with-container '() @@ -57,6 +61,7 @@ (primitive-exit 0)) #:namespaces '(user uts)))) +(skip-if-unsupported) (test-assert "call-with-container, pid namespace" (zero? (call-with-container '() @@ -72,6 +77,7 @@ (status:exit-val status))))))) #:namespaces '(user pid)))) +(skip-if-unsupported) (test-assert "call-with-container, mnt namespace" (zero? (call-with-container '(("none" device "/testing" "tmpfs" () #f #f)) @@ -79,6 +85,7 @@ (assert-exit (file-exists? "/testing"))) #:namespaces '(user mnt)))) +(skip-if-unsupported) (test-equal "call-with-container, mnt namespace, wrong bind mount" `(system-error ,ENOENT) ;; An exception should be raised; see . @@ -91,12 +98,14 @@ (lambda args (list 'system-error (system-error-errno args))))) +(skip-if-unsupported) (test-assert "call-with-container, all namespaces" (zero? (call-with-container '() (lambda () (primitive-exit 0))))) +(skip-if-unsupported) (test-assert "container-excursion" (call-with-temporary-directory (lambda (root) diff --git a/tests/packages.scm b/tests/packages.scm index d3f432ada2..94f5ea71a5 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -797,7 +797,7 @@ #:guile-for-build (%guile-for-build)))) (build-derivations %store (list prof)) (string-match (format #f "^export XML_CATALOG_FILES=\"~a/xml/+bar/baz/catalog\\.xml\"\n" - (derivation->output-path prof)) + (regexp-quote (derivation->output-path prof))) (with-output-to-string (lambda () (guix-package "-p" (derivation->output-path prof) -- cgit v1.2.3 From 1250034d5aff14fe236aad9900233a2b6f8563bb Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 31 Jul 2016 18:51:38 +0200 Subject: tests: 'guix-environment-container.sh' works when run from a tmpfs. Fixes . Reported by Ting-Wei Lan . * tests/guix-environment-container.sh (mount_test_code): Add 'match' clause to ignore "/"; augment clause that ignores specific file system types such that it does not ignore parent mount points. --- tests/guix-environment-container.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh index 5ea6c49263..12da950eba 100644 --- a/tests/guix-environment-container.sh +++ b/tests/guix-environment-container.sh @@ -65,10 +65,15 @@ mount_test_code=" (match (string-split line #\space) ;; Empty line. ((\"\") #f) - ;; Ignore these types of file systems. - ((_ _ (or \"tmpfs\" \"proc\" \"sysfs\" \"devtmpfs\" - \"devpts\" \"cgroup\" \"mqueue\") _ _ _) + ;; Ignore the root file system. + ((_ \"/\" _ _ _ _) #f) + ;; Ignore these types of file systems, except if they + ;; correspond to a parent file system. + ((_ mount (or \"tmpfs\" \"proc\" \"sysfs\" \"devtmpfs\" + \"devpts\" \"cgroup\" \"mqueue\") _ _ _) + (and (string-prefix? mount (getcwd)) + mount)) ((_ mount _ _ _ _) mount))) (string-split (call-with-input-file \"/proc/mounts\" read-string) -- cgit v1.2.3