PUT /machines/{name}/config; ensure is idempotent
All checks were successful
checks-impure / test (pull_request) Successful in 1m4s
checks / test (pull_request) Successful in 2m18s

This commit is contained in:
DavHau 2023-10-24 18:48:11 +01:00
parent 362e36c0b9
commit 9f6e01671f

View File

@ -102,6 +102,16 @@ def test_configure_machine(api: TestClient, test_flake: Path) -> None:
assert response.status_code == 200
assert response.json() == {"config": config2}
# ensure PUT on the config is idempotent by passing the config again
# For example, this should not result in the boot.loader.grub.devices being
# set twice (eg. merged)
response = api.put(
"/api/machines/machine1/config",
json=config2,
)
assert response.status_code == 200
assert response.json() == {"config": config2}
# verify the machine config evaluates
response = api.get("/api/machines/machine1/verify")
assert response.status_code == 200