mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
incus: fix instance shutdown when softDaemonRestart enabled
This commit is contained in:
parent
c4407ed139
commit
9b660dff6d
2 changed files with 17 additions and 1 deletions
|
@ -401,6 +401,7 @@ in
|
|||
"incus.socket"
|
||||
];
|
||||
requires = [ "incus.socket" ];
|
||||
wantedBy = config.systemd.services.incus.wantedBy;
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${incus-startup} start";
|
||||
|
|
|
@ -190,7 +190,7 @@ import ../make-test-python.nix (
|
|||
|
||||
def cleanup():
|
||||
# avoid conflict between preseed and cleanup operations
|
||||
machine.wait_for_unit("incus-preseed.service")
|
||||
machine.execute("systemctl kill incus-preseed.service")
|
||||
|
||||
instances = json.loads(machine.succeed("incus list --format json --all-projects"))
|
||||
with subtest("Stopping all running instances"):
|
||||
|
@ -301,6 +301,13 @@ import ../make-test-python.nix (
|
|||
machine.succeed(f"ps {pid}")
|
||||
machine.succeed("systemctl start incus")
|
||||
|
||||
with subtest("Instances stop with incus-startup.service"):
|
||||
pid = machine.succeed(f"incus info container-{variant}1 | grep 'PID'").split(":")[1].strip()
|
||||
machine.succeed(f"ps {pid}")
|
||||
machine.succeed("systemctl stop incus-startup.service")
|
||||
machine.wait_until_fails(f"ps {pid}", timeout=120)
|
||||
machine.succeed("systemctl start incus-startup.service")
|
||||
|
||||
|
||||
cleanup()
|
||||
''
|
||||
|
@ -360,6 +367,14 @@ import ../make-test-python.nix (
|
|||
machine.succeed("systemctl start incus")
|
||||
|
||||
|
||||
with subtest("Instances stop with incus-startup.service"):
|
||||
pid = machine.succeed(f"incus info vm-{variant}1 | grep 'PID'").split(":")[1].strip()
|
||||
machine.succeed(f"ps {pid}")
|
||||
machine.succeed("systemctl stop incus-startup.service")
|
||||
machine.wait_until_fails(f"ps {pid}", timeout=120)
|
||||
machine.succeed("systemctl start incus-startup.service")
|
||||
|
||||
|
||||
cleanup()
|
||||
''
|
||||
) "" initVariants)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue