incus: fix instance shutdown when softDaemonRestart enabled
This commit is contained in:
@@ -401,6 +401,7 @@ in
|
|||||||
"incus.socket"
|
"incus.socket"
|
||||||
];
|
];
|
||||||
requires = [ "incus.socket" ];
|
requires = [ "incus.socket" ];
|
||||||
|
wantedBy = config.systemd.services.incus.wantedBy;
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${incus-startup} start";
|
ExecStart = "${incus-startup} start";
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ import ../make-test-python.nix (
|
|||||||
|
|
||||||
def cleanup():
|
def cleanup():
|
||||||
# avoid conflict between preseed and cleanup operations
|
# 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"))
|
instances = json.loads(machine.succeed("incus list --format json --all-projects"))
|
||||||
with subtest("Stopping all running instances"):
|
with subtest("Stopping all running instances"):
|
||||||
@@ -301,6 +301,13 @@ import ../make-test-python.nix (
|
|||||||
machine.succeed(f"ps {pid}")
|
machine.succeed(f"ps {pid}")
|
||||||
machine.succeed("systemctl start incus")
|
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()
|
cleanup()
|
||||||
''
|
''
|
||||||
@@ -360,6 +367,14 @@ import ../make-test-python.nix (
|
|||||||
machine.succeed("systemctl start incus")
|
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()
|
cleanup()
|
||||||
''
|
''
|
||||||
) "" initVariants)
|
) "" initVariants)
|
||||||
|
|||||||
Reference in New Issue
Block a user