|
74 | 74 | };
|
75 | 75 | };
|
76 | 76 |
|
77 |
| - testScript = |
78 |
| - let |
79 |
| - in '' |
80 |
| - import json |
81 |
| - machine.wait_for_unit("rabbitmq.service") |
82 |
| - machine.wait_for_unit("prepare-rabbitmq-for-sensu.service") |
83 |
| - machine.wait_for_unit("sensu-client.service") |
84 |
| - machine.wait_for_open_port(3031) |
| 77 | + testScript = '' |
| 78 | + import json |
| 79 | + machine.wait_for_unit("rabbitmq.service") |
| 80 | + machine.wait_for_unit("prepare-rabbitmq-for-sensu.service") |
| 81 | + machine.wait_for_unit("sensu-client.service") |
| 82 | + machine.wait_for_open_port(3031) |
85 | 83 |
|
86 |
| - with subtest("sensu client should respond to HTTP"): |
87 |
| - out = machine.succeed("curl localhost:3031/brew") |
88 |
| - assert {"response":"I'm a teapot!"} == json.loads(out) |
| 84 | + with subtest("sensu client should respond to HTTP"): |
| 85 | + out = machine.succeed("curl localhost:3031/brew") |
| 86 | + assert {"response":"I'm a teapot!"} == json.loads(out) |
89 | 87 |
|
90 |
| - with subtest("sensu client config should have basic checks configured"): |
91 |
| - out = machine.succeed("sensu-client-show-config") |
92 |
| - config = json.loads(out) |
93 |
| - assert "disk" in config["checks"] |
94 |
| - assert "firewall-active" in config["checks"] |
95 |
| - assert "uptime" in config["checks"] |
| 88 | + with subtest("sensu client config should have basic checks configured"): |
| 89 | + out = machine.succeed("sensu-client-show-config") |
| 90 | + config = json.loads(out) |
| 91 | + assert "disk" in config["checks"] |
| 92 | + assert "firewall-active" in config["checks"] |
| 93 | + assert "uptime" in config["checks"] |
96 | 94 |
|
97 |
| - with subtest("sensu client should subscribe as consumer to rabbitmq"): |
98 |
| - machine.wait_until_succeeds("sudo -u rabbitmq rabbitmqctl list_consumers -p /sensu | grep rabbit@machine") |
99 |
| - ''; |
| 95 | + with subtest("sensu client should subscribe as consumer to rabbitmq"): |
| 96 | + machine.wait_until_succeeds("sudo -u rabbitmq rabbitmqctl list_consumers -p /sensu | grep rabbit@machine") |
| 97 | +
|
| 98 | + with subtest("check_ping should be able to ping the VM"): |
| 99 | + machine.succeed("${pkgs.monitoring-plugins}/bin/check_ping localhost -w 200,10% -c 500,30%") |
| 100 | + ''; |
100 | 101 | })
|
0 commit comments