Merge pull request #200611 from fpletz/libvirtd-fix-autostart
This commit is contained in:
commit
2274143409
|
@ -336,6 +336,7 @@ in
|
|||
};
|
||||
|
||||
systemd.services.libvirtd = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
requires = [ "libvirtd-config.service" ];
|
||||
after = [ "libvirtd-config.service" ]
|
||||
++ optional vswitch.enable "ovs-vswitchd.service";
|
||||
|
|
|
@ -26,7 +26,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
|
|||
in ''
|
||||
start_all()
|
||||
|
||||
virthost.wait_for_unit("sockets.target")
|
||||
virthost.wait_for_unit("multi-user.target")
|
||||
|
||||
with subtest("enable default network"):
|
||||
virthost.succeed("virsh net-start default")
|
||||
|
@ -46,13 +46,16 @@ import ./make-test-python.nix ({ pkgs, ... }: {
|
|||
virthost.succeed("virsh pool-start zfs_storagepool")
|
||||
virthost.succeed("virsh vol-create-as zfs_storagepool disk1 25MB")
|
||||
|
||||
with subtest("check if nixos install iso boots and network works"):
|
||||
with subtest("check if nixos install iso boots, network and autostart works"):
|
||||
virthost.succeed(
|
||||
"virt-install -n nixos --osinfo=nixos-unstable --ram=1024 --graphics=none --disk=`find ${nixosInstallISO}/iso -type f | head -n1`,readonly=on --import --noautoconsole"
|
||||
"virt-install -n nixos --osinfo nixos-unstable --memory 1024 --graphics none --disk `find ${nixosInstallISO}/iso -type f | head -n1`,readonly=on --import --noautoconsole --autostart"
|
||||
)
|
||||
virthost.succeed("virsh domstate nixos | grep running")
|
||||
virthost.wait_until_succeeds("ping -c 1 nixos")
|
||||
virthost.succeed("virsh ${virshShutdownCmd} nixos")
|
||||
virthost.wait_until_succeeds("virsh domstate nixos | grep 'shut off'")
|
||||
virthost.shutdown()
|
||||
virthost.wait_for_unit("multi-user.target")
|
||||
virthost.wait_until_succeeds("ping -c 1 nixos")
|
||||
'';
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue