aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2025-02-22 11:09:53 +0100
committerLudovic Courtès <ludo@gnu.org>2025-03-05 20:34:03 +0100
commita7d28414ccaa3a1e23124def33aa2d97b122310c (patch)
treed37e008810632dd36ed1b8e3a8ca168f31794e3f
parentf4679a5860c8666088d3a0fc1033d701a7a83464 (diff)
downloadguix-a7d28414ccaa3a1e23124def33aa2d97b122310c.tar.gz
guix-a7d28414ccaa3a1e23124def33aa2d97b122310c.zip
tests: Export ‘marionette-program’.
* gnu/tests.scm (%default-marionette-device): New variable. (<marionette-configuration>)[device]: Use it. (marionette-program): Make all parameters optional and export. Change-Id: I496d88253b5ebad60da09a0cca5ed960aa2ab389
-rw-r--r--gnu/tests.scm14
1 files changed, 11 insertions, 3 deletions
diff --git a/gnu/tests.scm b/gnu/tests.scm
index 1e3dbf0944..84298de448 100644
--- a/gnu/tests.scm
+++ b/gnu/tests.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016-2020, 2022-2024 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016-2020, 2022-2025 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
@@ -48,6 +48,7 @@
marionette-service-type
marionette-operating-system
+ marionette-program
define-os-with-source
%simple-os
@@ -72,11 +73,15 @@
;;;
;;; Code:
+(define %default-marionette-device
+ ;; Default marionette device in the guest.
+ "/dev/virtio-ports/org.gnu.guix.port.0")
+
(define-record-type* <marionette-configuration>
marionette-configuration make-marionette-configuration
marionette-configuration?
(device marionette-configuration-device ;string
- (default "/dev/virtio-ports/org.gnu.guix.port.0"))
+ (default %default-marionette-device))
(imported-modules marionette-configuration-imported-modules
(default '()))
(extensions marionette-configuration-extensions
@@ -92,7 +97,10 @@
(with-extensions extensions
gexp)))
-(define (marionette-program device imported-modules extensions)
+(define* (marionette-program #:optional
+ (device %default-marionette-device)
+ (imported-modules '())
+ (extensions '()))
"Return the program that runs the marionette REPL on DEVICE. Ensure
IMPORTED-MODULES and EXTENSIONS are accessible from the REPL."
(define code