1import ../make-test-python.nix ({ pkgs, lib, ... } :
2
3{
4 name = "incus-preseed";
5
6 meta.maintainers = with lib.maintainers; [ adamcstephens ];
7
8 nodes.machine = { lib, ... }: {
9 virtualisation = {
10 incus.enable = true;
11
12 incus.preseed = {
13 networks = [
14 {
15 name = "nixostestbr0";
16 type = "bridge";
17 config = {
18 "ipv4.address" = "10.0.100.1/24";
19 "ipv4.nat" = "true";
20 };
21 }
22 ];
23 profiles = [
24 {
25 name = "nixostest_default";
26 devices = {
27 eth0 = {
28 name = "eth0";
29 network = "nixostestbr0";
30 type = "nic";
31 };
32 root = {
33 path = "/";
34 pool = "default";
35 size = "35GiB";
36 type = "disk";
37 };
38 };
39 }
40 ];
41 storage_pools = [
42 {
43 name = "nixostest_pool";
44 driver = "dir";
45 }
46 ];
47 };
48 };
49 };
50
51 testScript = ''
52 machine.wait_for_unit("incus.service")
53 machine.wait_for_unit("incus-preseed.service")
54
55 with subtest("Verify preseed resources created"):
56 machine.succeed("incus profile show nixostest_default")
57 machine.succeed("incus network info nixostestbr0")
58 machine.succeed("incus storage show nixostest_pool")
59 '';
60})