diff options
author | Adam C. Stephens <2071575+adamcstephens@users.noreply.github.com> | 2024-04-18 11:55:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-18 11:55:34 -0400 |
commit | 67b5379607baa39063ca60d259f580844bbdbf09 (patch) | |
tree | fb88a0915a7c467130d5c4eb88465340494603e5 /nixos/tests | |
parent | bc279bbacf1f11a48e1f9cdf32228f27e28f0291 (diff) | |
parent | 76c69af624667a412e0afabdda43b9c3f0c7c649 (diff) |
Merge pull request #304919 from adamcstephens/lxd/cpu-hotplug
nixos/lxd-virtual-machine: enable CPU hotplug for x86_64
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/incus/virtual-machine.nix | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nixos/tests/incus/virtual-machine.nix b/nixos/tests/incus/virtual-machine.nix index ab378c7b9490e..48178aaed32c4 100644 --- a/nixos/tests/incus/virtual-machine.nix +++ b/nixos/tests/incus/virtual-machine.nix @@ -57,5 +57,14 @@ in with subtest("lxd-agent has a valid path"): machine.succeed("incus exec ${instance-name} -- bash -c 'true'") + + with subtest("guest supports cpu hotplug"): + machine.succeed("incus config set ${instance-name} limits.cpu=1") + count = int(machine.succeed("incus exec ${instance-name} -- nproc").strip()) + assert count == 1, f"Wrong number of CPUs reported, want: 1, got: {count}" + + machine.succeed("incus config set ${instance-name} limits.cpu=2") + count = int(machine.succeed("incus exec ${instance-name} -- nproc").strip()) + assert count == 2, f"Wrong number of CPUs reported, want: 2, got: {count}" ''; }) |