diff options
author | Jan Hrnko <jan.hrnko@satoshilabs.com> | 2019-11-01 11:03:23 +0100 |
---|---|---|
committer | Jan Hrnko <jan.hrnko@satoshilabs.com> | 2019-11-01 14:10:53 +0100 |
commit | 4adb3dd7decf722c69792c92a425c796328a7da0 (patch) | |
tree | e3a6a7d4ae341e7c87bc22f6e4c627f7b1c6de9d /nixos/tests/trickster.nix | |
parent | 9b0aefac86e743bded74688773e15744f761678c (diff) |
nixos/trickster: add test
Diffstat (limited to 'nixos/tests/trickster.nix')
-rw-r--r-- | nixos/tests/trickster.nix | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/nixos/tests/trickster.nix b/nixos/tests/trickster.nix new file mode 100644 index 0000000000000..1461a32bb07e8 --- /dev/null +++ b/nixos/tests/trickster.nix @@ -0,0 +1,29 @@ +import ./make-test.nix ({ pkgs, ... }: { + name = "trickster"; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ "1000101" ]; + }; + + nodes = { + prometheus = { ... }: { + services.prometheus.enable = true; + networking.firewall.allowedTCPPorts = [ 9090 ]; + }; + trickster = { ... }: { + services.trickster.enable = true; + }; + }; + + testScript = '' + startAll; + $prometheus->waitForUnit("prometheus.service"); + $prometheus->waitForOpenPort(9090); + $prometheus->waitUntilSucceeds("curl -L http://localhost:9090/metrics | grep 'promhttp_metric_handler_requests_total{code=\"500\"} 0'"); + $trickster->waitForUnit("trickster.service"); + $trickster->waitForOpenPort(8082); + $trickster->waitForOpenPort(9090); + $trickster->waitUntilSucceeds("curl -L http://localhost:8082/metrics | grep 'promhttp_metric_handler_requests_total{code=\"500\"} 0'"); + $trickster->waitUntilSucceeds("curl -L http://prometheus:9090/metrics | grep 'promhttp_metric_handler_requests_total{code=\"500\"} 0'"); + $trickster->waitUntilSucceeds("curl -L http://localhost:9090/metrics | grep 'promhttp_metric_handler_requests_total{code=\"500\"} 0'"); + ''; +}) \ No newline at end of file |