nixpkgs/nixos/tests/incus/socket-activated.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
754 B
Nix
Raw Permalink Normal View History

import ../make-test-python.nix ({ pkgs, lib, incus ? pkgs.incus-lts, ... } :
2023-10-19 22:10:59 -06:00
{
name = "incus-socket-activated";
meta = {
maintainers = lib.teams.lxc.members;
};
2023-10-19 22:10:59 -06:00
nodes.machine = { lib, ... }: {
virtualisation = {
incus = {
enable = true;
package = incus;
socketActivation = true;
};
2023-10-19 22:10:59 -06:00
};
networking.nftables.enable = true;
2023-10-19 22:10:59 -06:00
};
testScript = ''
machine.wait_for_unit("incus.socket")
# ensure service is not running by default
machine.fail("systemctl is-active incus.service")
machine.fail("systemctl is-active incus-preseed.service")
2023-10-19 22:10:59 -06:00
# access the socket and ensure the service starts
machine.succeed("incus list")
machine.wait_for_unit("incus.service")
'';
})