From patchwork Tue Mar 31 02:32:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 21005 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 70E0827BBE1; Tue, 31 Mar 2020 03:33:15 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id BA5E527BBE4 for ; Tue, 31 Mar 2020 03:33:14 +0100 (BST) Received: from localhost ([::1]:59426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ6iI-0008BL-4f for patchwork@mira.cbaines.net; Mon, 30 Mar 2020 22:33:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54262) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ6iB-0008BC-8T for guix-patches@gnu.org; Mon, 30 Mar 2020 22:33:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJ6i6-0002Tw-UD for guix-patches@gnu.org; Mon, 30 Mar 2020 22:33:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52027) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJ6i6-0002Tm-Qh for guix-patches@gnu.org; Mon, 30 Mar 2020 22:33:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jJ6i6-0006QY-L2 for guix-patches@gnu.org; Mon, 30 Mar 2020 22:33:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40339] [PATCH] system: tests: Add a Btrfs RAID system test. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 31 Mar 2020 02:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40339 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40339@debbugs.gnu.org X-Debbugs-Original-To: guix-patches Received: via spool by submit@debbugs.gnu.org id=B.158562193524644 (code B ref -1); Tue, 31 Mar 2020 02:33:02 +0000 Received: (at submit) by debbugs.gnu.org; 31 Mar 2020 02:32:15 +0000 Received: from localhost ([127.0.0.1]:35340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJ6hL-0006PQ-3b for submit@debbugs.gnu.org; Mon, 30 Mar 2020 22:32:15 -0400 Received: from lists.gnu.org ([209.51.188.17]:59345) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJ6hJ-0006PH-I9 for submit@debbugs.gnu.org; Mon, 30 Mar 2020 22:32:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54160) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ6hI-00088n-2m for guix-patches@gnu.org; Mon, 30 Mar 2020 22:32:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJ6hG-00023L-Hs for guix-patches@gnu.org; Mon, 30 Mar 2020 22:32:12 -0400 Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]:45788) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJ6hG-000231-Bv for guix-patches@gnu.org; Mon, 30 Mar 2020 22:32:10 -0400 Received: by mail-qt1-x82a.google.com with SMTP id t17so17081461qtn.12 for ; Mon, 30 Mar 2020 19:32:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=MKI1/I2IKMXpBtfFgWRLjnPlnXSnPx2rIz22XHJufz8=; b=hqbr5czeqKGfr+w4CdzQbQnF3otLNKl9fi2J1IXU+O40/h/OsPKOapnzVbGFa7LdkN 8uSGw3fnffZspJIPyqrF13CgQLnkrsV615YXHoCuLhmmu31q+OeOHmRoOZjvcgah/JJb quDfqilP3GmejPjUUgeNgTmQWgVjtNaVoEVWsvAFf5zmCxSagb0infT6OovKzfmTGRBA PO9KJiqOEyUvblVFk9zzKev5wytm/p/WFu8nvH63rZtkdD2lelO42hrm6wQc3Ec0BWOL 0Q7ympEyWR+xk5YympCZZ1f9EY+XcpJcZ5RRF6MvN5TA5wXHdFTU6yg2yangVeAXL2qR PqIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=MKI1/I2IKMXpBtfFgWRLjnPlnXSnPx2rIz22XHJufz8=; b=hkdRWnv95Vjkqrk+TtTUzhvLrecT+LIkn6Q5x8mJCGfIhvog8gt7nrv/caDGsYzhp7 7lmILayxOYbdY1W2v1/m74An503rqL0s4pvTDvujDK2mGcC7G4VwJ6NVUoAf3GklWnC9 UQtSqtvqle3nZvI0URi8In0ATfvyKIqlOKzzr0jYQxU+l6S7DQig9h7QaMQRr3gBZViX VZxp/UgfBUZJfnAdxqFoJREo9wtjuM32qyZWkIkBEbtTT/MbRFVMaUH+g4ndgvapIV8T j/1CrqxjW9gRFZZ7qOBLT2LzjbLk1YrnFzhWDyGT1Sw3c8U6zPd/nf+Ke9g0fq3gwT1v TGOg== X-Gm-Message-State: ANhLgQ0iN+kMkBToYKAulAucs65H4KgwpXpV62otYLjBInl5xiM1y9Fy 9JvHU4tvaLfw6jLhfIXj0r0YpzykRGI= X-Google-Smtp-Source: ADFU+vvNCaYNYFCbbTxcyd5IecV3Z+J6tFfyvD41r2n4rV4U1ck4JjKvpaWP+h2ik3MiPnO0T/R9Zw== X-Received: by 2002:ac8:6f46:: with SMTP id n6mr2966784qtv.119.1585621929273; Mon, 30 Mar 2020 19:32:09 -0700 (PDT) Received: from hurd (dsl-159-222.b2b2c.ca. [66.158.159.222]) by smtp.gmail.com with ESMTPSA id m65sm12015719qke.109.2020.03.30.19.32.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 19:32:08 -0700 (PDT) From: Maxim Cournoyer Date: Mon, 30 Mar 2020 22:32:07 -0400 Message-ID: <875zelz23c.fsf@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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 Hello Guix! This adds a system test validating that installing on a Btrfs RAID0 array works (and indeed, it does, without anything new to code -- how refreshing :-)). From 024ba1459a9cdccffc87106b592dd98568ca1370 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 24 Mar 2020 12:45:10 -0400 Subject: [PATCH] system: tests: Add a Btrfs RAID system test. * gnu/tests/install.scm (%btrfs-raid-root-os) (%btrfs-raid-root-os-source, %btrfs-raid-root-installation-script) (%test-btrfs-raid-root-os): New variables. --- gnu/tests/install.scm | 70 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index b0b40f2764..cf0b14eda0 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2020 Mathieu Othacehe +;;; Copyright © 2020 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -57,6 +58,7 @@ %test-raid-root-os %test-encrypted-root-os %test-btrfs-root-os + %test-btrfs-raid-root-os %test-jfs-root-os %test-gui-installed-os @@ -849,6 +851,74 @@ build (current-guix) and then store a couple of full system images.") (command (qemu-command/writable-image image))) (run-basic-test %btrfs-root-os command "btrfs-root-os"))))) + + +;;; +;;; Btrfs RAID-0 root file system. +;;; +(define-os-with-source (%btrfs-raid-root-os %btrfs-raid-root-os-source) + ;; An OS whose root partition is a RAID partition. + (use-modules (gnu) (gnu tests)) + + (operating-system + (host-name "liberigilo") + (timezone "Europe/Paris") + (locale "en_US.utf8") + + (bootloader (bootloader-configuration + (bootloader grub-bootloader) + (target "/dev/vdb"))) + (kernel-arguments '("console=ttyS0")) + + (file-systems (cons (file-system + (device (file-system-label "root-fs")) + (mount-point "/") + (type "btrfs")) + %base-file-systems)) + (users %base-user-accounts) + (services (cons (service marionette-service-type + (marionette-configuration + (imported-modules '((gnu services herd) + (guix combinators))))) + %base-services)))) + +(define %btrfs-raid-root-installation-script + "\ +. /etc/profile +set -e -x +guix --version + +export GUIX_BUILD_OPTIONS=--no-grafts +parted --script /dev/vdb mklabel gpt \\ + mkpart primary ext2 1M 3M \\ + mkpart primary ext2 3M 1.4G \\ + mkpart primary ext2 1.4G 2.8G \\ + set 1 boot on \\ + set 1 bios_grub on +mkfs.btrfs -L root-fs -d raid0 -m raid0 /dev/vdb2 /dev/vdb3 +mount /dev/vdb2 /mnt +df -h /mnt +herd start cow-store /mnt +mkdir /mnt/etc +cp /etc/target-config.scm /mnt/etc/config.scm +guix system init /mnt/etc/config.scm /mnt --no-substitutes +sync +reboot\n") + +(define %test-btrfs-raid-root-os + (system-test + (name "btrfs-raid-root-os") + (description "Test functionality of an OS installed with a Btrfs +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/writable-image image))) + (run-basic-test %btrfs-raid-root-os `(,@command) "btrfs-raid-root-os"))))) + ;;; ;;; JFS root file system. -- 2.25.2