diff --git a/t/integration/query.sh b/t/integration/query.sh
index b2e6ed82a644074cb3745b58b3d45e388a471313..5bd09b4507961be4614dd59f7c54334fef3d1bf7 100755 (executable)
--- a/t/integration/query.sh
+++ b/t/integration/query.sh
PluginDir "$PLUGIN_DIR"
Interval 2
+LoadPlugin mock_timeseries
+EOF
+
+run_sysdbd -D -C "$SYSDBD_CONF"
+wait_for_sysdbd
+
+cat <<EOF > "${SYSDBD_CONF}.sender"
+Listen "${SOCKET_FILE}.sender"
+PluginDir "$PLUGIN_DIR"
+Interval 2
+
+LoadPlugin "store::network"
+<Plugin "store::network">
+ Server "$SOCKET_FILE"
+</Plugin>
+
LoadBackend mock_plugin
<Backend "mock_plugin">
</Backend>
EOF
-run_sysdbd -D -C "$SYSDBD_CONF"
+run_sysdbd_foreground -D -C "${SYSDBD_CONF}.sender" &
+SYSDBD_PID2=$!
+trap "kill \$SYSDBD_PID2" EXIT
+wait_for_sysdbd "${SOCKET_FILE}.sender"
-wait_for_sysdbd
+# wait for initial data
sleep 3
# Invalid user.
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" 2>&1 )" \
+ -c "FETCH host 'host1.example.com' FILTER last_update < 0s" 2>&1 )" \
&& exit 1
echo "$output" | grep -F 'not found'
(echo 'LIST hosts;'; sleep 1; echo "FETCH host 'host1.example.com'") \
| run_sysdb -H "$SOCKET_FILE"
+output="$( run_sysdb -H "$SOCKET_FILE" \
+ -c "FETCH host 'host1.example.com' FILTER age < 0s" 2>&1 )" && exit 1
+echo "$output" | grep -F 'not found'
+
# When requesting information for unknown hosts, expect a non-zero exit code.
output="$( run_sysdb -H "$SOCKET_FILE" \
-c "FETCH host 'does.not.exist'" 2>&1 )" && exit 1