mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-17 01:24:47 +00:00
nixos/incus: preseed should not trigger socket-activation
This commit is contained in:
parent
1fff6a9031
commit
3087595a6b
@ -194,9 +194,11 @@ in
|
||||
|
||||
systemd.services.incus-preseed = lib.mkIf (cfg.preseed != null) {
|
||||
description = "Incus initialization with preseed file";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
requires = [ "incus.service" ];
|
||||
after = [ "incus.service" ];
|
||||
|
||||
wantedBy = ["incus.service"];
|
||||
after = ["incus.service"];
|
||||
bindsTo = ["incus.service"];
|
||||
partOf = ["incus.service"];
|
||||
|
||||
script = ''
|
||||
${cfg.package}/bin/incus admin init --preseed <${
|
||||
@ -206,6 +208,7 @@ in
|
||||
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -49,13 +49,8 @@ import ../make-test-python.nix ({ pkgs, lib, ... } :
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
def wait_for_preseed(_) -> bool:
|
||||
_, output = machine.systemctl("is-active incus-preseed.service")
|
||||
return ("inactive" in output)
|
||||
|
||||
machine.wait_for_unit("incus.service")
|
||||
with machine.nested("Waiting for preseed to complete"):
|
||||
retry(wait_for_preseed)
|
||||
machine.wait_for_unit("incus-preseed.service")
|
||||
|
||||
with subtest("Verify preseed resources created"):
|
||||
machine.succeed("incus profile show nixostest_default")
|
||||
|
@ -17,6 +17,7 @@ import ../make-test-python.nix ({ pkgs, lib, ... } :
|
||||
|
||||
# ensure service is not running by default
|
||||
machine.fail("systemctl is-active incus.service")
|
||||
machine.fail("systemctl is-active incus-preseed.service")
|
||||
|
||||
# access the socket and ensure the service starts
|
||||
machine.succeed("incus list")
|
||||
|
Loading…
Reference in New Issue
Block a user