aboutsummaryrefslogtreecommitdiff
path: root/tests/system.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-07-20 11:42:02 +0200
committerLudovic Courtès <ludo@gnu.org>2016-07-20 11:42:17 +0200
commit7575655212ecfbcd1f04e429c8a7a41f8720d027 (patch)
tree558982d3cf50ef6b19ef293850de1f485fde66a6 /tests/system.scm
parent5d4c90ae02f1e0b42d575bba2d828d63aaf79be5 (diff)
parent5f01078129f4eaa4760a14f22761cf357afb6738 (diff)
downloadpatches-7575655212ecfbcd1f04e429c8a7a41f8720d027.tar
patches-7575655212ecfbcd1f04e429c8a7a41f8720d027.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'tests/system.scm')
-rw-r--r--tests/system.scm43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/system.scm b/tests/system.scm
index b935bd07eb..b5bb9af016 100644
--- a/tests/system.scm
+++ b/tests/system.scm
@@ -41,6 +41,25 @@
(users %base-user-accounts)))
+(define %luks-device
+ (mapped-device
+ (source "/dev/foo") (target "my-luks-device")
+ (type luks-device-mapping)))
+
+(define %os-with-mapped-device
+ (operating-system
+ (host-name "komputilo")
+ (timezone "Europe/Berlin")
+ (locale "en_US.utf8")
+ (bootloader (grub-configuration (device "/dev/sdX")))
+ (mapped-devices (list %luks-device))
+ (file-systems (cons (file-system
+ (inherit %root-fs)
+ (dependencies (list %luks-device)))
+ %base-file-systems))
+ (users %base-user-accounts)))
+
+
(test-begin "system")
(test-assert "operating-system-store-file-system"
@@ -71,4 +90,28 @@
%base-file-systems)))))
(eq? gnu (operating-system-store-file-system os))))
+(test-equal "operating-system-user-mapped-devices"
+ '()
+ (operating-system-user-mapped-devices %os-with-mapped-device))
+
+(test-equal "operating-system-boot-mapped-devices"
+ (list %luks-device)
+ (operating-system-boot-mapped-devices %os-with-mapped-device))
+
+(test-equal "operating-system-boot-mapped-devices, implicit dependency"
+ (list %luks-device)
+
+ ;; Here we expect the implicit dependency between "/" and
+ ;; "/dev/mapper/my-luks-device" to be found, in spite of the lack of a
+ ;; 'dependencies' field in the root file system.
+ (operating-system-boot-mapped-devices
+ (operating-system
+ (inherit %os-with-mapped-device)
+ (file-systems (cons (file-system
+ (device "/dev/mapper/my-luks-device")
+ (title 'device)
+ (mount-point "/")
+ (type "ext4"))
+ %base-file-systems)))))
+
(test-end)