aboutsummaryrefslogtreecommitdiff
path: root/tests/file-systems.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2017-02-13 22:35:05 +0100
committerMarius Bakke <mbakke@fastmail.com>2017-02-13 22:35:05 +0100
commit424b1ae76901c538457bd3c30d9d9cf67e79855f (patch)
treeacc35c1160625618cd6083e728c6a4ff7e9cccc9 /tests/file-systems.scm
parenta50e03014177d2f00b5b85d3e1c295406f842016 (diff)
parenteae2dbd47ac1f4a201b8584e2f88c30cd28e093a (diff)
downloadguix-424b1ae76901c538457bd3c30d9d9cf67e79855f.tar
guix-424b1ae76901c538457bd3c30d9d9cf67e79855f.tar.gz
Merge branch 'master' into python-tests
Diffstat (limited to 'tests/file-systems.scm')
-rw-r--r--tests/file-systems.scm32
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/file-systems.scm b/tests/file-systems.scm
index aed27e89c2..467ee8ca5d 100644
--- a/tests/file-systems.scm
+++ b/tests/file-systems.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2017 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -17,6 +17,8 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (test-file-systems)
+ #:use-module (guix store)
+ #:use-module (guix modules)
#:use-module (gnu system file-systems)
#:use-module (srfi srfi-64)
#:use-module (rnrs bytevectors))
@@ -50,4 +52,32 @@
(string-contains message "invalid UUID")
(equal? form '(uuid "foobar"))))))
+(test-assert "file-system-needed-for-boot?"
+ (let-syntax ((dummy-fs (syntax-rules ()
+ ((_ directory)
+ (file-system
+ (device "foo")
+ (mount-point directory)
+ (type "ext4"))))))
+ (parameterize ((%store-prefix "/gnu/guix/store"))
+ (and (file-system-needed-for-boot? (dummy-fs "/"))
+ (file-system-needed-for-boot? (dummy-fs "/gnu"))
+ (file-system-needed-for-boot? (dummy-fs "/gnu/guix"))
+ (file-system-needed-for-boot? (dummy-fs "/gnu/guix/store"))
+ (not (file-system-needed-for-boot?
+ (dummy-fs "/gnu/guix/store/foo")))
+ (not (file-system-needed-for-boot? (dummy-fs "/gn")))
+ (not (file-system-needed-for-boot?
+ (file-system
+ (inherit (dummy-fs (%store-prefix)))
+ (device "/foo")
+ (flags '(bind-mount read-only)))))))))
+
+(test-assert "does not pull (guix config)"
+ ;; This module is meant both for the host side and "build side", so make
+ ;; sure it doesn't pull in (guix config), which depends on the user's
+ ;; config.
+ (not (member '(guix config)
+ (source-module-closure '((gnu system file-systems))))))
+
(test-end)