Merge pull request 'PUT /machines/{name}/config; ensure is idempotent' (#434) from DavHau-dave into main
All checks were successful
assets1 / test (push) Successful in 14s
checks-impure / test (push) Successful in 35s
checks / test (push) Successful in 36s

This commit is contained in:
clan-bot 2023-10-24 17:50:51 +00:00
commit f7031bdbdb

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