at 17.09-beta 976 B view raw
1# This test runs influxdb and checks if influxdb is up and running 2 3import ./make-test.nix ({ pkgs, ...} : { 4 name = "influxdb"; 5 meta = with pkgs.stdenv.lib.maintainers; { 6 maintainers = [ chaoflow offline ]; 7 }; 8 9 nodes = { 10 one = { config, pkgs, ... }: { 11 services.influxdb.enable = true; 12 }; 13 }; 14 15 testScript = '' 16 startAll; 17 18 $one->waitForUnit("influxdb.service"); 19 20 # create database 21 $one->succeed(q~ 22 curl -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE test" 23 ~); 24 25 # write some points and run simple query 26 $one->succeed(q~ 27 curl -XPOST 'http://localhost:8086/write?db=test' --data-binary 'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000' 28 ~); 29 $one->succeed(q~ 30 curl -GET 'http://localhost:8086/query' --data-urlencode "db=test" --data-urlencode "q=SELECT \"value\" FROM \"cpu_load_short\" WHERE \"region\"='us-west'" | grep "0\.64" 31 ~); 32 ''; 33})