tests: Support basic tests extension with an extra-tests argument.

* gnu/tests/base.scm (run-basic-test)[extra-tests]: New argument.

Change-Id: Ia3595638309738d3361c583c93a66e0a872adabe
This commit is contained in:
Mathieu Othacehe 2025-06-29 15:52:47 +02:00
parent f3a8db842d
commit 11b5443e48
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -74,7 +74,8 @@
#:key
initialization
root-password
desktop?)
desktop?
extra-tests)
"Return a derivation called NAME that tests basic features of the OS started
using COMMAND, a gexp that evaluates to a list of strings. Compare some
properties of running system to what's declared in OS, an <operating-system>.
@ -85,7 +86,12 @@ inserted before the first test. This is used to introduce an extra
initialization step, such as entering a LUKS passphrase.
When ROOT-PASSWORD is true, enter it as the root password when logging in.
Otherwise assume that there is no password for root."
Otherwise assume that there is no password for root.
When EXTRA-TESTS is true, it must be a one-argument procedure that is
passed a gexp denoting the marionette. It must then return a gexp that is
inserted after the last test. This is meant as a way of extending the basic
tests that are defined within this procedure."
(define special-files
(service-value
(fold-services (operating-system-services os)
@ -581,6 +587,9 @@ test \"$BASHRC_D_OK\" = yes"))
(compose string-trim-right get-string-all)))
marionette))
#$(and extra-tests
(extra-tests #~marionette))
(test-end))))
(gexp->derivation name test))