doc: Remove references to hydra.gnu.org.
[jackhill/guix/guix.git] / gnu / tests / install.scm
index 0e97de0..9f6baa1 100644 (file)
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
             %test-separate-store-os
             %test-separate-home-os
             %test-raid-root-os
-            %test-encrypted-os
+            %test-encrypted-root-os
             %test-btrfs-root-os))
 
 ;;; Commentary:
 ;;;
-;;; Test the installation of GuixSD using the documented approach at the
+;;; Test the installation of Guix using the documented approach at the
 ;;; command line.
 ;;;
 ;;; Code:
     (timezone "Europe/Paris")
     (locale "en_US.UTF-8")
 
-    (bootloader (grub-configuration (target "/dev/vdb")))
+    (bootloader (bootloader-configuration
+                 (bootloader grub-bootloader)
+                 (target "/dev/vdb")))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons (file-system
-                          (device "my-root")
-                          (title 'label)
+                          (device (file-system-label "my-root"))
                           (mount-point "/")
                           (type "ext4"))
                         %base-file-systems))
                   (name "alice")
                   (comment "Bob's sister")
                   (group "users")
-                  (supplementary-groups '("wheel" "audio" "video"))
-                  (home-directory "/home/alice"))
+                  (supplementary-groups '("wheel" "audio" "video")))
                  %base-user-accounts))
     (services (cons (service marionette-service-type
                              (marionette-configuration
                               (imported-modules '((gnu services herd)
+                                                  (guix build utils)
                                                   (guix combinators)))))
                     %base-services))))
 
                  (target "/dev/vdb")))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons (file-system
-                          (device "my-root")
-                          (title 'label)
+                          (device (file-system-label "my-root"))
                           (mount-point "/")
                           (type "ext4"))
                         %base-file-systems))
                                     (inherit config)
                                     (guix (current-guix))))))))
 
-(define (operating-system-with-gc-roots os roots)
-  "Return a variant of OS where ROOTS are registered as GC roots."
-  (operating-system
-    (inherit os)
-
-    ;; We use this procedure for the installation OS, which already defines GC
-    ;; roots.  Add ROOTS to those.
-    (services (cons (simple-service 'extra-root
-                                    gc-root-service-type roots)
-                    (operating-system-user-services os)))))
-
 \f
 (define MiB (expt 2 20))
 
@@ -148,7 +138,7 @@ export GUIX_BUILD_OPTIONS=--no-grafts
 guix build isc-dhcp
 parted --script /dev/vdb mklabel gpt \\
   mkpart primary ext2 1M 3M \\
-  mkpart primary ext2 3M 1G \\
+  mkpart primary ext2 3M 1.2G \\
   set 1 boot on \\
   set 1 bios_grub on
 mkfs.ext4 -L my-root /dev/vdb2
@@ -173,7 +163,7 @@ guix --version
 export GUIX_BUILD_OPTIONS=--no-grafts
 guix build isc-dhcp
 parted --script /dev/vdb mklabel gpt \\
-  mkpart ext2 1M 1G \\
+  mkpart ext2 1M 1.2G \\
   set 1 legacy_boot on
 mkfs.ext4 -L my-root -O '^64bit' /dev/vdb1
 mount /dev/vdb1 /mnt
@@ -203,7 +193,7 @@ reboot\n")
                                                 (guix combinators))))
                       (installation-disk-image-file-system-type "ext4")
                       (target-size (* 2200 MiB)))
-  "Run SCRIPT (a shell script following the GuixSD installation procedure) in
+  "Run SCRIPT (a shell script following the system installation procedure) in
 OS to install TARGET-OS.  Return a VM image of TARGET-SIZE bytes containing
 the installed system.  The packages specified in PACKAGES will be appended to
 packages defined in installation-os."
@@ -343,11 +333,12 @@ per %test-installed-os, this test is expensive in terms of CPU and storage.")
     (timezone "Europe/Paris")
     (locale "en_US.UTF-8")
 
