tests: Export 'run-basic-test'.
* gnu/tests/base.scm (run-basic-test): New procedure, extracted from ... (%test-basic-os): ... here. Use it.
This commit is contained in:
parent
77559f23b0
commit
e3de272a81
|
@ -30,7 +30,8 @@
|
|||
#:use-module (guix monads)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:export (%test-basic-os))
|
||||
#:export (run-basic-test
|
||||
%test-basic-os))
|
||||
|
||||
(define %simple-os
|
||||
(operating-system
|
||||
|
@ -56,15 +57,10 @@
|
|||
%base-user-accounts))))
|
||||
|
||||
|
||||
(define %test-basic-os
|
||||
;; Monadic derivation that instruments %SIMPLE-OS, runs it in a VM, and runs
|
||||
;; a series of basic functionality tests.
|
||||
(mlet* %store-monad ((os -> (marionette-operating-system
|
||||
%simple-os
|
||||
#:imported-modules '((gnu services herd)
|
||||
(guix combinators))))
|
||||
(run (system-qemu-image/shared-store-script
|
||||
os #:graphic? #f)))
|
||||
(define* (run-basic-test os command #:optional (name "basic"))
|
||||
"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>."
|
||||
(define test
|
||||
#~(begin
|
||||
(use-modules (gnu build marionette)
|
||||
|
@ -74,7 +70,7 @@
|
|||
(ice-9 match))
|
||||
|
||||
(define marionette
|
||||
(make-marionette (list #$run)))
|
||||
(make-marionette #$command))
|
||||
|
||||
(mkdir #$output)
|
||||
(chdir #$output)
|
||||
|
@ -160,5 +156,16 @@ info --version")
|
|||
(test-end)
|
||||
(exit (= (test-runner-fail-count (test-runner-current)) 0))))
|
||||
|
||||
(gexp->derivation "basic" test
|
||||
#:modules '((gnu build marionette)))))
|
||||
(gexp->derivation name test
|
||||
#:modules '((gnu build marionette))))
|
||||
|
||||
(define %test-basic-os
|
||||
;; Monadic derivation that instruments %SIMPLE-OS, runs it in a VM, and runs
|
||||
;; a series of basic functionality tests.
|
||||
(mlet* %store-monad ((os -> (marionette-operating-system
|
||||
%simple-os
|
||||
#:imported-modules '((gnu services herd)
|
||||
(guix combinators))))
|
||||
(run (system-qemu-image/shared-store-script
|
||||
os #:graphic? #f)))
|
||||
(run-basic-test os #~(list #$run))))
|
||||
|
|
Loading…
Reference in New Issue