2024-05-15 15:35:15 +00:00
|
|
|
import ../make-test-python.nix ({ pkgs, lib, incus ? pkgs.incus-lts, ... } :
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
name = "incus-openvswitch";
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
maintainers = lib.teams.lxc.members;
|
|
|
|
};
|
|
|
|
|
|
|
|
nodes.machine = { lib, ... }: {
|
|
|
|
virtualisation = {
|
2024-05-15 15:35:15 +00:00
|
|
|
incus = {
|
|
|
|
enable = true;
|
|
|
|
package = incus;
|
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
vswitch.enable = true;
|
|
|
|
incus.preseed = {
|
|
|
|
networks = [
|
|
|
|
{
|
|
|
|
name = "nixostestbr0";
|
|
|
|
type = "bridge";
|
|
|
|
config = {
|
|
|
|
"bridge.driver" = "openvswitch";
|
|
|
|
"ipv4.address" = "10.0.100.1/24";
|
|
|
|
"ipv4.nat" = "true";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
profiles = [
|
|
|
|
{
|
|
|
|
name = "nixostest_default";
|
|
|
|
devices = {
|
|
|
|
eth0 = {
|
|
|
|
name = "eth0";
|
|
|
|
network = "nixostestbr0";
|
|
|
|
type = "nic";
|
|
|
|
};
|
|
|
|
root = {
|
|
|
|
path = "/";
|
|
|
|
pool = "default";
|
|
|
|
size = "35GiB";
|
|
|
|
type = "disk";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
storage_pools = [
|
|
|
|
{
|
|
|
|
name = "nixostest_pool";
|
|
|
|
driver = "dir";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
networking.nftables.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
machine.wait_for_unit("incus.service")
|
|
|
|
machine.wait_for_unit("incus-preseed.service")
|
|
|
|
|
|
|
|
with subtest("Verify openvswitch bridge"):
|
|
|
|
machine.succeed("incus network info nixostestbr0")
|
|
|
|
|
|
|
|
with subtest("Verify openvswitch bridge"):
|
|
|
|
machine.succeed("ovs-vsctl br-exists nixostestbr0")
|
|
|
|
'';
|
|
|
|
})
|