Merge pull request 'PUT /machines/{name}/config; ensure is idempotent' (#434) from DavHau-dave into main
This commit is contained in:
commit
f7031bdbdb
@ -102,6 +102,16 @@ def test_configure_machine(api: TestClient, test_flake: Path) -> None:
|
|||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
assert response.json() == {"config": config2}
|
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
|
# verify the machine config evaluates
|
||||||
response = api.get("/api/machines/machine1/verify")
|
response = api.get("/api/machines/machine1/verify")
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
Loading…
Reference in New Issue
Block a user