1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

gnu: libvirt: Configure default libvirt network.

* gnu/services/virtualization.scm (%libvirt-activation): Activate
default libvirt network configuration file.
* gnu/tests/virtualization.scm (run-libvirt-test): Drop network
definition test and replace it with a test checking that the default
network is inactive by default.

Change-Id: I03b6314a390c6d93ebf886d7033867ff5cacad74
This commit is contained in:
Giacomo Leidi
2026-02-17 11:46:46 +01:00
parent e29c17a2e7
commit a375202ad3
2 changed files with 28 additions and 8 deletions

View File

@@ -119,15 +119,23 @@
"-c" "qemu:///system" "connect"))
marionette))
(test-eq "create default network"
0
(test-equal "default network is inactive"
"no"
(marionette-eval
'(begin
(use-modules (ice-9 popen)
(ice-9 textual-ports))
(chdir "/tmp")
(system* #$(file-append libvirt "/bin/virsh")
"-c" "qemu:///system" "net-define"
#$(file-append libvirt
"/etc/libvirt/qemu/networks/default.xml")))
(define port
(open-input-pipe
(string-join '(#$(file-append libvirt "/bin/virsh")
"-c" "qemu:///system" "net-info"
"default" "|" "grep" "Active:" "|"
"awk" "'{ print $2; }'")
" ")))
(define answer (get-string-all port))
(close-port port)
(string-trim-both answer))
marionette))
(test-eq "start default network"