aboutsummaryrefslogtreecommitdiff
path: root/tests/file-systems.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-01-23 22:33:10 +0100
committerLudovic Courtès <ludo@gnu.org>2017-01-23 22:33:10 +0100
commit58ea4d407c2e4adbe51b2d7b71dc8bef095677c7 (patch)
tree0fd70c0cb82d7980a7ff82500dec7bfd0d535d3f /tests/file-systems.scm
parentfcd75bdbfa99d14363b905afbf914eec20e69df8 (diff)
parent84b60a7cdfca1421a478894e279104a0c18a7c6d (diff)
downloadguix-58ea4d407c2e4adbe51b2d7b71dc8bef095677c7.tar
guix-58ea4d407c2e4adbe51b2d7b71dc8bef095677c7.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'tests/file-systems.scm')
-rw-r--r--tests/file-systems.scm24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/file-systems.scm b/tests/file-systems.scm
index aed27e89c2..fd1599e132 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,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (test-file-systems)
+ #:use-module (guix store)
#:use-module (gnu system file-systems)
#:use-module (srfi srfi-64)
#:use-module (rnrs bytevectors))
@@ -50,4 +51,25 @@
(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-end)