tests: childhurd: Generalize command execution over SSH.

* gnu/tests/virtualization.scm (run-childhurd-test)[run-uname-over-ssh]:
Rename to...
[run-command-over-ssh]: ... this.  Add 'command' parameter and honor it.
["SSH up and running"]: Adjust accordingly.
This commit is contained in:
Ludovic Courtès 2022-06-05 22:30:18 +02:00
parent 8ccf5f518d
commit 1fc4d821eb
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Christopher Baines <mail@cbaines.net> ;;; Copyright © 2017 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2020, 2021 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2020-2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com> ;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;; ;;;
@ -151,8 +151,8 @@ (define vm
(operating-system os) (operating-system os)
(memory-size (* 1024 3)))) (memory-size (* 1024 3))))
(define run-uname-over-ssh (define (run-command-over-ssh . command)
;; Program that runs 'uname' over SSH and prints the result on standard ;; Program that runs COMMAND over SSH and prints the result on standard
;; output. ;; output.
(let () (let ()
(define run (define run
@ -173,12 +173,12 @@ (define run
(userauth-password! session "") (userauth-password! session "")
(display (display
(get-string-all (get-string-all
(open-remote-input-pipe* session "uname" "-on")))) (open-remote-input-pipe* session #$@command))))
(status (status
(error "could not connect to childhurd over SSH" (error "could not connect to childhurd over SSH"
session status))))))) session status)))))))
(program-file "run-uname-over-ssh" run))) (program-file "run-command-over-ssh" run)))
(define test (define test
(with-imported-modules '((gnu build marionette)) (with-imported-modules '((gnu build marionette))
@ -242,7 +242,7 @@ (define marionette
(use-modules (ice-9 popen)) (use-modules (ice-9 popen))
(get-string-all (get-string-all
(open-input-pipe #$run-uname-over-ssh))) (open-input-pipe #$(run-command-over-ssh "uname" "-on"))))
marionette)) marionette))
(test-end)))) (test-end))))