diff options
author | Niklas Hambüchen <mail@nh2.me> | 2019-12-27 01:23:45 +0100 |
---|---|---|
committer | Niklas Hambüchen <mail@nh2.me> | 2019-12-27 01:23:45 +0100 |
commit | ad339ad44552fe42b4b3e6178f5103259ca4424a (patch) | |
tree | 254804e56a1ce6a070d3c2878aeaa87840a57807 /nixos/tests/graphite.nix | |
parent | 826d61e5d9602969092fb129c7e0944a2a91249a (diff) |
nixosTests.graphite: port to python.
The test did not succeed for me before this commit because the dependencies fail their tests (see added comment).
Diffstat (limited to 'nixos/tests/graphite.nix')
-rw-r--r-- | nixos/tests/graphite.nix | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/nixos/tests/graphite.nix b/nixos/tests/graphite.nix index 27a87bdbb9f29..ba3c73bb878d7 100644 --- a/nixos/tests/graphite.nix +++ b/nixos/tests/graphite.nix @@ -1,6 +1,11 @@ -import ./make-test.nix ({ pkgs, ... } : +import ./make-test-python.nix ({ pkgs, ... } : { name = "graphite"; + meta = { + # Fails on dependency `python-2.7-Twisted`'s test suite + # complaining `ImportError: No module named zope.interface`. + broken = true; + }; nodes = { one = { ... }: { @@ -22,20 +27,20 @@ import ./make-test.nix ({ pkgs, ... } : }; testScript = '' - startAll; - $one->waitForUnit("default.target"); - $one->waitForUnit("graphiteWeb.service"); - $one->waitForUnit("graphiteApi.service"); - $one->waitForUnit("graphitePager.service"); - $one->waitForUnit("graphite-beacon.service"); - $one->waitForUnit("carbonCache.service"); - $one->waitForUnit("seyren.service"); + start_all() + one.wait_for_unit("default.target") + one.wait_for_unit("graphiteWeb.service") + one.wait_for_unit("graphiteApi.service") + one.wait_for_unit("graphitePager.service") + one.wait_for_unit("graphite-beacon.service") + one.wait_for_unit("carbonCache.service") + one.wait_for_unit("seyren.service") # The services above are of type "simple". systemd considers them active immediately # even if they're still in preStart (which takes quite long for graphiteWeb). # Wait for ports to open so we're sure the services are up and listening. - $one->waitForOpenPort(8080); - $one->waitForOpenPort(2003); - $one->succeed("echo \"foo 1 `date +%s`\" | nc -N localhost 2003"); - $one->waitUntilSucceeds("curl 'http://localhost:8080/metrics/find/?query=foo&format=treejson' --silent | grep foo >&2"); + one.wait_for_open_port(8080) + one.wait_for_open_port(2003) + one.succeed('echo "foo 1 `date +%s`" | nc -N localhost 2003') + one.wait_until_succeeds("curl 'http://localhost:8080/metrics/find/?query=foo&format=treejson' --silent | grep foo >&2") ''; }) |