From 5479aa2b7cf9164e87a1d1184ec97a9bba5cea92 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 26 Oct 2016 20:04:52 +0200 Subject: tests: Test installation with store on a separate partition. This is a followup to 0f65f54ebd76324653fd5506a7dab42ee44d9255. * gnu/tests/install.scm (%separate-store-os, %separate-store-os-source) (%separate-store-installation-script, %test-separate-store-os): New variables. --- gnu/tests/install.scm | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) (limited to 'gnu/tests/install.scm') diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index 4e79fdb294..0f54935ea8 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -33,6 +33,7 @@ #:use-module (guix gexp) #:use-module (guix utils) #:export (%test-installed-os + %test-separate-store-os %test-encrypted-os)) ;;; Commentary: @@ -222,6 +223,87 @@ build (current-guix) and then store a couple of full system images.") "installed-os"))))) +;;; +;;; Separate /gnu/store partition. +;;; + +(define-os-with-source (%separate-store-os %separate-store-os-source) + ;; The OS we want to install. + (use-modules (gnu) (gnu tests) (srfi srfi-1)) + + (operating-system + (host-name "liberigilo") + (timezone "Europe/Paris") + (locale "en_US.UTF-8") + + (bootloader (grub-configuration (device "/dev/vdb"))) + (kernel-arguments '("console=ttyS0")) + (file-systems (cons* (file-system + (device "root-fs") + (title 'label) + (mount-point "/") + (type "ext4")) + (file-system + (device "store-fs") + (title 'label) + (mount-point "/gnu") + (type "ext4") + (needed-for-boot? #t)) ;definitely! + %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 %separate-store-installation-script + ;; Installation with a separate /gnu partition. + "\ +. /etc/profile +set -e -x +guix --version + +export GUIX_BUILD_OPTIONS=--no-grafts +guix build isc-dhcp +parted --script /dev/vdb mklabel gpt \\ + mkpart primary ext2 1M 3M \\ + mkpart primary ext2 3M 100M \\ + mkpart primary ext2 100M 1G \\ + set 1 boot on \\ + set 1 bios_grub on +mkfs.ext4 -L root-fs /dev/vdb2 +mkfs.ext4 -L store-fs /dev/vdb3 +mount /dev/vdb2 /mnt +mkdir /mnt/gnu +mount /dev/vdb3 /mnt/gnu +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-separate-store-os + (system-test + (name "separate-store-os") + (description + "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/writable-image image))) + (run-basic-test %separate-store-os command "separate-store-os"))))) + + +;;; +;;; LUKS-encrypted root file system. +;;; + (define-os-with-source (%encrypted-root-os %encrypted-root-os-source) ;; The OS we want to install. (use-modules (gnu) (gnu tests) (srfi srfi-1)) -- cgit v1.2.3 Maxim Cournoyer 2023-06-04records: Add MATCH-RECORD-LAMBDA....(unmatched-parenthesis ew syntax 2023-06-04dir-locals: Fix MATCH-RECORD indentation....(unmatched-parenthesis d 2023-03-17Revert gexp->derivation and computed-file indentation rules....Maxim Cournoyer 2023-03-05.dir-locals.el: Allow Guix root-dir overrides when working via Tramp....Brian Cully 2023-02-19.dir-locals: Add let-keywords indentation rules....Maxim Cournoyer 2023-02-02.dir-locals.el: Adjust indentation rule for test-assertm....Maxim Cournoyer 2023-02-02.dir-locals.el: Add indentation rule for computed-file....Maxim Cournoyer 2022-09-07.dir-locals.el: Update yas snippets directory....Andrew Tropin 2022-09-05.dir-locals.el: Add .go to completion-ignored-extensions....Andrew Tropin 2022-09-05.dir-locals.el: Add guix yasnippets....Andrew Tropin 2022-07-10monads: Add 'mparameterize'....Ludovic Courtès 2022-07-10.dir-locals.el: Restore Emacs 27 lisp-fill-paragraph behavior....Maxim Cournoyer 2022-06-28.dir-locals.el: Properly indent 'wrap-script'....Maxim Cournoyer 2022-06-07.dir-locals: Adjust to bug-reference-mode in Emacs 28....Ludovic Courtès 2022-03-06import: github: Reuse HTTP connection for the /tags URL fallback....Ludovic Courtès 2022-03-06tests: Add (guix http-client) tests....Ludovic Courtès 2022-01-29.dir-locals.el: Don't mess up indentation of prepend and append....Liliana Marie Prikler 2021-08-12Merge branch 'master' into core-updates-frozen...Marius Bakke 2021-08-02.dir-locals.el: Specify indentation rule for with-shepherd-action....Maxim Cournoyer 2021-07-18Merge branch 'master' into core-updatesLudovic Courtès 2021-07-11packages: Add 'modify-inputs'....Ludovic Courtès 2021-06-29pack: Add support for the deb format....Maxim Cournoyer