tests: libvirt: Ensure the default network can be started.

* gnu/tests/virtualization.scm (run-libvirt-test): Run commands to create and
start the default network.
This commit is contained in:
Marius Bakke 2022-08-29 20:08:38 +02:00
parent acbf2f9def
commit 3e0abde17b
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
2 changed files with 21 additions and 1 deletions

@ -14,7 +14,7 @@
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
;;; Copyright © 2020, 2021 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2020, 2021 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2020, 2021, 2022 Marius Bakke <marius@gnu.org>
;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
;;; Copyright © 2021 Leo Famulari <leo@famulari.name>

@ -106,6 +106,26 @@
"-c" "qemu:///system" "connect"))
marionette))
(test-eq "create default network"
0
(marionette-eval
'(begin
(chdir "/tmp")
(system* #$(file-append libvirt "/bin/virsh")
"-c" "qemu:///system" "net-define"
#$(file-append libvirt
"/etc/libvirt/qemu/networks/default.xml")))
marionette))
(test-eq "start default network"
0
(marionette-eval
'(begin
(chdir "/tmp")
(system* #$(file-append libvirt "/bin/virsh")
"-c" "qemu:///system" "net-start" "default"))
marionette))
(test-end))))
(gexp->derivation "libvirt-test" test))