[PATCH] system: tests: Add a Btrfs RAID system test.

  • Done
  • quality assurance status badge
Details
2 participants
  • Christopher Baines
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Maxim Cournoyer
Severity
normal
M
M
Maxim Cournoyer wrote on 31 Mar 2020 04:32
(name . guix-patches)(address . guix-patches@gnu.org)
875zelz23c.fsf@gmail.com
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 <maxim.cournoyer@gmail.com>
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(+)

Toggle diff (97 lines)
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 <ludo@gnu.org>
;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; 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
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEJ9WGpPiQCFQyn/CfEmDkZILmNWIFAl6Cq6cACgkQEmDkZILm
NWIe6Q//d/dYpySwuQMToDQljVy16g+jrvyendQKmPzOV2gjAtc/H189NWGAlLxT
B4E3u9uVhnXoZadWrRQUcp/cZmT0/sDHRIQNPJ7eIWBjhtJ2RzXrf+x/4x2xgvH4
Fk6CtUYBHnvB2jJeV9nMTDO0k/jCMCv5tdy/6Vq9PwTiPgbcwV0JQ3lJavwjitWN
nlNqwv+kFV+bk2jN+FOt0VY1hSaU4jrgQ034VgL5UjloQtx3gsiuaE3d1Qxw3eEf
Bg/RYBxYPkvAeVyEvHaqJkeI80DFQCMwGG+Pi1pAtnN5uUePhnz8UJtiqCI4jicN
+wD0HYt4WShh6Edl3vUEgF60RDndaaRoIIvK/dNnRSnAKouYebVS0FKj6UW2EWsU
7ccjDHG12QeKXME2dE4CNS2WunNbLGUIo6chEYec9xOgf3Ti/n1iGhqV8QT2ukn9
RgZxYnpIOvYRciB3lkkHQS+Oe9ucRWfTPHqnajtXtch5JxCZiNhschs17XHukiUi
VNZzpJ9FLqrFoj5MpUKhSIHlJKWhCOHzWcoJAXw9TxFahljwZpjZujQ2GwY+MmPT
womNffvsyG5PXMV3oaZL+93YhE7VBiQUWGFNvDG7rrrrVajDLTRGN85mj/ApGsXE
8RvLukbx+aJ3eH/k82is60S7l6u8gLKfpAGtDVZb5VJyV7xDvYY=
=6uwD
-----END PGP SIGNATURE-----

C
C
Christopher Baines wrote on 21 Nov 2020 10:48
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 40339@debbugs.gnu.org)
87k0ufhwg9.fsf@cbaines.net
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

Toggle quote (6 lines)
> 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 :-)).

Hey,

I tried running this, and it passes. I haven't looked through it in
detail, but it seems good to merge.

Chris
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl+44nZfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XcWyw//RvJ1gexuhR3MAz7AG994AuUnJ2xooW2E
ifQGhN3DDtqg3VArQoouI7k/pToBs6JM8MQqZcKv8ZLDooUTQoBCB+1+rsdRjPzM
4N+zkznMoGH+dwfSmtRJsOeKodxCzs3d95Bv5QajhWMoWt/l99DcLhHBvr7Unwom
3u5VpoPWG+hZLWtjrOCAeay90kj+D0cuzZWf187IGVaJu0C1asNcGjBbTVm1UPrL
eaEJjxurBM6hXzcL1YSvTMsjc7p9bP9Tjy0zGIVm3uboAKnzdQ/+a4cUE+BoqWOX
TcrMZjZF5ZTmPkEatLSvkA66BcmNN3jV5VQb1o1WF5IMjuzroeqNZD7yhxuWEAGd
KMNwX9WteC/wwN8a9u9arfrOJWMMqhVo4mcse7wIirzYEHF9XJuPxhLL8enJHv22
KJOhUVUy0av2qhHTuEQHWM2rxsOBFNIhTsdEFLez8DMb1mlLmX6xpNbbFgzd7ATJ
yPPn+TZBHYpcQrY2Y0zfz2ppdir6BilLZG9j4SGk8bHCu8wZaQ987HVkB3h7OWH7
WgVGVj1S8SMwwCnV9kFGiQqELS9lPHGgEkqdFCUBGGjcbmx/v1bhwU/SLUfH8Xcp
PJLZaqaa+KoTptkAch5cRPIJW1wJpH0UhbFwVuz4fl0yLDjCRx2kHwZtv1vZDf4O
fvO/5TXPR1A=
=Or7b
-----END PGP SIGNATURE-----

M
M
Maxim Cournoyer wrote on 27 Jan 2021 17:39
Re: bug#40339: [PATCH] system: tests: Add a Btrfs RAID system test.
(name . Christopher Baines)(address . mail@cbaines.net)(address . 40339-done@debbugs.gnu.org)
87ft2mz64c.fsf_-_@gmail.com
Hi Chris,

Christopher Baines <mail@cbaines.net> writes:

Toggle quote (13 lines)
> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>
>> 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 :-)).
>
> Hey,
>
> I tried running this, and it passes. I haven't looked through it in
> detail, but it seems good to merge.

Thanks for the report. I've now done so with commit 886302fcf7.

Closing,

Maxim
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 40339@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 40339
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch