Break a machine with a unit that does not exist
A file in a missing directory is not impossible: the host creates the parents, which is correct and meant the first version of this test broke nothing at all — and then reported that the board could not name a failure that never happened. A unit that does not exist fails immediately and in the host's own words, which is also what the board is being asked to show.
This commit is contained in:
@@ -1140,9 +1140,13 @@ test("the board names the machine that is not doing what it was told", {
|
|||||||
assert.ok(up, `the board does not answer:\n${said.out}`);
|
assert.ok(up, `the board does not answer:\n${said.out}`);
|
||||||
|
|
||||||
// Something a person opened it for: give a machine a declaration it cannot apply.
|
// Something a person opened it for: give a machine a declaration it cannot apply.
|
||||||
|
//
|
||||||
|
// A unit that does not exist, because the host says so immediately and in its own words. A file
|
||||||
|
// in a missing directory is not impossible — the host creates the parents, which is correct and
|
||||||
|
// made the first version of this test break nothing at all.
|
||||||
await must("anchor", `printf %s '{"module":"impossible","version":"1",` +
|
await must("anchor", `printf %s '{"module":"impossible","version":"1",` +
|
||||||
`"resources":[{"id":"nowhere","type":"file","path":"/does/not/exist/at/all/file",` +
|
`"resources":[{"id":"nowhere","type":"service","unit":"nothing-like-this.service",` +
|
||||||
`"content":"x","mode":"0644"}]}' > /tmp/impossible.json`);
|
`"state":"running"}]}' > /tmp/impossible.json`);
|
||||||
await must("anchor", `docker cp /tmp/impossible.json mesh-control:/impossible.json`);
|
await must("anchor", `docker cp /tmp/impossible.json mesh-control:/impossible.json`);
|
||||||
await mesh("module add /impossible.json");
|
await mesh("module add /impossible.json");
|
||||||
await mesh("assign laptop impossible");
|
await mesh("assign laptop impossible");
|
||||||
|
|||||||
Reference in New Issue
Block a user