3
0
Fork 0
forked from mirrors/nixpkgs

nixos: unbreak influxdb test (due to new API)

Data from the documentation example[1] was used.

[1] https://docs.influxdata.com/influxdb/v1.0/guides/writing_data/

[Bjørn: change commit message.]
This commit is contained in:
Eric Sagnes 2016-09-08 21:18:21 +09:00 committed by Bjørn Forsman
parent b082f75f4d
commit f39f829441

View file

@ -22,18 +22,15 @@ import ./make-test.nix ({ pkgs, ...} : {
# create database
$one->succeed(q~
curl -X POST 'http://localhost:8086/db?u=root&p=root' \
-d '{"name": "test"}'
curl -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE test"
~);
# write some points and run simple query
$one->succeed(q~
curl -X POST 'http://localhost:8086/db/test/series?u=root&p=root' \
-d '[{"name":"foo","columns":["val"],"points":[[6666]]}]'
curl -XPOST 'http://localhost:8086/write?db=test' --data-binary 'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000'
~);
$one->succeed(q~
curl -G 'http://localhost:8086/db/test/series?u=root&p=root' \
--data-urlencode 'q=select * from foo limit 1' | grep 6666
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"
~);
'';
})