tests: install: Abort when one installation step fails.
When marionette-eval calls fail in gui-test-program, the installation continues which results in two scenarios: - hang forever at the next marionette-eval call, - keep going and start a broken installation, which is annoying because it clears the terminal and hides the error. Make sure that gui-test-program is exited with #f return code when one of the marionette-eval calls fail. * gnu/tests/install.scm (gui-test-program): Add a new macro "marionette-eval*". Throw an exception when one on the marionette-eval calls fail.
This commit is contained in:
parent
e64ea84392
commit
1550db6fd4
1 changed files with 44 additions and 39 deletions
|
@ -1,6 +1,7 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
|
;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||||
|
;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -946,67 +947,71 @@ build (current-guix) and then store a couple of full system images.")
|
||||||
(marionette-control (string-append "screendump " file)
|
(marionette-control (string-append "screendump " file)
|
||||||
#$marionette))
|
#$marionette))
|
||||||
|
|
||||||
|
(define-syntax-rule (marionette-eval* exp marionette)
|
||||||
|
(or (marionette-eval exp marionette)
|
||||||
|
(throw 'marionette-eval-failure 'exp)))
|
||||||
|
|
||||||
(setvbuf (current-output-port) 'none)
|
(setvbuf (current-output-port) 'none)
|
||||||
(setvbuf (current-error-port) 'none)
|
(setvbuf (current-error-port) 'none)
|
||||||
|
|
||||||
(marionette-eval '(use-modules (gnu installer tests))
|
(marionette-eval* '(use-modules (gnu installer tests))
|
||||||
#$marionette)
|
#$marionette)
|
||||||
|
|
||||||
;; Arrange so that 'converse' prints debugging output to the console.
|
;; Arrange so that 'converse' prints debugging output to the console.
|
||||||
(marionette-eval '(let ((console (open-output-file "/dev/console")))
|
(marionette-eval* '(let ((console (open-output-file "/dev/console")))
|
||||||
(setvbuf console 'none)
|
(setvbuf console 'none)
|
||||||
(conversation-log-port console))
|
(conversation-log-port console))
|
||||||
#$marionette)
|
#$marionette)
|
||||||
|
|
||||||
;; Tell the installer to not wait for the Connman "online" status.
|
;; Tell the installer to not wait for the Connman "online" status.
|
||||||
(marionette-eval '(call-with-output-file "/tmp/installer-assume-online"
|
(marionette-eval* '(call-with-output-file "/tmp/installer-assume-online"
|
||||||
(const #t))
|
(const #t))
|
||||||
#$marionette)
|
#$marionette)
|
||||||
|
|
||||||
;; Run 'guix system init' with '--no-grafts', to cope with the lack of
|
;; Run 'guix system init' with '--no-grafts', to cope with the lack of
|
||||||
;; network access.
|
;; network access.
|
||||||
(marionette-eval '(call-with-output-file
|
(marionette-eval* '(call-with-output-file
|
||||||
"/tmp/installer-system-init-options"
|
"/tmp/installer-system-init-options"
|
||||||
(lambda (port)
|
(lambda (port)
|
||||||
(write '("--no-grafts" "--no-substitutes")
|
(write '("--no-grafts" "--no-substitutes")
|
||||||
port)))
|
port)))
|
||||||
#$marionette)
|
#$marionette)
|
||||||
|
|
||||||
(marionette-eval '(define installer-socket
|
(marionette-eval* '(define installer-socket
|
||||||
(open-installer-socket))
|
(open-installer-socket))
|
||||||
#$marionette)
|
#$marionette)
|
||||||
(screenshot "installer-start.ppm")
|
(screenshot "installer-start.ppm")
|
||||||
|
|
||||||
(marionette-eval '(choose-locale+keyboard installer-socket)
|
(marionette-eval* '(choose-locale+keyboard installer-socket)
|
||||||
#$marionette)
|
#$marionette)
|
||||||
(screenshot "installer-locale.ppm")
|
(screenshot "installer-locale.ppm")
|
||||||
|
|
||||||
;; Choose the host name that the "basic" test expects.
|
;; Choose the host name that the "basic" test expects.
|
||||||
(marionette-eval '(enter-host-name+passwords installer-socket
|
(marionette-eval* '(enter-host-name+passwords installer-socket
|
||||||
#:host-name "liberigilo"
|
#:host-name "liberigilo"
|
||||||
#:root-password
|
#:root-password
|
||||||
#$%root-password
|
#$%root-password
|
||||||
#:users
|
#:users
|
||||||
'(("alice" "pass1")
|
'(("alice" "pass1")
|
||||||
("bob" "pass2")))
|
("bob" "pass2")))
|
||||||
#$marionette)
|
#$marionette)
|
||||||
(screenshot "installer-services.ppm")
|
(screenshot "installer-services.ppm")
|
||||||
|
|
||||||
(marionette-eval '(choose-services installer-socket
|
(marionette-eval* '(choose-services installer-socket
|
||||||
#:desktop-environments '()
|
#:desktop-environments '()
|
||||||
#:choose-network-service?
|
#:choose-network-service?
|
||||||
(const #f))
|
(const #f))
|
||||||
#$marionette)
|
#$marionette)
|
||||||
(screenshot "installer-partitioning.ppm")
|
(screenshot "installer-partitioning.ppm")
|
||||||
|
|
||||||
(marionette-eval '(choose-partitioning installer-socket
|
(marionette-eval* '(choose-partitioning installer-socket
|
||||||
#:encrypted? #$encrypted?
|
#:encrypted? #$encrypted?
|
||||||
#:passphrase #$%luks-passphrase)
|
#:passphrase #$%luks-passphrase)
|
||||||
#$marionette)
|
#$marionette)
|
||||||
(screenshot "installer-run.ppm")
|
(screenshot "installer-run.ppm")
|
||||||
|
|
||||||
(marionette-eval '(conclude-installation installer-socket)
|
(marionette-eval* '(conclude-installation installer-socket)
|
||||||
#$marionette)
|
#$marionette)
|
||||||
|
|
||||||
(sync)
|
(sync)
|
||||||
#t))
|
#t))
|
||||||
|
|
Reference in a new issue