unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: 28288@debbugs.gnu.org
Subject: [bug#28288] [PATCH 1/2] tests: Add test for installing from an ISO Image.
Date: Wed, 30 Aug 2017 07:20:09 +0100	[thread overview]
Message-ID: <20170830062010.11902-1-mail@cbaines.net> (raw)
In-Reply-To: <20170830071714.75f88e47@cbaines.net>

* gnu/tests/install.scm (%test-iso-image-installer): New variable.
  (run-install): Add #:installation-disk-image-file-system-type as a keyword
  argument.
---
 gnu/tests/install.scm | 48 +++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 37 insertions(+), 11 deletions(-)

diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm
index 866bf885c..7596347a3 100644
--- a/gnu/tests/install.scm
+++ b/gnu/tests/install.scm
@@ -37,6 +37,7 @@
   #:use-module (guix utils)
   #:export (%test-installed-os
             %test-installed-extlinux-os
+            %test-iso-image-installer
             %test-separate-store-os
             %test-separate-home-os
             %test-raid-root-os
@@ -196,6 +197,7 @@ reboot\n")
                              (kernel-arguments '("console=ttyS0")))
                            #:imported-modules '((gnu services herd)
                                                 (guix combinators))))
+                      (installation-disk-image-file-system-type "ext4")
                       (target-size (* 1200 MiB)))
   "Run SCRIPT (a shell script following the GuixSD installation procedure) in
 OS to install TARGET-OS.  Return a VM image of TARGET-SIZE bytes containing
@@ -213,7 +215,9 @@ packages defined in installation-os."
                        (image  (system-disk-image
                                 (operating-system-with-gc-roots
                                  os (list target))
-                                #:disk-image-size (* 1500 MiB))))
+                                #:disk-image-size (* 1500 MiB)
+                                #:file-system-type
+                                installation-disk-image-file-system-type)))
     (define install
       (with-imported-modules '((guix build utils)
                                (gnu build marionette))
@@ -229,16 +233,24 @@ packages defined in installation-os."
 
             (define marionette
               (make-marionette
-               (cons (which #$(qemu-command system))
-                     (cons* "-no-reboot" "-m" "800"
-                            "-drive"
-                            (string-append "file=" #$image
-                                           ",if=virtio,readonly")
-                            "-drive"
-                            (string-append "file=" #$output ",if=virtio")
-                            (if (file-exists? "/dev/kvm")
-                                '("-enable-kvm")
-                                '())))))
+               `(,(which #$(qemu-command system))
+                 "-no-reboot"
+                 "-m" "800"
+                 ,@(case installation-disk-image-file-system-type
+                     (("ext4")
+                      `("-drive"
+                        ,(string-append "file=" #$image
+                                        ",if=virtio,readonly")))
+                     (("iso9660") '("-cdrom" #$image))
+                     (else
+                      (error
+                       "unsupported installation-disk-image-file-system-type"
+                       installation-disk-image-file-system-type)))
+                 "-drive"
+                 ,(string-append "file=" #$output ",if=virtio")
+                 ,@(if (file-exists? "/dev/kvm")
+                       '("-enable-kvm")
+                       '()))))
 
             (pk 'uname (marionette-eval '(uname) marionette))
 
@@ -312,6 +324,20 @@ per %test-installed-os, this test is expensive in terms of CPU and storage.")
       (run-basic-test %minimal-extlinux-os command
                       "installed-extlinux-os")))))
 
+(define %test-iso-image-installer
+  (system-test
+   (name "iso-image-installer")
+   (description
+    "")
+   (value
+    (mlet* %store-monad ((image   (run-install
+                                   %minimal-os
+                                   %minimal-os-source
+                                   #:installation-disk-image-file-system-type
+                                   "iso9660"))
+                         (command (qemu-command/writable-image image)))
+      (run-basic-test %minimal-os command name)))))
+
 \f
 ;;;
 ;;; Separate /home.
-- 
2.14.1

  reply	other threads:[~2017-08-30  6:21 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30  6:17 [bug#28288] [PATCH] Test and fix the ISO Image Installer Christopher Baines
2017-08-30  6:20 ` Christopher Baines [this message]
2017-08-30  6:20   ` [bug#28288] [PATCH 2/2] WIP Christopher Baines
2017-08-30  6:31     ` Christopher Baines
2017-08-30  8:38       ` Danny Milosavljevic
2017-08-30 22:56         ` Christopher Baines
2017-08-31 13:04           ` Danny Milosavljevic
2017-08-31 21:47             ` Christopher Baines
2017-08-30 18:26     ` Danny Milosavljevic
2017-09-03 10:50 ` [bug#28288] [PATCH 1/5] vm: Add support for registering closures to make-iso9660-image Christopher Baines
2017-09-03 10:50   ` [bug#28288] [PATCH 2/5] vm: Create /mnt in the generated ISO image in make-iso9660-image Christopher Baines
2017-09-05 12:58     ` Danny Milosavljevic
2017-09-03 10:50   ` [bug#28288] [PATCH 3/5] vm: Add support for registering closures to iso9660-image Christopher Baines
2017-09-05 12:57     ` Danny Milosavljevic
2017-09-03 10:50   ` [bug#28288] [PATCH 4/5] vm: Call iso9660-image with #:register-closures? as #t Christopher Baines
2017-09-05 12:56     ` Danny Milosavljevic
2017-09-05 13:18       ` Ludovic Courtès
2017-09-03 10:50   ` [bug#28288] [PATCH 5/5] tests: Add test for installing from an ISO Image Christopher Baines
2017-09-03 10:58     ` Christopher Baines
2017-09-05 13:18       ` Ludovic Courtès
2017-09-06  7:46         ` bug#28288: " Christopher Baines
2017-09-05 13:17   ` [bug#28288] [PATCH 1/5] vm: Add support for registering closures to make-iso9660-image Ludovic Courtès
2017-09-06  7:05     ` Christopher Baines
2017-09-06 13:20       ` Ludovic Courtès
2017-09-10 10:45         ` Christopher Baines

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170830062010.11902-1-mail@cbaines.net \
    --to=mail@cbaines.net \
    --cc=28288@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).