diff options
author | Silvan Mosberger <contact@infinisil.com> | 2020-01-30 14:02:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-30 14:02:42 +0100 |
commit | 32718c9992f5b49fbe6fb81bfc3dd3cc8316a3a8 (patch) | |
tree | 65efba68a7e3b8f27e8f092b835f4cce000436bb /nixos/tests | |
parent | 3153fad73fef25d790d0b4c966e712726c5a5df4 (diff) | |
parent | 4b7d28b0f993b79a941bd6771dea23fbcc375837 (diff) | |
download | nixlib-32718c9992f5b49fbe6fb81bfc3dd3cc8316a3a8.tar nixlib-32718c9992f5b49fbe6fb81bfc3dd3cc8316a3a8.tar.gz nixlib-32718c9992f5b49fbe6fb81bfc3dd3cc8316a3a8.tar.bz2 nixlib-32718c9992f5b49fbe6fb81bfc3dd3cc8316a3a8.tar.lz nixlib-32718c9992f5b49fbe6fb81bfc3dd3cc8316a3a8.tar.xz nixlib-32718c9992f5b49fbe6fb81bfc3dd3cc8316a3a8.tar.zst nixlib-32718c9992f5b49fbe6fb81bfc3dd3cc8316a3a8.zip |
VictoriaMetrics: init at v1.32.5, add module, tests (#78038)
VictoriaMetrics: init at v1.32.5, add module, tests
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/victoriametrics.nix | 31 |
2 files changed, 32 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 8c11464f9d68..89426865e1ac 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -293,6 +293,7 @@ in upnp = handleTest ./upnp.nix {}; uwsgi = handleTest ./uwsgi.nix {}; vault = handleTest ./vault.nix {}; + victoriametrics = handleTest ./victoriametrics.nix {}; virtualbox = handleTestOn ["x86_64-linux"] ./virtualbox.nix {}; wireguard = handleTest ./wireguard {}; wireguard-generated = handleTest ./wireguard/generated.nix {}; diff --git a/nixos/tests/victoriametrics.nix b/nixos/tests/victoriametrics.nix new file mode 100644 index 000000000000..73ef8b728615 --- /dev/null +++ b/nixos/tests/victoriametrics.nix @@ -0,0 +1,31 @@ +# This test runs influxdb and checks if influxdb is up and running + +import ./make-test-python.nix ({ pkgs, ...} : { + name = "victoriametrics"; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ yorickvp ]; + }; + + nodes = { + one = { ... }: { + services.victoriametrics.enable = true; + }; + }; + + testScript = '' + start_all() + + one.wait_for_unit("victoriametrics.service") + + # write some points and run simple query + out = one.succeed( + "curl -d 'measurement,tag1=value1,tag2=value2 field1=123,field2=1.23' -X POST 'http://localhost:8428/write'" + ) + cmd = """curl -s -G 'http://localhost:8428/api/v1/export' -d 'match={__name__!=""}'""" + # data takes a while to appear + one.wait_until_succeeds(f"[[ $({cmd} | wc -l) -ne 0 ]]") + out = one.succeed(cmd) + assert '"values":[123]' in out + assert '"values":[1.23]' in out + ''; +}) |