mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 21:59:08 -05:00
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
1 changed files with 105 additions and 98 deletions
|
@ -30,7 +30,8 @@ (define-module (gnu tests base)
|
||||||
#:use-module (guix monads)
|
#:use-module (guix monads)
|
||||||
#:use-module (guix packages)
|
#:use-module (guix packages)
|
||||||
#:use-module (srfi srfi-1)
|
#:use-module (srfi srfi-1)
|
||||||
#:export (%test-basic-os))
|
#:export (run-basic-test
|
||||||
|
%test-basic-os))
|
||||||
|
|
||||||
(define %simple-os
|
(define %simple-os
|
||||||
(operating-system
|
(operating-system
|
||||||
|
@ -56,15 +57,10 @@ (define %simple-os
|
||||||
%base-user-accounts))))
|
%base-user-accounts))))
|
||||||
|
|
||||||
|
|
||||||
(define %test-basic-os
|
(define* (run-basic-test os command #:optional (name "basic"))
|
||||||
;; Monadic derivation that instruments %SIMPLE-OS, runs it in a VM, and runs
|
"Return a derivation called NAME that tests basic features of the OS started
|
||||||
;; a series of basic functionality tests.
|
using COMMAND, a gexp that evaluates to a list of strings. Compare some
|
||||||
(mlet* %store-monad ((os -> (marionette-operating-system
|
properties of running system to what's declared in OS, an <operating-system>."
|
||||||
%simple-os
|
|
||||||
#:imported-modules '((gnu services herd)
|
|
||||||
(guix combinators))))
|
|
||||||
(run (system-qemu-image/shared-store-script
|
|
||||||
os #:graphic? #f)))
|
|
||||||
(define test
|
(define test
|
||||||
#~(begin
|
#~(begin
|
||||||
(use-modules (gnu build marionette)
|
(use-modules (gnu build marionette)
|
||||||
|
@ -74,7 +70,7 @@ (define test
|
||||||
(ice-9 match))
|
(ice-9 match))
|
||||||
|
|
||||||
(define marionette
|
(define marionette
|
||||||
(make-marionette (list #$run)))
|
(make-marionette #$command))
|
||||||
|
|
||||||
(mkdir #$output)
|
(mkdir #$output)
|
||||||
(chdir #$output)
|
(chdir #$output)
|
||||||
|
@ -160,5 +156,16 @@ (define marionette
|
||||||
(test-end)
|
(test-end)
|
||||||
(exit (= (test-runner-fail-count (test-runner-current)) 0))))
|
(exit (= (test-runner-fail-count (test-runner-current)) 0))))
|
||||||
|
|
||||||
(gexp->derivation "basic" test
|
(gexp->derivation name test
|
||||||
#:modules '((gnu build marionette)))))
|
#: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 a new issue