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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user