From 139f6d14855388073ae047b37ea9a1f92f76682a Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sat, 17 Jan 2015 15:18:36 -0800 Subject: [PATCH] integration: Use store::network in the query tests. Set up a second SysDB instance which receives all data from the other instance. Query the receiver instead of the collector. --- t/integration/query.sh | 21 +++++++++++++++++++-- t/integration/test_lib.sh | 6 ++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/t/integration/query.sh b/t/integration/query.sh index c9490f6..c9b21b6 100755 --- a/t/integration/query.sh +++ b/t/integration/query.sh @@ -39,15 +39,32 @@ PluginDir "$PLUGIN_DIR" Interval 2 LoadPlugin mock_timeseries +EOF + +run_sysdbd -D -C "$SYSDBD_CONF" +wait_for_sysdbd + +cat < "${SYSDBD_CONF}.sender" +Listen "${SOCKET_FILE}.sender" +PluginDir "$PLUGIN_DIR" +Interval 2 + +LoadPlugin "store::network" + + Server "$SOCKET_FILE" + LoadBackend mock_plugin 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. diff --git a/t/integration/test_lib.sh b/t/integration/test_lib.sh index 469198a..9f501f6 100644 --- a/t/integration/test_lib.sh +++ b/t/integration/test_lib.sh @@ -36,6 +36,9 @@ mkdir "$TESTDIR/backend" cp "$TOP_SRCDIR/t/integration/.libs/mock_timeseries.so" "$TESTDIR" cp "$TOP_SRCDIR/t/integration/.libs/mock_plugin.so" "$TESTDIR/backend" +mkdir "$TESTDIR/store" +cp "$TOP_SRCDIR/src/plugins/store/.libs/network.so" "$TESTDIR/store" + cp "$TOP_SRCDIR"/src/sysdb "$TESTDIR" cp "$TOP_SRCDIR"/src/sysdbd "$TESTDIR" @@ -82,6 +85,9 @@ function stop_sysdbd() { function wait_for_sysdbd() { local socket="$SOCKET_FILE" + if test -n "$1"; then + socket="$1" + fi local i for (( i=0; i<10; i++ )); do if test -e "$socket"; then -- 2.30.2