Code

store: Pass on all stored objects to store writer plugins.
[sysdb.git] / t / integration / query.sh
index 5536c701c9c517eefd3882518e0e2eee1683a88a..b2e6ed82a644074cb3745b58b3d45e388a471313 100755 (executable)
@@ -54,7 +54,7 @@ output="$( run_sysdb_nouser -H "$SOCKET_FILE" \
 echo "$output" | grep -F 'Access denied'
 
 # On parse errors, expect a non-zero exit code.
-output="$( run_sysdb -H "$SOCKET_FILE" -c INVALID )" && exit 1
+output="$( run_sysdb -H "$SOCKET_FILE" -c INVALID 2>&1 )" && exit 1
 echo "$output" | grep "Failed to parse query 'INVALID'"
 echo "$output" | grep "parse error: syntax error"
 
@@ -99,7 +99,7 @@ echo "$output" | grep -F 'other.host.name' && exit 1
 echo "$output" | grep -F 'some.host.name' && exit 1
 
 output="$( run_sysdb -H "$SOCKET_FILE" \
-  -c "FETCH host 'host1.example.com' FILTER last_update < 0" )" \
+  -c "FETCH host 'host1.example.com' FILTER last_update < 0" 2>&1 )" \
   && exit 1
 echo "$output" | grep -F 'not found'
 
@@ -107,16 +107,28 @@ echo "$output" | grep -F 'not found'
        | run_sysdb -H "$SOCKET_FILE"
 
 # When requesting information for unknown hosts, expect a non-zero exit code.
-output="$( run_sysdb -H "$SOCKET_FILE" -c "FETCH host 'does.not.exist'" )" \
-       && exit 1
+output="$( run_sysdb -H "$SOCKET_FILE" \
+       -c "FETCH host 'does.not.exist'" 2>&1 )" && exit 1
 echo "$output" | grep -F 'not found'
 
 run_sysdb -H "$SOCKET_FILE" \
                -c "TIMESERIES 'invalid.host'.'invalid-metric'" && exit 1
 
 # Does not work yet since there is no fetcher plugin.
-run_sysdb -H "$SOCKET_FILE" \
-               -c "TIMESERIES 'some.host.name'.'foo/bar/qux'" && exit 1
+output="$( run_sysdb -H "$SOCKET_FILE" \
+       -c "TIMESERIES 'some.host.name'.'foo/bar/qux'" )"
+echo "$output" \
+       | grep -F '"value": "1.000000"' \
+       | grep -F '"value": "2.000000"' \
+       | grep -F '"value": "3.000000"' \
+       | grep -F '"value": "4.000000"' \
+       | grep -F '"value": "5.000000"' \
+       | grep -F '"value": "6.000000"' \
+       | grep -F '"value": "7.000000"' \
+       | grep -F '"value": "8.000000"' \
+       | grep -F '"value": "9.000000"' \
+       | grep -F '"value": "10.000000"'
 
 stop_sysdbd
 
+# vim: set tw=78 sw=4 ts=4 noexpandtab :