123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- (define-module (gnu tests security-token)
- #:use-module (gnu tests)
- #:use-module (gnu system vm)
- #:use-module (gnu services)
- #:use-module (gnu services security-token)
- #:use-module (guix gexp)
- #:export (%test-pcscd))
- (define %pcscd-os
- (simple-operating-system
- (service pcscd-service-type)))
- (define* (run-pcscd-test)
- "Run tests of 'pcscd-service-type'."
- (define os
- (marionette-operating-system
- %pcscd-os
- #:imported-modules '((gnu services herd))
- #:requirements '(pcscd)))
- (define test
- (with-imported-modules '((gnu build marionette))
- #~(begin
- (use-modules (srfi srfi-64)
- (gnu build marionette))
- (define marionette
- (make-marionette (list #$(virtual-machine os))))
- (mkdir #$output)
- (chdir #$output)
- (test-begin "pcscd")
- (test-assert "pcscd is alive"
- (marionette-eval
- '(begin
- (use-modules (gnu services herd))
- (live-service-running
- (find (lambda (live)
- (memq 'pcscd (live-service-provision live)))
- (current-services))))
- marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
- (gexp->derivation "pcscd" test))
- (define %test-pcscd
- (system-test
- (name "pcscd")
- (description "Test a running pcscd daemon.")
- (value (run-pcscd-test))))
|