From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmwNB-0007SP-Nm for guix-patches@gnu.org; Wed, 30 Aug 2017 02:21:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmwN4-0003dQ-Lz for guix-patches@gnu.org; Wed, 30 Aug 2017 02:21:09 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:52700) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dmwN4-0003dA-Ib for guix-patches@gnu.org; Wed, 30 Aug 2017 02:21:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dmwN4-0000xg-Bp for guix-patches@gnu.org; Wed, 30 Aug 2017 02:21:02 -0400 Subject: [bug#28288] [PATCH 1/2] tests: Add test for installing from an ISO Image. References: <20170830071714.75f88e47@cbaines.net> In-Reply-To: <20170830071714.75f88e47@cbaines.net> Resent-Message-ID: From: Christopher Baines Date: Wed, 30 Aug 2017 07:20:09 +0100 Message-Id: <20170830062010.11902-1-mail@cbaines.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 28288@debbugs.gnu.org * 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))))) + ;;; ;;; Separate /home. -- 2.14.1