diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2025-02-22 11:09:53 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2025-03-05 20:34:03 +0100 |
| commit | a7d28414ccaa3a1e23124def33aa2d97b122310c (patch) | |
| tree | d37e008810632dd36ed1b8e3a8ca168f31794e3f | |
| parent | f4679a5860c8666088d3a0fc1033d701a7a83464 (diff) | |
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.scm | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gnu/tests.scm b/gnu/tests.scm index 1e3dbf09445..84298de448d 100644 --- a/gnu/tests.scm +++ b/gnu/tests.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2016-2020, 2022-2024 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2016-2020, 2022-2025 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> | 3 | ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> |
| 4 | ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr> | 4 | ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr> |
| 5 | ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be> | 5 | ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be> |
| @@ -48,6 +48,7 @@ | |||
| 48 | 48 | ||
| 49 | marionette-service-type | 49 | marionette-service-type |
| 50 | marionette-operating-system | 50 | marionette-operating-system |
| 51 | marionette-program | ||
| 51 | define-os-with-source | 52 | define-os-with-source |
| 52 | 53 | ||
| 53 | %simple-os | 54 | %simple-os |
| @@ -72,11 +73,15 @@ | |||
| 72 | ;;; | 73 | ;;; |
| 73 | ;;; Code: | 74 | ;;; Code: |
| 74 | 75 | ||
| 76 | (define %default-marionette-device | ||
| 77 | ;; Default marionette device in the guest. | ||
| 78 | "/dev/virtio-ports/org.gnu.guix.port.0") | ||
| 79 | |||
| 75 | (define-record-type* <marionette-configuration> | 80 | (define-record-type* <marionette-configuration> |
| 76 | marionette-configuration make-marionette-configuration | 81 | marionette-configuration make-marionette-configuration |
| 77 | marionette-configuration? | 82 | marionette-configuration? |
| 78 | (device marionette-configuration-device ;string | 83 | (device marionette-configuration-device ;string |
| 79 | (default "/dev/virtio-ports/org.gnu.guix.port.0")) | 84 | (default %default-marionette-device)) |
| 80 | (imported-modules marionette-configuration-imported-modules | 85 | (imported-modules marionette-configuration-imported-modules |
| 81 | (default '())) | 86 | (default '())) |
| 82 | (extensions marionette-configuration-extensions | 87 | (extensions marionette-configuration-extensions |
| @@ -92,7 +97,10 @@ | |||
| 92 | (with-extensions extensions | 97 | (with-extensions extensions |
| 93 | gexp))) | 98 | gexp))) |
| 94 | 99 | ||
| 95 | (define (marionette-program device imported-modules extensions) | 100 | (define* (marionette-program #:optional |
| 101 | (device %default-marionette-device) | ||
| 102 | (imported-modules '()) | ||
| 103 | (extensions '())) | ||
| 96 | "Return the program that runs the marionette REPL on DEVICE. Ensure | 104 | "Return the program that runs the marionette REPL on DEVICE. Ensure |
| 97 | IMPORTED-MODULES and EXTENSIONS are accessible from the REPL." | 105 | IMPORTED-MODULES and EXTENSIONS are accessible from the REPL." |
| 98 | (define code | 106 | (define code |
