Code

integration: Use store::network in the query tests.
authorSebastian Harl <sh@tokkee.org>
Sat, 17 Jan 2015 23:18:36 +0000 (15:18 -0800)
committerSebastian Harl <sh@tokkee.org>
Sat, 17 Jan 2015 23:18:36 +0000 (15:18 -0800)
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
t/integration/test_lib.sh

index c9490f6a5218866728ed346d7b249e42bf584452..c9b21b6063d001ae29bd92d302259dc41671c043 100755 (executable)
@@ -39,15 +39,32 @@ 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.
index 469198afd4c7341bb56c0ce841158d28ee3d6261..9f501f6c3f7ccbf587c6637f6560074102486d87 100644 (file)
@@ -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