-    (bootloader (grub-configuration (target "/dev/vda")))
+    (bootloader (bootloader-configuration
+                 (bootloader grub-bootloader)
+                 (target "/dev/vda")))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons (file-system
-                          (device "my-root")
-                          (title 'label)
+                          (device (file-system-label "my-root"))
                           (mount-point "/")
                           (type "ext4"))
                         %base-file-systems))
@@ -355,8 +346,7 @@ per %test-installed-os, this test is expensive in terms of CPU and storage.")
                   (name "alice")
                   (comment "Bob's sister")
                   (group "users")
-                  (supplementary-groups '("wheel" "audio" "video"))
-                  (home-directory "/home/alice"))
+                  (supplementary-groups '("wheel" "audio" "video")))
                  %base-user-accounts))
     (services (cons (service marionette-service-type
                              (marionette-configuration
@@ -375,7 +365,7 @@ export GUIX_BUILD_OPTIONS=--no-grafts
 guix build isc-dhcp
 parted --script /dev/vda mklabel gpt \\
   mkpart primary ext2 1M 3M \\
-  mkpart primary ext2 3M 1G \\
+  mkpart primary ext2 3M 1.2G \\
   set 1 boot on \\
   set 1 bios_grub on
 mkfs.ext4 -L my-root /dev/vda2
@@ -418,28 +408,25 @@ reboot\n")
     (timezone "Europe/Paris")
     (locale "en_US.utf8")
 
-    (bootloader (grub-configuration (target "/dev/vdb")))
+    (bootloader (bootloader-configuration
+                 (bootloader grub-bootloader)
+                 (target "/dev/vdb")))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons* (file-system
-                           (device "my-root")
-                           (title 'label)
+                           (device (file-system-label "my-root"))
                            (mount-point "/")
                            (type "ext4"))
                          (file-system
                            (device "none")
-                           (title 'device)
-                           (type "tmpfs")
                            (mount-point "/home")
                            (type "tmpfs"))
                          %base-file-systems))
     (users (cons* (user-account
                    (name "alice")
-                   (group "users")
-                   (home-directory "/home/alice"))
+                   (group "users"))
                   (user-account
                    (name "charlie")
-                   (group "users")
-                   (home-directory "/home/charlie"))
+                   (group "users"))
                   %base-user-accounts))
     (services (cons (service marionette-service-type
                              (marionette-configuration
@@ -476,16 +463,16 @@ partition.  In particular, home directories must be correctly created (see
     (timezone "Europe/Paris")
     (locale "en_US.UTF-8")
 
-    (bootloader (grub-configuration (target "/dev/vdb")))
+    (bootloader (bootloader-configuration
+                 (bootloader grub-bootloader)
+                 (target "/dev/vdb")))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons* (file-system
-                           (device "root-fs")
-                           (title 'label)
+                           (device (file-system-label "root-fs"))
                            (mount-point "/")
                            (type "ext4"))
                          (file-system
-                           (device "store-fs")
-                           (title 'label)
+                           (device (file-system-label "store-fs"))
                            (mount-point "/gnu")
                            (type "ext4"))
                          %base-file-systems))
@@ -507,8 +494,8 @@ export GUIX_BUILD_OPTIONS=--no-grafts
 guix build isc-dhcp
 parted --script /dev/vdb mklabel gpt \\
   mkpart primary ext2 1M 3M \\
-  mkpart primary ext2 3M 100M \\
-  mkpart primary ext2 100M 1G \\
+  mkpart primary ext2 3M 400M \\
+  mkpart primary ext2 400M 2.1G \\
   set 1 boot on \\
   set 1 bios_grub on
 mkfs.ext4 -L root-fs /dev/vdb2
@@ -517,6 +504,7 @@ mount /dev/vdb2 /mnt
 mkdir /mnt/gnu
 mount /dev/vdb3 /mnt/gnu
 df -h /mnt
+df -h /mnt/gnu
 herd start cow-store /mnt
 mkdir /mnt/etc
 cp /etc/target-config.scm /mnt/etc/config.scm
@@ -552,20 +540,20 @@ where /gnu lives on a separate partition.")
     (timezone "Europe/Paris")
     (locale "en_US.utf8")
 
-    (bootloader (grub-configuration (target "/dev/vdb")))
+    (bootloader (bootloader-configuration
+                 (bootloader grub-bootloader)
+                 (target "/dev/vdb")))
     (kernel-arguments '("console=ttyS0"))
-    (initrd (lambda (file-systems . rest)
-              ;; Add a kernel module for RAID-0 (aka. "stripe").
-              (apply base-initrd file-systems
-                     #:extra-modules '("raid0")
-                     rest)))
+
+    ;; Add a kernel module for RAID-0 (aka. "stripe").
+    (initrd-modules (cons "raid0" %base-initrd-modules))
+
     (mapped-devices (list (mapped-device
                            (source (list "/dev/vda2" "/dev/vda3"))
                            (target "/dev/md0")
                            (type raid-device-mapping))))
     (file-systems (cons (file-system
-                          (device "root-fs")
-                          (title 'label)
+                          (device (file-system-label "root-fs"))
                           (mount-point "/")
                           (type "ext4")
                           (dependencies mapped-devices))
@@ -635,7 +623,9 @@ by 'mdadm'.")
     (timezone "Europe/Paris")
     (locale "en_US.UTF-8")
 
-    (bootloader (grub-configuration (target "/dev/vdb")))
+    (bootloader (bootloader-configuration
+                 (bootloader grub-bootloader)
+                 (target "/dev/vdb")))
 
     ;; Note: Do not pass "console=ttyS0" so we can use our passphrase prompt
     ;; detection logic in 'enter-luks-passphrase'.
@@ -646,14 +636,12 @@ by 'mdadm'.")
                            (type luks-device-mapping))))
     (file-systems (cons (file-system
                           (device "/dev/mapper/the-root-device")
-                          (title 'device)
                           (mount-point "/")
                           (type "ext4"))
                         %base-file-systems))
     (users (cons (user-account
                   (name "charlie")
                   (group "users")
-                  (home-directory "/home/charlie")
                   (supplementary-groups '("wheel" "audio" "video")))
                  %base-user-accounts))
     (services (cons (service marionette-service-type
@@ -673,7 +661,7 @@ export GUIX_BUILD_OPTIONS=--no-grafts
 ls -l /run/current-system/gc-roots
 parted --script /dev/vdb mklabel gpt \\
   mkpart primary ext2 1M 3M \\
-  mkpart primary ext2 3M 1G \\
+  mkpart primary ext2 3M 1.2G \\
   set 1 boot on \\
   set 1 bios_grub on
 echo -n thepassphrase | \\
@@ -732,7 +720,7 @@ to enter the LUKS passphrase."
                                                "/post-initrd-passphrase.ppm")
                                 #$marionette))))))
 
-(define %test-encrypted-os
+(define %test-encrypted-root-os
   (system-test
    (name "encrypted-root-os")
    (description
@@ -762,18 +750,18 @@ build (current-guix) and then store a couple of full system images.")
     (timezone "Europe/Paris")
     (locale "en_US.UTF-8")
 
-    (bootloader (grub-configuration (target "/dev/vdb")))
+    (bootloader (bootloader-configuration
+                 (bootloader grub-bootloader)
+                 (target "/dev/vdb")))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons (file-system
-                          (device "my-root")
-                          (title 'label)
+                          (device (file-system-label "my-root"))
                           (mount-point "/")
                           (type "btrfs"))
                         %base-file-systems))
     (users (cons (user-account
                   (name "charlie")
                   (group "users")
-                  (home-directory "/home/charlie")
                   (supplementary-groups '("wheel" "audio" "video")))
                  %base-user-accounts))
     (services (cons (service marionette-service-type