[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/12: tests: Factorize LUKS passphrase.
From: |
guix-commits |
Subject: |
05/12: tests: Factorize LUKS passphrase. |
Date: |
Fri, 21 Feb 2020 17:08:37 -0500 (EST) |
civodul pushed a commit to branch wip-installer-test
in repository guix.
commit 1a22bbfdd82ff9f6978ebea97e50a9695f2dda56
Author: Ludovic Courtès <address@hidden>
AuthorDate: Fri Feb 21 20:49:46 2020 +0100
tests: Factorize LUKS passphrase.
* gnu/tests/install.scm (%luks-passphrase): New variable.
(%encrypted-root-installation-script): Use it.
(enter-luks-passphrase): Use it.
---
gnu/tests/install.scm | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm
index d475bda..335efbd 100644
--- a/gnu/tests/install.scm
+++ b/gnu/tests/install.scm
@@ -651,9 +651,13 @@ by 'mdadm'.")
(guix combinators)))))
%base-services))))
+(define %luks-passphrase
+ ;; LUKS encryption passphrase used in tests.
+ "thepassphrase")
+
(define %encrypted-root-installation-script
;; Shell script of a simple installation.
- "\
+ (string-append "\
. /etc/profile
set -e -x
guix --version
@@ -665,9 +669,9 @@ parted --script /dev/vdb mklabel gpt \\
mkpart primary ext2 3M 1.4G \\
set 1 boot on \\
set 1 bios_grub on
-echo -n thepassphrase | \\
+echo -n " %luks-passphrase " | \\
cryptsetup luksFormat --uuid=12345678-1234-1234-1234-123456789abc -q
/dev/vdb2 -
-echo -n thepassphrase | \\
+echo -n " %luks-passphrase " | \\
cryptsetup open --type luks --key-file - /dev/vdb2 the-root-device
mkfs.ext4 -L my-root /dev/mapper/the-root-device
mount LABEL=my-root /mnt
@@ -677,7 +681,7 @@ 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")
+reboot\n"))
(define (enter-luks-passphrase marionette)
"Return a gexp to be inserted in the basic system test running on MARIONETTE
@@ -698,7 +702,8 @@ to enter the LUKS passphrase."
;; when the passphrase should be entered.
(wait-for-screen-text #$marionette passphrase-prompt?
#:ocrad #$ocrad)
- (marionette-type "thepassphrase\n" #$marionette)
+ (marionette-type #$(string-append %luks-passphrase "\n")
+ #$marionette)
;; Now wait until we leave the boot screen. This is necessary so
;; we can then be sure we match the "Enter passphrase" prompt from
@@ -714,7 +719,8 @@ to enter the LUKS passphrase."
(wait-for-screen-text #$marionette passphrase-prompt?
#:ocrad #$ocrad
#:timeout 60)
- (marionette-type "thepassphrase\n" #$marionette)
+ (marionette-type #$(string-append %luks-passphrase "\n")
+ #$marionette)
;; Take a screenshot for debugging purposes.
(marionette-control (string-append "screendump " #$output
- branch wip-installer-test created (now 0699b97), guix-commits, 2020/02/21
- 03/12: installer: Add 'syslog' macro to write to syslog., guix-commits, 2020/02/21
- 04/12: installer: Log important bits to syslog., guix-commits, 2020/02/21
- 06/12: tests: 'run-basic-test' can enter a root password., guix-commits, 2020/02/21
- 05/12: tests: Factorize LUKS passphrase.,
guix-commits <=
- 09/12: installer: Bypass connectivity check when /tmp/installer-assume-online exists., guix-commits, 2020/02/21
- 01/12: marionette: 'wait-for' procedures no longer leak a port., guix-commits, 2020/02/21
- 02/12: marionette: Provide portable US-layout keystrokes for "<" and ">"., guix-commits, 2020/02/21
- 07/12: installer: Use a Guile-Newt snapshot that supports 'form-watch-fd'., guix-commits, 2020/02/21
- 11/12: installer: Honor /tmp/installer-system-init-options., guix-commits, 2020/02/21
- 10/12: installer: Run commands without hopping through the shell., guix-commits, 2020/02/21
- 08/12: installer: Implement a dialog on /var/guix/installer-socket., guix-commits, 2020/02/21
- 12/12: tests: install: Add "gui-installed-os"., guix-commits, 2020/02/21