Subject: [bug#72457] [PATCH v3 14/15] gnu: tests: Update tests to new targets system.

From: Lilah Tascheter <[email-masked]>
Date: Sun, 4 Aug 2024 15:32:00 -0500

* gnu/services/virtualization.scm
  (%virtual-build-machine-operating-system): Remove bootloader.
  (%hurd-vm-operating-system): Remove targets.

* gnu/system/hurd.scm (%hurd-default-operating-system): Remove targets.

* gnu/tests.scm (%simple-os), gnu/tests/ganeti.scm (%ganeti-os),
  gnu/tests/image.scm (%simple-efi-os),
  gnu/tests/install.scm (%minimal-os, %minimal-extlinux-os,
  %minimal-os-on-vda, %separate-home-os, %separate-store-os, %raid-root-os,
  %encrypted-root-os, %lvm-separate-home-os, %encrypted-home-os,
  %encrypted-home-os-key-file, %encrypted-root-not-boot-os,
  %btrfs-root-os-source, %btrfs-raid-root-os-source,
  %btrfs-root-on-subvolume-os, %btrfs-raid10-root-os, %jfs-root-os,
  %f2fs-root-os, %xfs-root-os), gnu/tests/nfs.scm (%base-os),
  gnu/tests/telephony.scm (make-jami-os), gnu/tests/vnc.scm (%xvnc-os):
  Update bootloader targets.

Change-Id: I3d66a839a9b2a73b8b65946950728b1e0155ca1e
---
 gnu/services/virtualization.scm | 11 ++---
 gnu/system/hurd.scm             |  4 +-
 gnu/tests.scm                   |  4 +-
 gnu/tests/ganeti.scm            |  4 +-
 gnu/tests/image.scm             |  4 +-
 gnu/tests/install.scm           | 72 ++++++++++++++++++++++++---------
 gnu/tests/nfs.scm               |  4 +-
 gnu/tests/telephony.scm         |  4 +-
 gnu/tests/vnc.scm               |  4 +-
 tests/boot-parameters.scm       |  2 +-
 10 files changed, 77 insertions(+), 36 deletions(-)

diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm
index d87e494348..f698532a94 100644
--- a/gnu/services/virtualization.scm
+++ b/gnu/services/virtualization.scm
@@ -1191,17 +1191,13 @@ (define %minimal-vm-syslog-config
 (define %virtual-build-machine-operating-system
   (operating-system
     (host-name "build-machine")
-
     (locale "en_US.utf8")
     (locale-definitions
      ;; Save space by providing only one locale.
      (list (locale-definition (name "en_US.utf8")
                               (source "en_US")
                               (charset "UTF-8"))))
-
-    (bootloader (bootloader-configuration         ;unused
-                 (bootloader grub-minimal-bootloader)
-                 (targets '("/dev/null"))))
+    ;; no bootloader
     (file-systems (cons (file-system              ;unused
                           (mount-point "/")
                           (device "none")
@@ -1624,9 +1620,8 @@ (define %hurd-vm-operating-system
     (host-name "childhurd")
     (timezone "Europe/Amsterdam")
     (bootloader (bootloader-configuration
-                 (bootloader grub-minimal-bootloader)
-                 (targets '("/dev/vda"))
-                 (timeout 0)))
+                  (bootloader grub-minimal-bootloader)
+                  (timeout 0)))
     (packages (cons* gdb-minimal
                      (operating-system-packages
                       %hurd-default-operating-system)))
diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index cbe0081382..af04e82485 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -119,9 +119,7 @@ (define %hurd-default-operating-system
     (kernel %hurd-default-operating-system-kernel)
     (kernel-arguments '())
     (hurd hurd)
-    (bootloader (bootloader-configuration
-                 (bootloader grub-minimal-bootloader)
-                 (targets '("/dev/vda"))))
+    (bootloader (bootloader-configuration (bootloader grub-minimal-bootloader)))
     (initrd #f)
     (initrd-modules '())
     (firmware '())
diff --git a/gnu/tests.scm b/gnu/tests.scm
index 5ff9db82fc..f46ccf5174 100644
--- a/gnu/tests.scm
+++ b/gnu/tests.scm
@@ -237,7 +237,9 @@ (define %simple-os
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets '("/dev/sdX"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device"/dev/sdX"))))))
     (file-systems (cons (file-system
                           (device (file-system-label "my-root"))
                           (mount-point "/")
diff --git a/gnu/tests/ganeti.scm b/gnu/tests/ganeti.scm
index 29eb354044..789879b26f 100644
--- a/gnu/tests/ganeti.scm
+++ b/gnu/tests/ganeti.scm
@@ -40,7 +40,9 @@ (define %ganeti-os
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets '("/dev/vda"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vda"))))))
     (file-systems (cons (file-system
                           (device (file-system-label "my-root"))
                           (mount-point "/")
diff --git a/gnu/tests/image.scm b/gnu/tests/image.scm
index be6852cae0..8d960cf7b8 100644
--- a/gnu/tests/image.scm
+++ b/gnu/tests/image.scm
@@ -55,7 +55,9 @@ (define %simple-efi-os
     (inherit %simple-os)
     (bootloader (bootloader-configuration
                  (bootloader grub-efi-bootloader)
-                 (targets '("/boot/efi"))))))
+                 (targets (list (bootloader-target
+                                  (type 'esp)
+                                  (path "/boot/efi"))))))))
 
 ;; An MBR disk image with a single ext4 partition.
 (define i1
diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm
index 18a2fc119b..d67a71f12e 100644
--- a/gnu/tests/install.scm
+++ b/gnu/tests/install.scm
@@ -103,7 +103,9 @@ (define-os-with-source (%minimal-os %minimal-os-source)
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets (list "/dev/vdb"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vdb"))))))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons (file-system
                           (device (file-system-label "my-root"))
@@ -141,7 +143,9 @@ (define-os-with-source (%minimal-extlinux-os
 
     (bootloader (bootloader-configuration
                  (bootloader extlinux-gpt-bootloader)
-                 (targets (list "/dev/vdb"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vdb"))))))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons (file-system
                           (device (file-system-label "my-root"))
@@ -434,7 +438,9 @@ (define-os-with-source (%minimal-os-on-vda %minimal-os-on-vda-source)
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets (list "/dev/vda"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vda"))))))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons (file-system
                           (device (file-system-label "my-root"))
@@ -510,7 +516,9 @@ (define-os-with-source (%separate-home-os %separate-home-os-source)
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets '("/dev/vdb"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vdb"))))))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons* (file-system
                            (device (file-system-label "my-root"))
@@ -565,7 +573,9 @@ (define-os-with-source (%separate-store-os %separate-store-os-source)
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets (list "/dev/vdb"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vdb"))))))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons* (file-system
                            (device (file-system-label "root-fs"))
@@ -642,7 +652,9 @@ (define-os-with-source (%raid-root-os %raid-root-os-source)
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets (list "/dev/vdb"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vdb"))))))
     (kernel-arguments '("console=ttyS0"))
 
     ;; Add a kernel module for RAID-1 (aka. "mirror").
@@ -725,7 +737,9 @@ (define-os-with-source (%encrypted-root-os %encrypted-root-os-source)
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets '("/dev/vdb"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vdb"))))))
 
     ;; Note: Do not pass "console=ttyS0" so we can use our passphrase prompt
     ;; detection logic in 'enter-luks-passphrase'.
@@ -858,7 +872,9 @@ (define-os-with-source (%lvm-separate-home-os %lvm-separate-home-os-source)
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets (list "/dev/vdb"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vdb"))))))
     (kernel-arguments '("console=ttyS0"))
 
     (mapped-devices (list (mapped-device
@@ -943,7 +959,9 @@ (define-os-with-source (%encrypted-home-os %encrypted-home-os-source)
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets (list "/dev/vdb"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vdb"))))))
 
     ;; Note: Do not pass "console=ttyS0" so we can use our passphrase prompt
     ;; detection logic in 'enter-luks-passphrase'.
@@ -1070,7 +1088,9 @@ (define-os-with-source (%encrypted-home-os-key-file
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets (list "/dev/vdb"))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vdb"))))
                  (extra-initrd "/key-file.cpio")))
     (kernel-arguments '("console=ttyS0"))
 
@@ -1130,7 +1150,9 @@ (define-os-with-source (%encrypted-root-not-boot-os
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets (list "/dev/vdb"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vdb"))))))
 
     (mapped-devices (list (mapped-device
                            (source
@@ -1232,7 +1254,9 @@ (define-os-with-source (%btrfs-root-os %btrfs-root-os-source)
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets (list "/dev/vdb"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vdb"))))))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons (file-system
                           (device (file-system-label "my-root"))
@@ -1306,7 +1330,9 @@ (define-os-with-source (%btrfs-raid-root-os %btrfs-raid-root-os-source)
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets (list "/dev/vdb"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vdb"))))))
     (kernel-arguments '("console=ttyS0"))
 
     (file-systems (cons (file-system
@@ -1374,7 +1400,9 @@ (define-os-with-source (%btrfs-root-on-subvolume-os
     (locale "en_US.UTF-8")
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets (list "/dev/vdb"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vdb"))))))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons* (file-system
                            (device (file-system-label "btrfs-pool"))
@@ -1467,7 +1495,9 @@ (define-os-with-source (%btrfs-raid10-root-os
     (bootloader (map (lambda (targ)
                        (bootloader-configuration
                          (bootloader grub-bootloader)
-                         (targets (list targ))))
+                         (targets (list (bootloader-target
+                                          (type 'disk)
+                                          (device targ))))))
                      '("/dev/vdb" "/dev/vdc" "/dev/vdd" "/dev/vde")))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons* (file-system
@@ -1577,7 +1607,9 @@ (define-os-with-source (%jfs-root-os %jfs-root-os-source)
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets (list "/dev/vdb"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vdb"))))))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons (file-system
                           (device (file-system-label "my-root"))
@@ -1650,7 +1682,9 @@ (define-os-with-source (%f2fs-root-os %f2fs-root-os-source)
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets (list "/dev/vdb"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vdb"))))))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons (file-system
                           (device (file-system-label "my-root"))
@@ -1723,7 +1757,9 @@ (define-os-with-source (%xfs-root-os %xfs-root-os-source)
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets (list "/dev/vdb"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/vdb"))))))
     (kernel-arguments '("console=ttyS0"))
     (file-systems (cons (file-system
                           (device (file-system-label "my-root"))
diff --git a/gnu/tests/nfs.scm b/gnu/tests/nfs.scm
index 0d9972e0e9..2f97126df7 100644
--- a/gnu/tests/nfs.scm
+++ b/gnu/tests/nfs.scm
@@ -51,7 +51,9 @@ (define %base-os
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets '("/dev/sdX"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/sdX"))))))
     (file-systems %base-file-systems)
     (users %base-user-accounts)
     (packages (cons*
diff --git a/gnu/tests/telephony.scm b/gnu/tests/telephony.scm
index f03ea963f7..ee858d9c91 100644
--- a/gnu/tests/telephony.scm
+++ b/gnu/tests/telephony.scm
@@ -90,7 +90,9 @@ (define* (make-jami-os #:key provisioning? partial?)
 
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets '("/dev/sdX"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/sdX"))))))
     (file-systems (cons (file-system
                           (device (file-system-label "my-root"))
                           (mount-point "/")
diff --git a/gnu/tests/vnc.scm b/gnu/tests/vnc.scm
index ab1c2749f3..cba9c565e0 100644
--- a/gnu/tests/vnc.scm
+++ b/gnu/tests/vnc.scm
@@ -51,7 +51,9 @@ (define %xvnc-os
     (locale "en_US.UTF-8")
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
-                 (targets '("/dev/sdX"))))
+                 (targets (list (bootloader-target
+                                  (type 'disk)
+                                  (device "/dev/sdX"))))))
     (file-systems (cons (file-system
                           (device (file-system-label "my-root"))
                           (mount-point "/")
diff --git a/tests/boot-parameters.scm b/tests/boot-parameters.scm
index f214de360d..f343dbdfdb 100644
--- a/tests/boot-parameters.scm
+++ b/tests/boot-parameters.scm
@@ -63,7 +63,7 @@ (define %root-path "/")
 
 (define %grub-boot-parameters
   (boot-parameters
-   (bootloader-name 'grub)
+   (bootloader-name '(grub))
    (root-device %default-root-device)
    (label %default-label)
    (kernel %default-kernel)
-- 
2.45.2