From patchwork Sun Mar 13 05:43:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 37771 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 20CF227BBEA; Sun, 13 Mar 2022 05:45:27 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D084527BBE9 for ; Sun, 13 Mar 2022 05:45:26 +0000 (GMT) Received: from localhost ([::1]:42098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nTH2j-0005CD-Vw for patchwork@mira.cbaines.net; Sun, 13 Mar 2022 00:45:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTH2M-0005Bu-SB for guix-patches@gnu.org; Sun, 13 Mar 2022 00:45:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:47518) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nTH2M-0007S0-K9 for guix-patches@gnu.org; Sun, 13 Mar 2022 00:45:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nTH2M-0007s1-I8 for guix-patches@gnu.org; Sun, 13 Mar 2022 00:45:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54368] [PATCH 1/4] tests: install: Adjust the timeouts on two failing tests. References: <20220313054040.17120-1-maxim.cournoyer@gmail.com> In-Reply-To: <20220313054040.17120-1-maxim.cournoyer@gmail.com> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Mar 2022 05:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54368 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54368@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 54368-submit@debbugs.gnu.org id=B54368.164715028730177 (code B ref 54368); Sun, 13 Mar 2022 05:45:02 +0000 Received: (at 54368) by debbugs.gnu.org; 13 Mar 2022 05:44:47 +0000 Received: from localhost ([127.0.0.1]:41406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTH27-0007qf-17 for submit@debbugs.gnu.org; Sun, 13 Mar 2022 00:44:47 -0500 Received: from mail-qk1-f171.google.com ([209.85.222.171]:43720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTH25-0007qS-De for 54368@debbugs.gnu.org; Sun, 13 Mar 2022 00:44:45 -0500 Received: by mail-qk1-f171.google.com with SMTP id z66so10328895qke.10 for <54368@debbugs.gnu.org>; Sat, 12 Mar 2022 21:44:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+LxsIodeBWPg6dC0Tdb9IO8JJUbOHqfk2cS0I+DUJ4w=; b=Ijq3/fkhQlOgDm1ONlM6D+jcz+36rIFjHWETwu0k4XPVt8QNIAcxVH602IB+Kxh9qI dBGssxMHPqaeFcVoL8yTaqxZtPkUpTEH3AGzCgGzX284Of4HkUQymT83SvtonfiTEBKK TwKDetTbtJ95RgmHbCfKw/Lb3xctXxioDMu8/2ec2ovn/ofx8OX5GoACfej1nNL3kaF1 aKpWo5ZLpsiUSqmBeMA6k/Etr//Z2r3k2y47ydGhGVAVKBDVdhRy9KtJDTfNHWIDHipe lQ2VEfapp7pLnIbjqPyiE/6AA1tUx5Z8Rwrgfc/ff9wUAx3fr6zkYUeDBAvD6jKmwH24 Z8GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+LxsIodeBWPg6dC0Tdb9IO8JJUbOHqfk2cS0I+DUJ4w=; b=JzeO3D0YHOqJSx+qfzKWBHMitk/cP8OxLWTpKzNOQQJHzAEytVCtrB3VzecM5hQabd XYAQL5erWr2KjKNqGp2k+Fw2XKt8h0rSY3P9gX0tRPSOnStR3kjSvOYXN+cJk2pV5iBN coH2EKW1J3emZnOZc3BQleX6XbCDITbcQubNUWCAcD9eYZWDOYAsErLEgZN+9JhQ1xhe VUQFxO9cp+GWde705ZaLLS5HEpU2nk7CaB4ae1YQATaDhuC5WApIEugoaDW/RA/3ujM/ gcGkobhFIq0OKscQI3jBEWrzfD+IweWB4ona1i6oXS3z+/hASlb12KbE6AbyUPCPfn28 yIpw== X-Gm-Message-State: AOAM53355Y15Om3ADcMoVdKGgXJK0yqHjk7sveC4MdI2ATeKky5FBvVS V5YTPWVEBog7KlhgE1g/ODBOhjZ0zLw= X-Google-Smtp-Source: ABdhPJwOA3a67/SByHu5CQhnyx4wBCf2+B/CR6fdp/nSk3JC4Koz09BrnDJsfR8LKeNoGicH9QoVPw== X-Received: by 2002:a05:620a:27c8:b0:67d:2a41:d15d with SMTP id i8-20020a05620a27c800b0067d2a41d15dmr11147731qkp.703.1647150279633; Sat, 12 Mar 2022 21:44:39 -0800 (PST) Received: from localhost.localdomain (dsl-153-119.b2b2c.ca. [66.158.153.119]) by smtp.gmail.com with ESMTPSA id v129-20020a379387000000b0064936bab2fcsm6376657qkd.48.2022.03.12.21.44.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Mar 2022 21:44:39 -0800 (PST) From: Maxim Cournoyer Date: Sun, 13 Mar 2022 00:43:52 -0500 Message-Id: <20220313054356.17578-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches The 'login on tty1' and 'getlogin on tty1' tests were failing on a machine equipped with slower hard drives. * gnu/tests/base.scm (run-basic-test) ["login on tty1", "getlogin on tty1"]: Bump timeout from 10 to 30 s. --- gnu/tests/base.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 38d4317e52..cfaa736aec 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -346,7 +346,8 @@ (define (user-owned? file) ;; It can take a while before the shell commands are executed. (marionette-eval '(use-modules (rnrs io ports)) marionette) (wait-for-file "/root/logged-in" marionette - #:read 'get-string-all))) + #:read 'get-string-all + #:timeout 30))) (test-equal "getlogin on tty1" "\"root\"" @@ -360,7 +361,8 @@ (define (user-owned? file) ;; It can take a while before the shell commands are executed. (marionette-eval '(use-modules (rnrs io ports)) marionette) (wait-for-file "/root/login-id" marionette - #:read 'get-string-all))) + #:read 'get-string-all + #:timeout 30))) ;; There should be one utmpx entry for the user logged in on tty1. (test-equal "utmpx entry" From patchwork Sun Mar 13 05:43:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 37772 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D8BF027BBE9; Sun, 13 Mar 2022 05:45:29 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BE72127BBEA for ; Sun, 13 Mar 2022 05:45:28 +0000 (GMT) Received: from localhost ([::1]:42132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nTH2l-0005E5-Rm for patchwork@mira.cbaines.net; Sun, 13 Mar 2022 00:45:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTH2N-0005C4-CV for guix-patches@gnu.org; Sun, 13 Mar 2022 00:45:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:47519) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nTH2N-0007SA-3L for guix-patches@gnu.org; Sun, 13 Mar 2022 00:45:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nTH2N-0007sC-2A for guix-patches@gnu.org; Sun, 13 Mar 2022 00:45:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54368] [PATCH 2/4] tests: install: Streamline 'qemu-command/writable-image'. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Mar 2022 05:45:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54368 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54368@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 54368-submit@debbugs.gnu.org id=B54368.164715029230199 (code B ref 54368); Sun, 13 Mar 2022 05:45:03 +0000 Received: (at 54368) by debbugs.gnu.org; 13 Mar 2022 05:44:52 +0000 Received: from localhost ([127.0.0.1]:41409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTH2C-0007r1-8D for submit@debbugs.gnu.org; Sun, 13 Mar 2022 00:44:52 -0500 Received: from mail-qk1-f181.google.com ([209.85.222.181]:34772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTH2A-0007qY-Dh for 54368@debbugs.gnu.org; Sun, 13 Mar 2022 00:44:50 -0500 Received: by mail-qk1-f181.google.com with SMTP id 1so9738762qke.1 for <54368@debbugs.gnu.org>; Sat, 12 Mar 2022 21:44:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jxzUKyzPB6YDczelGkxCT4nUeEucVvKs1dGfgMu6LNo=; b=qy93ONtJrhV/OEuKQwS5k9ywmlYaMc72JJFf54pisE2GbSWIXBNcwEZbVa47eBjZCt MxfDICciCbRUi9yE8qaY896zMW30j18WWcDIDdSsihxxehPRqHSPwZg3P9/JufcxNBib rqehy3FhJIIQWmcYmOZ1NHeQsN9jHHxcaxzeX9vtin/qT1bh8lL3Mo9OvKJTGTXb1Ahl Lx5i4egXEg5ny1cfDHzFOlA9BiL0mHFPTEES92hLlbUtUzS57HFqGaRvaUW6OCkGrnAG qEZE64Sbx9VSBGPP4USa+i+WB/0diaVs4fTYk2SLJIrIivo4OuDJbDoSIvstJpNlsrM9 +EDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jxzUKyzPB6YDczelGkxCT4nUeEucVvKs1dGfgMu6LNo=; b=ywS1oh8zoETXMmUM5nnz/nLV4wVuOnlHc79D3yMCTlNKJWS1TmhjuBaB/ndMnFlmMa Y5tGQBATWPBidf3BD8zbtGc4xu2dv/3tbm0DeH64H+b+HXKnsOLTKuwD1o6rPdpnqhru JBc7VsLw2DTdJbu9b4AKYmi6CsT2uz00mbG1t4Gp6RxvpmBpSo2THINtIlAVOOhJyH3w DWXtmIGDeK+SIfxhDbJuGjw23SPI8ZTG6Bea9b1Y+vFTJskG8Va0/thryszwi/RtycRI IrzbfS9EQiyu4eZj515C7oPZdXW2+ALAXRLde7+TTr0tGPQ8Awk7Tu+gOMjk+nP8qFQy MaHw== X-Gm-Message-State: AOAM5326EDbVcS85EgzLl2ytfehPz40yfnUWV25s3o3R/j//eZtlmVYX KL8T/Bjco5ET9S9tFgk2RlJam5c68Lg= X-Google-Smtp-Source: ABdhPJwUFbe1OZkyE5Mgttbdv4OkieHHr/van4DgpSGCwk7oQz4AGhSVa/0ZoA5Zv/V3ciz+wH5JNg== X-Received: by 2002:a37:bac6:0:b0:663:5fde:226f with SMTP id k189-20020a37bac6000000b006635fde226fmr11318697qkf.137.1647150284699; Sat, 12 Mar 2022 21:44:44 -0800 (PST) Received: from localhost.localdomain (dsl-153-119.b2b2c.ca. [66.158.153.119]) by smtp.gmail.com with ESMTPSA id v129-20020a379387000000b0064936bab2fcsm6376657qkd.48.2022.03.12.21.44.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Mar 2022 21:44:44 -0800 (PST) From: Maxim Cournoyer Date: Sun, 13 Mar 2022 00:43:53 -0500 Message-Id: <20220313054356.17578-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220313054356.17578-1-maxim.cournoyer@gmail.com> References: <20220313054356.17578-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/tests/install.scm (qemu-command/writable-image): Replace the use of a writable backing file by the use of the '-snapshot' option, and rename to... (qemu-command*): ... this, adjusting all calls. --- gnu/tests/install.scm | 61 +++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 37 deletions(-) diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index ae8c6051f1..d1f8cc1c6d 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -341,29 +341,16 @@ (define marionette (gexp->derivation "installation" install #:substitutable? #f))) ;too big -(define* (qemu-command/writable-image image - #:key - (uefi-support? #f) - (memory-size 256)) - "Return as a monadic value the command to run QEMU on a writable copy of -IMAGE, a disk image. The QEMU VM has access to MEMORY-SIZE MiB of RAM." +(define* (qemu-command* image #:key (uefi-support? #f) (memory-size 256)) + "Return as a monadic value the command to run QEMU with a writable overlay +above IMAGE, a disk image. The QEMU VM has access to MEMORY-SIZE MiB of RAM." (mlet* %store-monad ((system (current-system)) (uefi-firmware -> (and uefi-support? (uefi-firmware system)))) - (return #~(let ((image #$image)) - ;; First we need a writable copy of the image. - (format #t "creating writable image from '~a'...~%" image) - (unless (zero? (system* #+(file-append qemu-minimal - "/bin/qemu-img") - "create" "-f" "qcow2" "-F" "qcow2" - "-o" - (string-append "backing_file=" image) - "disk.img")) - (error "failed to create writable QEMU image" image)) - - (chmod "disk.img" #o644) + (return #~(begin `(,(string-append #$qemu-minimal "/bin/" #$(qemu-command system)) + "-snapshot" ;for the volatile, writable overlay ,@(if (file-exists? "/dev/kvm") '("-enable-kvm") '()) @@ -371,7 +358,7 @@ (define* (qemu-command/writable-image image '("-bios" #$uefi-firmware) '()) "-no-reboot" "-m" #$(number->string memory-size) - "-drive" "file=disk.img,if=virtio"))))) + "-drive" (format #f "file=~a,if=virtio" #$image)))))) (define %test-installed-os (system-test @@ -382,7 +369,7 @@ (define %test-installed-os build (current-guix) and then store a couple of full system images.") (value (mlet* %store-monad ((image (run-install %minimal-os %minimal-os-source)) - (command (qemu-command/writable-image image))) + (command (qemu-command* image))) (run-basic-test %minimal-os command "installed-os"))))) @@ -399,7 +386,7 @@ (define %test-installed-extlinux-os (list syslinux) #:script %extlinux-gpt-installation-script)) - (command (qemu-command/writable-image image))) + (command (qemu-command* image))) (run-basic-test %minimal-extlinux-os command "installed-extlinux-os"))))) @@ -476,7 +463,7 @@ (define %test-iso-image-installer %simple-installation-script-for-/dev/vda #:installation-image-type 'uncompressed-iso9660)) - (command (qemu-command/writable-image image))) + (command (qemu-command* image))) (run-basic-test %minimal-os-on-vda command name))))) @@ -531,7 +518,7 @@ (define %test-separate-home-os %separate-home-os-source #:script %simple-installation-script)) - (command (qemu-command/writable-image image))) + (command (qemu-command* image))) (run-basic-test %separate-home-os command "separate-home-os"))))) @@ -608,7 +595,7 @@ (define %test-separate-store-os %separate-store-os-source #:script %separate-store-installation-script)) - (command (qemu-command/writable-image image))) + (command (qemu-command* image))) (run-basic-test %separate-store-os command "separate-store-os"))))) @@ -690,7 +677,7 @@ (define %test-raid-root-os #:script %raid-root-installation-script #:target-size (* 3200 MiB))) - (command (qemu-command/writable-image image))) + (command (qemu-command* image))) (run-basic-test %raid-root-os `(,@command) "raid-root-os"))))) @@ -823,7 +810,7 @@ (define %test-encrypted-root-os %encrypted-root-os-source #:script %encrypted-root-installation-script)) - (command (qemu-command/writable-image image))) + (command (qemu-command* image))) (run-basic-test %encrypted-root-os command "encrypted-root-os" #:initialization enter-luks-passphrase))))) @@ -909,7 +896,7 @@ (define %test-lvm-separate-home-os %lvm-separate-home-installation-script #:packages (list lvm2-static) #:target-size (* 3200 MiB))) - (command (qemu-command/writable-image image))) + (command (qemu-command* image))) (run-basic-test %lvm-separate-home-os `(,@command) "lvm-separate-home-os"))))) @@ -1009,7 +996,7 @@ (define %test-encrypted-root-not-boot-os %encrypted-root-not-boot-os-source #:script %encrypted-root-not-boot-installation-script)) - (command (qemu-command/writable-image image))) + (command (qemu-command* image))) (run-basic-test %encrypted-root-not-boot-os command "encrypted-root-not-boot-os" #:initialization enter-luks-passphrase))))) @@ -1085,7 +1072,7 @@ (define %test-btrfs-root-os %btrfs-root-os-source #:script %btrfs-root-installation-script)) - (command (qemu-command/writable-image image))) + (command (qemu-command* image))) (run-basic-test %btrfs-root-os command "btrfs-root-os"))))) @@ -1153,7 +1140,7 @@ (define %test-btrfs-raid-root-os %btrfs-raid-root-os-source #:script %btrfs-raid-root-installation-script #:target-size (* 2800 MiB))) - (command (qemu-command/writable-image image))) + (command (qemu-command* image))) (run-basic-test %btrfs-raid-root-os `(,@command) "btrfs-raid-root-os"))))) @@ -1245,7 +1232,7 @@ (define %test-btrfs-root-on-subvolume-os %btrfs-root-on-subvolume-os-source #:script %btrfs-root-on-subvolume-installation-script)) - (command (qemu-command/writable-image image))) + (command (qemu-command* image))) (run-basic-test %btrfs-root-on-subvolume-os command "btrfs-root-on-subvolume-os"))))) @@ -1319,7 +1306,7 @@ (define %test-jfs-root-os %jfs-root-os-source #:script %jfs-root-installation-script)) - (command (qemu-command/writable-image image))) + (command (qemu-command* image))) (run-basic-test %jfs-root-os command "jfs-root-os"))))) @@ -1392,7 +1379,7 @@ (define %test-f2fs-root-os %f2fs-root-os-source #:script %f2fs-root-installation-script)) - (command (qemu-command/writable-image image))) + (command (qemu-command* image))) (run-basic-test %f2fs-root-os command "f2fs-root-os"))))) @@ -1465,7 +1452,7 @@ (define %test-xfs-root-os %xfs-root-os-source #:script %xfs-root-installation-script)) - (command (qemu-command/writable-image image))) + (command (qemu-command* image))) (run-basic-test %xfs-root-os command "xfs-root-os"))))) @@ -1748,9 +1735,9 @@ (define* (guided-installation-test name #:desktop? desktop? #:encrypted? encrypted? #:uefi-support? uefi-support?)))) - (command (qemu-command/writable-image image - #:uefi-support? uefi-support? - #:memory-size 512))) + (command (qemu-command* image + #:uefi-support? uefi-support? + #:memory-size 512))) (run-basic-test target-os command name #:initialization (and encrypted? enter-luks-passphrase) #:root-password %root-password From patchwork Sun Mar 13 05:43:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 37774 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0FC5F27BBEA; Sun, 13 Mar 2022 05:45:34 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id EE69327BBE9 for ; Sun, 13 Mar 2022 05:45:32 +0000 (GMT) Received: from localhost ([::1]:42184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nTH2q-0005Gd-4G for patchwork@mira.cbaines.net; Sun, 13 Mar 2022 00:45:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTH2N-0005CE-Qk for guix-patches@gnu.org; Sun, 13 Mar 2022 00:45:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:47520) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nTH2N-0007Ua-I6 for guix-patches@gnu.org; Sun, 13 Mar 2022 00:45:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nTH2N-0007sL-Gf for guix-patches@gnu.org; Sun, 13 Mar 2022 00:45:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54368] [PATCH 3/4] tests: install: Enable the use of multiple disk devices for tests. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Mar 2022 05:45:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54368 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54368@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 54368-submit@debbugs.gnu.org id=B54368.164715029730221 (code B ref 54368); Sun, 13 Mar 2022 05:45:03 +0000 Received: (at 54368) by debbugs.gnu.org; 13 Mar 2022 05:44:57 +0000 Received: from localhost ([127.0.0.1]:41413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTH2G-0007rM-PF for submit@debbugs.gnu.org; Sun, 13 Mar 2022 00:44:57 -0500 Received: from mail-qt1-f182.google.com ([209.85.160.182]:37779) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTH2D-0007qo-Se for 54368@debbugs.gnu.org; Sun, 13 Mar 2022 00:44:54 -0500 Received: by mail-qt1-f182.google.com with SMTP id n11so5111677qtk.4 for <54368@debbugs.gnu.org>; Sat, 12 Mar 2022 21:44:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1AdbyJSP/ZHSXrZCiAF8sT1AIBAB5ej5/xbmqRVMjpk=; b=Na9ZyeEijMGTPlrtAQyTME4nfzk3l4xHT2ubFMNDOPFJXCRH3MkUSLQ/tADQ8OnBg0 2bFoJNrMIewkIDa38qosuYo9fWCXa+ol7D88puktrih2fe6+cKxMtZztgmX/fs7Wsaiu 7z/dB5tdyFmsofxiqp56g01G4k93t0bwzPlQViirPNRzwEyPdM+TlFzYZOlbNN0KnKlH ZLQzrmXGc50PtUsoqNilh1zK5L9/V3pezqkjUXkKtESloJLvCDJI6I9m7o9nDOBPJla/ o0FL5y1rVvQoAbSqEsc7bn3EQ+l1AErWduUIwjP2ekRJ5FoNo1MOskkGp7ddYrYVzK09 W01g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1AdbyJSP/ZHSXrZCiAF8sT1AIBAB5ej5/xbmqRVMjpk=; b=x8eoqc5tyQCMktTnYiqzAsDvTF+Cao92n0k9ooQm1y6K8XL8iSbJwTXZjklBHEex0p vAUMW/XsyokUZruqYCbfHdR/NlJE4hF/XvLiYJwWttnp+WOsdIT68oJ7rhNizhRQIsu4 mG++5z9vMGw+8lI4IkGBwsoBpyOxf/NDznycjal3b01I5sF90AsLOG81oBIWsh42oak5 GcynSZcjH5RuUx+rt9trswGdqBPwHMCjp1hgI1c8T9m+tjRfkKEoB96iIMbkvO9J+4Xk vOFGE3RfPnENLHDLeeMRIIwF/r/xO4NyAXJ8EjNNKtLL/YGHGwJyK6lO2/xX3ugew1fG sCUg== X-Gm-Message-State: AOAM5328WahTrSKBxyxXAb5GXUgP/kar2LQGlmbuCBH08xy+2sM7845G jR6rIDQTDCIB1jfJ/vgqAj8MBFIIIzU= X-Google-Smtp-Source: ABdhPJygNR6rJbtRvTFyKzm8eNT8pmoOqMJxc12BhIEADSPsFj6fHpm/4NjdHfUgrrYCcGyDWrXZYA== X-Received: by 2002:a05:622a:4cb:b0:2e1:ce8c:f097 with SMTP id q11-20020a05622a04cb00b002e1ce8cf097mr613504qtx.395.1647150287747; Sat, 12 Mar 2022 21:44:47 -0800 (PST) Received: from localhost.localdomain (dsl-153-119.b2b2c.ca. [66.158.153.119]) by smtp.gmail.com with ESMTPSA id v129-20020a379387000000b0064936bab2fcsm6376657qkd.48.2022.03.12.21.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Mar 2022 21:44:47 -0800 (PST) From: Maxim Cournoyer Date: Sun, 13 Mar 2022 00:43:54 -0500 Message-Id: <20220313054356.17578-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220313054356.17578-1-maxim.cournoyer@gmail.com> References: <20220313054356.17578-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/tests/install.scm (run-install)[NUMBER-OF-DISKS]: Add argument, update doc and adjust. The returned gexp output is now a list of images rather than the image itself. * gnu/tests/install.scm (qemu-command*): Rename IMAGE argument to IMAGES, to account for the above change. Adjust doc. Generate a QEMU '-drive' argument for each disk image. (%test-installed-os): Rename the IMAGE variable to IMAGES. (%test-installed-extlinux-os): Likewise. (%test-iso-image-installer): Likewise. (%test-separate-home-os): Likewise. (%test-separate-store-os): Likewise. (%test-raid-root-os): Likewise. (%test-encrypted-root-os): Likewise. (%test-lvm-separate-home-os): Likewise. (%test-encrypted-root-not-boot-os): Likewise. (%test-btrfs-root-os): Likewise. (%test-btrfs-raid-root-os): Likewise. (%test-btrfs-root-on-subvolume-os): Likewise. (%test-jfs-root-os): Likewise. (%test-f2fs-root-os): Likewise. (%test-xfs-root-os): Likewise. (guided-installation-test): Likewise. --- gnu/tests/install.scm | 244 +++++++++++++++++++++++------------------- 1 file changed, 132 insertions(+), 112 deletions(-) diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index d1f8cc1c6d..59e76c86e7 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -240,12 +240,14 @@ (define* (run-install target-os target-os-source (uefi-support? #f) (installation-image-type 'efi-raw) (install-size 'guess) - (target-size (* 2200 MiB))) + (target-size (* 2200 MiB)) + (number-of-disks 1)) "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." - +OS to install TARGET-OS. Return the VM disk images of TARGET-SIZE bytes +containing the installed system. Unless providing OS, the PACKAGES will be +added to the packages defined in INSTALLATION-OS (from (gnu system install)). +NUMBER-OF-DISKS can be used to specify a number of disks different than one, +such as for RAID systems." (mlet* %store-monad ((_ (set-grafting #f)) (system (current-system)) @@ -276,13 +278,18 @@ (define install (gnu build marionette)) #~(begin (use-modules (guix build utils) - (gnu build marionette)) + (gnu build marionette) + (srfi srfi-1)) (set-path-environment-variable "PATH" '("bin") (list #$qemu-minimal)) - (system* "qemu-img" "create" "-f" "qcow2" - #$output #$(number->string target-size)) + (mkdir-p #$output) + (for-each (lambda (n) + (system* "qemu-img" "create" "-f" "qcow2" + (format #f "~a/disk~a.qcow2" #$output n) + #$(number->string target-size))) + (iota #$number-of-disks)) (define marionette (make-marionette @@ -303,8 +310,12 @@ (define marionette (error "unsupported installation-image-type:" installation-image-type))) - "-drive" - ,(string-append "file=" #$output ",if=virtio") + ,@(append-map + (lambda (n) + (list "-drive" + (format #f "file=~a/disk~a.qcow2,if=virtio" + #$output n))) + (iota #$number-of-disks)) ,@(if (file-exists? "/dev/kvm") '("-enable-kvm") '())))) @@ -338,16 +349,23 @@ (define marionette (exit #$(and gui-test (gui-test #~marionette))))))) - (gexp->derivation "installation" install - #:substitutable? #f))) ;too big + (mlet %store-monad ((images-dir (gexp->derivation "installation" + install + #:substitutable? #f))) ;too big + (return (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (find-files #$images-dir))))))) -(define* (qemu-command* image #:key (uefi-support? #f) (memory-size 256)) +(define* (qemu-command* images #:key (uefi-support? #f) (memory-size 256)) "Return as a monadic value the command to run QEMU with a writable overlay -above IMAGE, a disk image. The QEMU VM has access to MEMORY-SIZE MiB of RAM." +on top of IMAGES, a list disk images. The QEMU VM has access to MEMORY-SIZE +MiB of RAM." (mlet* %store-monad ((system (current-system)) (uefi-firmware -> (and uefi-support? (uefi-firmware system)))) (return #~(begin + (use-modules (srfi srfi-1)) `(,(string-append #$qemu-minimal "/bin/" #$(qemu-command system)) "-snapshot" ;for the volatile, writable overlay @@ -358,7 +376,10 @@ (define* (qemu-command* image #:key (uefi-support? #f) (memory-size 256)) '("-bios" #$uefi-firmware) '()) "-no-reboot" "-m" #$(number->string memory-size) - "-drive" (format #f "file=~a,if=virtio" #$image)))))) + ,@(append-map (lambda (image) + (list "-drive" (format #f "file=~a,if=virtio" + image))) + #$images)))))) (define %test-installed-os (system-test @@ -368,8 +389,8 @@ (define %test-installed-os This test is expensive in terms of CPU and storage usage since we need to build (current-guix) and then store a couple of full system images.") (value - (mlet* %store-monad ((image (run-install %minimal-os %minimal-os-source)) - (command (qemu-command* image))) + (mlet* %store-monad ((images (run-install %minimal-os %minimal-os-source)) + (command (qemu-command* images))) (run-basic-test %minimal-os command "installed-os"))))) @@ -380,13 +401,13 @@ (define %test-installed-extlinux-os "Test basic functionality of an OS booted with an extlinux bootloader. As per %test-installed-os, this test is expensive in terms of CPU and storage.") (value - (mlet* %store-monad ((image (run-install %minimal-extlinux-os - %minimal-extlinux-os-source - #:packages - (list syslinux) - #:script - %extlinux-gpt-installation-script)) - (command (qemu-command* image))) + (mlet* %store-monad ((images (run-install %minimal-extlinux-os + %minimal-extlinux-os-source + #:packages + (list syslinux) + #:script + %extlinux-gpt-installation-script)) + (command (qemu-command* images))) (run-basic-test %minimal-extlinux-os command "installed-extlinux-os"))))) @@ -456,14 +477,14 @@ (define %test-iso-image-installer (description "") (value - (mlet* %store-monad ((image (run-install - %minimal-os-on-vda - %minimal-os-on-vda-source - #:script - %simple-installation-script-for-/dev/vda - #:installation-image-type - 'uncompressed-iso9660)) - (command (qemu-command* image))) + (mlet* %store-monad ((images (run-install + %minimal-os-on-vda + %minimal-os-on-vda-source + #:script + %simple-installation-script-for-/dev/vda + #:installation-image-type + 'uncompressed-iso9660)) + (command (qemu-command* images))) (run-basic-test %minimal-os-on-vda command name))))) @@ -514,11 +535,11 @@ (define %test-separate-home-os partition. In particular, home directories must be correctly created (see ).") (value - (mlet* %store-monad ((image (run-install %separate-home-os - %separate-home-os-source - #:script - %simple-installation-script)) - (command (qemu-command* image))) + (mlet* %store-monad ((images (run-install %separate-home-os + %separate-home-os-source + #:script + %simple-installation-script)) + (command (qemu-command* images))) (run-basic-test %separate-home-os command "separate-home-os"))))) @@ -591,11 +612,11 @@ (define %test-separate-store-os "Test basic functionality of an OS installed like one would do by hand, where /gnu lives on a separate partition.") (value - (mlet* %store-monad ((image (run-install %separate-store-os - %separate-store-os-source - #:script - %separate-store-installation-script)) - (command (qemu-command* image))) + (mlet* %store-monad ((images (run-install %separate-store-os + %separate-store-os-source + #:script + %separate-store-installation-script)) + (command (qemu-command* images))) (run-basic-test %separate-store-os command "separate-store-os"))))) @@ -672,12 +693,12 @@ (define %test-raid-root-os "Test functionality of an OS installed with a RAID root partition managed by 'mdadm'.") (value - (mlet* %store-monad ((image (run-install %raid-root-os - %raid-root-os-source - #:script - %raid-root-installation-script - #:target-size (* 3200 MiB))) - (command (qemu-command* image))) + (mlet* %store-monad ((images (run-install %raid-root-os + %raid-root-os-source + #:script + %raid-root-installation-script + #:target-size (* 3200 MiB))) + (command (qemu-command* images))) (run-basic-test %raid-root-os `(,@command) "raid-root-os"))))) @@ -806,11 +827,11 @@ (define %test-encrypted-root-os This test is expensive in terms of CPU and storage usage since we need to build (current-guix) and then store a couple of full system images.") (value - (mlet* %store-monad ((image (run-install %encrypted-root-os - %encrypted-root-os-source - #:script - %encrypted-root-installation-script)) - (command (qemu-command* image))) + (mlet* %store-monad ((images (run-install %encrypted-root-os + %encrypted-root-os-source + #:script + %encrypted-root-installation-script)) + (command (qemu-command* images))) (run-basic-test %encrypted-root-os command "encrypted-root-os" #:initialization enter-luks-passphrase))))) @@ -890,13 +911,13 @@ (define %test-lvm-separate-home-os (description "Test functionality of an OS installed with a LVM /home partition") (value - (mlet* %store-monad ((image (run-install %lvm-separate-home-os - %lvm-separate-home-os-source - #:script - %lvm-separate-home-installation-script - #:packages (list lvm2-static) - #:target-size (* 3200 MiB))) - (command (qemu-command* image))) + (mlet* %store-monad ((images (run-install %lvm-separate-home-os + %lvm-separate-home-os-source + #:script + %lvm-separate-home-installation-script + #:packages (list lvm2-static) + #:target-size (* 3200 MiB))) + (command (qemu-command* images))) (run-basic-test %lvm-separate-home-os `(,@command) "lvm-separate-home-os"))))) @@ -992,11 +1013,11 @@ (define %test-encrypted-root-not-boot-os store a couple of full system images.") (value (mlet* %store-monad - ((image (run-install %encrypted-root-not-boot-os - %encrypted-root-not-boot-os-source - #:script - %encrypted-root-not-boot-installation-script)) - (command (qemu-command* image))) + ((images (run-install %encrypted-root-not-boot-os + %encrypted-root-not-boot-os-source + #:script + %encrypted-root-not-boot-installation-script)) + (command (qemu-command* images))) (run-basic-test %encrypted-root-not-boot-os command "encrypted-root-not-boot-os" #:initialization enter-luks-passphrase))))) @@ -1068,11 +1089,11 @@ (define %test-btrfs-root-os This test is expensive in terms of CPU and storage usage since we need to build (current-guix) and then store a couple of full system images.") (value - (mlet* %store-monad ((image (run-install %btrfs-root-os - %btrfs-root-os-source - #:script - %btrfs-root-installation-script)) - (command (qemu-command* image))) + (mlet* %store-monad ((images (run-install %btrfs-root-os + %btrfs-root-os-source + #:script + %btrfs-root-installation-script)) + (command (qemu-command* images))) (run-basic-test %btrfs-root-os command "btrfs-root-os"))))) @@ -1136,11 +1157,11 @@ (define %test-btrfs-raid-root-os RAID-0 (stripe) root partition.") (value (mlet* %store-monad - ((image (run-install %btrfs-raid-root-os - %btrfs-raid-root-os-source - #:script %btrfs-raid-root-installation-script - #:target-size (* 2800 MiB))) - (command (qemu-command* image))) + ((images (run-install %btrfs-raid-root-os + %btrfs-raid-root-os-source + #:script %btrfs-raid-root-installation-script + #:target-size (* 2800 MiB))) + (command (qemu-command* images))) (run-basic-test %btrfs-raid-root-os `(,@command) "btrfs-raid-root-os"))))) @@ -1227,12 +1248,11 @@ (define %test-btrfs-root-on-subvolume-os build (current-guix) and then store a couple of full system images.") (value (mlet* %store-monad - ((image - (run-install %btrfs-root-on-subvolume-os - %btrfs-root-on-subvolume-os-source - #:script - %btrfs-root-on-subvolume-installation-script)) - (command (qemu-command* image))) + ((images (run-install %btrfs-root-on-subvolume-os + %btrfs-root-on-subvolume-os-source + #:script + %btrfs-root-on-subvolume-installation-script)) + (command (qemu-command* images))) (run-basic-test %btrfs-root-on-subvolume-os command "btrfs-root-on-subvolume-os"))))) @@ -1302,11 +1322,11 @@ (define %test-jfs-root-os This test is expensive in terms of CPU and storage usage since we need to build (current-guix) and then store a couple of full system images.") (value - (mlet* %store-monad ((image (run-install %jfs-root-os - %jfs-root-os-source - #:script - %jfs-root-installation-script)) - (command (qemu-command* image))) + (mlet* %store-monad ((images (run-install %jfs-root-os + %jfs-root-os-source + #:script + %jfs-root-installation-script)) + (command (qemu-command* images))) (run-basic-test %jfs-root-os command "jfs-root-os"))))) @@ -1375,11 +1395,11 @@ (define %test-f2fs-root-os This test is expensive in terms of CPU and storage usage since we need to build (current-guix) and then store a couple of full system images.") (value - (mlet* %store-monad ((image (run-install %f2fs-root-os - %f2fs-root-os-source - #:script - %f2fs-root-installation-script)) - (command (qemu-command* image))) + (mlet* %store-monad ((images (run-install %f2fs-root-os + %f2fs-root-os-source + #:script + %f2fs-root-installation-script)) + (command (qemu-command* images))) (run-basic-test %f2fs-root-os command "f2fs-root-os"))))) @@ -1448,11 +1468,11 @@ (define %test-xfs-root-os This test is expensive in terms of CPU and storage usage since we need to build (current-guix) and then store a couple of full system images.") (value - (mlet* %store-monad ((image (run-install %xfs-root-os - %xfs-root-os-source - #:script - %xfs-root-installation-script)) - (command (qemu-command* image))) + (mlet* %store-monad ((images (run-install %xfs-root-os + %xfs-root-os-source + #:script + %xfs-root-installation-script)) + (command (qemu-command* images))) (run-basic-test %xfs-root-os command "xfs-root-os"))))) @@ -1720,22 +1740,22 @@ (define* (guided-installation-test name "Install an OS using the graphical installer and test it.") (value (mlet* %store-monad - ((image (run-install target-os '(this is unused) - #:script #f - #:os installation-os-for-gui-tests - #:uefi-support? uefi-support? - #:install-size install-size - #:target-size target-size - #:installation-image-type - 'uncompressed-iso9660 - #:gui-test - (lambda (marionette) - (gui-test-program - marionette - #:desktop? desktop? - #:encrypted? encrypted? - #:uefi-support? uefi-support?)))) - (command (qemu-command* image + ((images (run-install target-os '(this is unused) + #:script #f + #:os installation-os-for-gui-tests + #:uefi-support? uefi-support? + #:install-size install-size + #:target-size target-size + #:installation-image-type + 'uncompressed-iso9660 + #:gui-test + (lambda (marionette) + (gui-test-program + marionette + #:desktop? desktop? + #:encrypted? encrypted? + #:uefi-support? uefi-support?)))) + (command (qemu-command* images #:uefi-support? uefi-support? #:memory-size 512))) (run-basic-test target-os command name From patchwork Sun Mar 13 05:43:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 37773 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4E12727BBE9; Sun, 13 Mar 2022 05:45:30 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C84F027BBEB for ; Sun, 13 Mar 2022 05:45:28 +0000 (GMT) Received: from localhost ([::1]:42130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nTH2l-0005E2-Sk for patchwork@mira.cbaines.net; Sun, 13 Mar 2022 00:45:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTH2O-0005Ce-9H for guix-patches@gnu.org; Sun, 13 Mar 2022 00:45:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:47521) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nTH2O-0007Yk-0d for guix-patches@gnu.org; Sun, 13 Mar 2022 00:45:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nTH2N-0007sS-VR for guix-patches@gnu.org; Sun, 13 Mar 2022 00:45:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54368] [PATCH 4/4] tests: install: Add two new Btrfs RAID10 install test. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Mar 2022 05:45:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54368 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54368@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 54368-submit@debbugs.gnu.org id=B54368.164715029930229 (code B ref 54368); Sun, 13 Mar 2022 05:45:03 +0000 Received: (at 54368) by debbugs.gnu.org; 13 Mar 2022 05:44:59 +0000 Received: from localhost ([127.0.0.1]:41415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTH2I-0007rV-It for submit@debbugs.gnu.org; Sun, 13 Mar 2022 00:44:58 -0500 Received: from mail-qt1-f172.google.com ([209.85.160.172]:40512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTH2F-0007qs-Lh for 54368@debbugs.gnu.org; Sun, 13 Mar 2022 00:44:56 -0500 Received: by mail-qt1-f172.google.com with SMTP id g7so4105688qtg.7 for <54368@debbugs.gnu.org>; Sat, 12 Mar 2022 21:44:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lW2SM29s91L5EZOTzJWueMpB5Qz0ejBxm7L3Q/dF5Qo=; b=q03weZ5fsw7HWiHTuBQAQsSX8U36x4MdXJXMIds11EICbwlJlRv/UN4wQvIVnwW6jy OahW2RuCM7RG7q33v4YCWT/3MiPryoMDhQs6sZwiBgXThFx55XVFxSfCQM1z4wsmRChp zkSM+FIhQgy+7FofpgXcCG97tUNSYEM8Pd3Srr324Atdy/jZoqDXWTdOgSU1K5IEtV70 CRVi/cm5BvYeQQbVXZdTLJ8UXtRc2IrisdR+ULytB55Ksks43SlgKGuiKShxJ6ig/dVi afaJhBLlhu9pv2aoDZ7k/rWgOBOanWs9YRHMzLPdyiX23z493b7QgRjmJzRYCBZaK5xg weug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lW2SM29s91L5EZOTzJWueMpB5Qz0ejBxm7L3Q/dF5Qo=; b=H2GueU2vmIBmaY4z3wHSPCnQP1LmNGrKBEYWDPPNqPm3eygohm0+etOscM6E9/1Stk 1ZRTAHCLIMY59hL2tDIXMjgisxg4oKnD2F4SNVEpJ1B1AafR9WbUfBD901LWuFuauOkm 3nPO5taQ9K/5p+76TKa1FWeS7eC9cSEGJD2qjuZ9kOnyGoDKL6Nl3/7CWKNr+SKjA2lm uj5y+L4jLu8UYmW73oRoG3aGgIWZAxz4LiHDGOMGMWTgLPJXh5OwH/08xze+/YYdAQPP r3YoWeBoFyfJhMwaYivUzv2a72wb0eEA75XIS5x8C7aDzIQrv7rkrs1ArkToBhy02Bvp 68vQ== X-Gm-Message-State: AOAM533cTsX9Fhty+BlRc/zZ1vMAbH6n1trFtk2md7/5FzHFE19upu0o zzvB85GttvZ1U7qDyLvEsO8VJ10kqC0= X-Google-Smtp-Source: ABdhPJyAf0XTblLnufSQ/vpow/0TIVFzCc2v3zZlvFZjGdK/qadR/ZImiazgDVP7WrjVl1B9xdqcAQ== X-Received: by 2002:ac8:578f:0:b0:2e1:ce21:43a9 with SMTP id v15-20020ac8578f000000b002e1ce2143a9mr1061555qta.521.1647150290000; Sat, 12 Mar 2022 21:44:50 -0800 (PST) Received: from localhost.localdomain (dsl-153-119.b2b2c.ca. [66.158.153.119]) by smtp.gmail.com with ESMTPSA id v129-20020a379387000000b0064936bab2fcsm6376657qkd.48.2022.03.12.21.44.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Mar 2022 21:44:49 -0800 (PST) From: Maxim Cournoyer Date: Sun, 13 Mar 2022 00:43:55 -0500 Message-Id: <20220313054356.17578-4-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220313054356.17578-1-maxim.cournoyer@gmail.com> References: <20220313054356.17578-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/tests/install.scm (%btrfs-raid10-root-os) (%btrfs-raid10-root-os): New variables. (%btrfs-raid10-root-installation-script): Likewise. (%test-btrfs-raid10-root-images): Likewise. (%test-btrfs-raid10-root-os, %test-btrfs-raid10-root-os-degraded): New tests. --- gnu/tests/install.scm | 113 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 112 insertions(+), 1 deletion(-) diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index 59e76c86e7..79a7490e7a 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -4,7 +4,7 @@ ;;; Copyright © 2020 Mathieu Othacehe ;;; Copyright © 2020 Danny Milosavljevic ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen -;;; Copyright © 2020, 2021 Maxim Cournoyer +;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -70,6 +70,8 @@ (define-module (gnu tests install) %test-btrfs-root-os %test-btrfs-root-on-subvolume-os %test-btrfs-raid-root-os + %test-btrfs-raid10-root-os + %test-btrfs-raid10-root-os-degraded %test-jfs-root-os %test-f2fs-root-os %test-xfs-root-os @@ -1256,6 +1258,115 @@ (define %test-btrfs-root-on-subvolume-os (run-basic-test %btrfs-root-on-subvolume-os command "btrfs-root-on-subvolume-os"))))) + +;;; +;;; Btrfs RAID10 root file system. +;;; + +(define-os-with-source (%btrfs-raid10-root-os + %btrfs-raid10-root-os-source) + ;; The OS we want to install. + (use-modules (gnu) (gnu tests) (srfi srfi-1)) + + (operating-system + (host-name "hurd") + (timezone "Europe/Paris") + (locale "en_US.UTF-8") + (bootloader (bootloader-configuration + (bootloader grub-bootloader) + (targets (list "/dev/vdb" "/dev/vdc" "/dev/vdd" "/dev/vde")))) + (kernel-arguments '("console=ttyS0")) + (file-systems (cons* (file-system + (device (uuid "16ff18e2-eb41-4324-8df5-80d3b53c411b")) + (mount-point "/") + (options "compress-force=zstd,degraded") + (type "btrfs")) + %base-file-systems)) + (users (cons (user-account + (name "charlie") + (group "users") + (supplementary-groups '("wheel" "audio" "video"))) + %base-user-accounts)) + (services (cons (service marionette-service-type + (marionette-configuration + (imported-modules '((gnu services herd) + (guix combinators))))) + %base-services)))) + +(define %btrfs-raid10-root-installation-script + ;; Shell script of a simple installation. + "\ +. /etc/profile +set -e -x +guix --version + +export GUIX_BUILD_OPTIONS=--no-grafts +ls -l /run/current-system/gc-roots +for d in vdb vdc vdd vde; do + parted --script /dev/$d mklabel gpt \\ + mkpart primary ext2 1M 2M \\ + mkpart primary ext2 2M 100% \\ + set 1 boot on \\ + set 1 bios_grub on +done + +# Create the RAID10 Btrfs array. +mkfs.btrfs -d raid10 -m raid1c4 /dev/{vdb2,vdc2,vdd2,vde2} \\ + --uuid 16ff18e2-eb41-4324-8df5-80d3b53c411b + +# Mount it, ready for installation. +mount UUID=16ff18e2-eb41-4324-8df5-80d3b53c411b -o compress-force=zstd /mnt + +herd start cow-store /mnt +mkdir /mnt/etc +cp /etc/target-config.scm /mnt/etc/config.scm +guix system build /mnt/etc/config.scm +guix system init /mnt/etc/config.scm /mnt --no-substitutes +sync +reboot\n") + +(define %test-btrfs-raid10-root-images + (mlet %store-monad + ((images (run-install %btrfs-raid10-root-os + %btrfs-raid10-root-os-source + #:script + %btrfs-raid10-root-installation-script + #:number-of-disks 4 + #:target-size (* 1100 MiB)))) + (return images))) + +(define %test-btrfs-raid10-root-os + (system-test + (name "btrfs-raid10-root-os") + (description + "Test basic functionality of an OS installed on top of a Btrfs RAID10 file +system spanning 4 disks. This test is expensive in terms of CPU and storage +usage since we need to build (current-guix) and then store a couple of full +system images.") + (value + (mlet* %store-monad + ((images %test-btrfs-raid10-root-images) + (command (qemu-command* images))) + (run-basic-test %btrfs-raid10-root-os command + "btrfs-raid10-root-os"))))) + +(define %test-btrfs-raid10-root-os-degraded + (system-test + (name "btrfs-raid10-root-os-degraded") + (description + "Test basic functionality of an OS installed on top of a Btrfs RAID10 file +system spanning 4 disks, degraded to 3 disks. This test is expensive in terms +of CPU and storage usage since we need to build (current-guix) and then store +a couple of full system images.") + (value + (mlet* %store-monad + ;; Drop the first image; this boots because the root file system uses + ;; the Btrfs "degraded" mount option. + ((images %test-btrfs-raid10-root-images) + (command (qemu-command* #~(cdr #$images)))) + (run-basic-test %btrfs-raid10-root-os command + "btrfs-raid10-root-os"))))) + ;;; ;;; JFS root file system.