From fecaf550cfb0f0715965f65f57b96c1a033ae954 Mon Sep 17 00:00:00 2001 From: Yelninei Date: Wed, 27 Aug 2025 15:51:39 +0000 Subject: services: hurd-vm: Support different hurd types. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/virtualization.scm (sanitize-hurd-vm-configuration-type): New procedure. (hurd-vm-confiuration): Add type field. (hurd-vm-disk-image): Use it. * doc/guix.texi (hurd-vm-configuration): Document it. * gnu/tests/virtualization.scm (%childhurd64-os): New variable. (run-childhurd-test): Add the os a parameter. (%test-childhurd): Adjust accordingly. (%test-childhurd64): New system test. Change-Id: Ie1c55a9414657ced4bf8b4324527037f1a1f78f4 Signed-off-by: Ludovic Courtès --- gnu/tests/virtualization.scm | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'gnu/tests') diff --git a/gnu/tests/virtualization.scm b/gnu/tests/virtualization.scm index c55a944845f..a882d70e140 100644 --- a/gnu/tests/virtualization.scm +++ b/gnu/tests/virtualization.scm @@ -27,6 +27,7 @@ #:use-module (gnu system) #:use-module (gnu system accounts) #:use-module (gnu system file-systems) + #:use-module (gnu system hurd) #:use-module (gnu system image) #:use-module (gnu system images hurd) #:use-module ((gnu system shadow) #:select (%base-user-accounts)) @@ -45,6 +46,7 @@ #:export (%test-libvirt %test-qemu-guest-agent %test-childhurd + %test-childhurd64 %test-build-vm)) @@ -277,6 +279,22 @@ (password "")) ;empty password %base-user-accounts)))))))) +(define %childhurd64-os + (simple-operating-system + (service dhcpcd-service-type) + (service hurd-vm-service-type + (hurd-vm-configuration + (type 'hurd64-qcow2) + (os (operating-system + (inherit %hurd-vm-operating-system) + (kernel %hurd64-default-operating-system-kernel) + (kernel-arguments '("noide")) ;use rumpdisk + (users (cons (user-account + (name "test") + (group "users") + (password "")) ;empty password + %base-user-accounts)))))))) + (define* (run-command-over-ssh command #:key (port 10022) (user "test")) "Return a program that runs COMMAND over SSH and prints the result on standard @@ -307,7 +325,7 @@ output." (program-file "run-command-over-ssh" run)) -(define (run-childhurd-test) +(define (run-childhurd-test childhurd-os) (define (import-module? module) ;; This module is optional and depends on Guile-Gcrypt, do skip it. (and (guix-module-name? module) @@ -315,7 +333,7 @@ output." (define os (marionette-operating-system - %childhurd-os + childhurd-os #:imported-modules (source-module-closure '((gnu services herd) (guix combinators) @@ -454,7 +472,15 @@ output." (description "Connect to the GNU/Hurd virtual machine service, aka. a childhurd, making sure that the childhurd boots and runs its SSH server.") - (value (run-childhurd-test)))) + (value (run-childhurd-test %childhurd-os)))) + +(define %test-childhurd64 + (system-test + (name "childhurd64") + (description + "Connect to the 64-bit GNU/Hurd virtual machine service, aka. a childhurd, + making sure that the childhurd boots and runs its SSH server.") + (value (run-childhurd-test %childhurd64-os)))) ;;; -- cgit v1.3