Tests for MQ examples

This commit is contained in:
Alexey Rybalchenko
2017-08-23 11:12:29 +02:00
parent f6ee1cdf57
commit bd8be1436e
57 changed files with 658 additions and 118 deletions

View File

@@ -0,0 +1,40 @@
#!/bin/bash
ex6config="@CMAKE_BINARY_DIR@/bin/config/ex6-multiple-channels.json"
# setup a trap to kill everything if the test fails/timeouts
trap 'kill -TERM $SAMPLER_PID; kill -TERM $SINK_PID; kill -TERM $BROADCASTER_PID; wait $SAMPLER_PID; wait $SINK_PID; wait $BROADCASTER_PID;' TERM
SINK="ex6-sink"
SINK+=" --id sink1"
SINK+=" --max-iterations 1"
SINK+=" --control static --log-color false"
SINK+=" --mq-config $ex6config"
@CMAKE_BINARY_DIR@/bin/examples/MQ/6-multiple-channels/$SINK &
SINK_PID=$!
sleep 1
SAMPLER="ex6-sampler"
SAMPLER+=" --id sampler1"
SAMPLER+=" --max-iterations 1"
SAMPLER+=" --control static --log-color false"
SAMPLER+=" --mq-config $ex6config"
@CMAKE_BINARY_DIR@/bin/examples/MQ/6-multiple-channels/$SAMPLER &
SAMPLER_PID=$!
BROADCASTER="ex6-broadcaster"
BROADCASTER+=" --id broadcaster1"
BROADCASTER+=" --control static --log-color false"
BROADCASTER+=" --mq-config $ex6config"
@CMAKE_BINARY_DIR@/bin/examples/MQ/6-multiple-channels/$BROADCASTER &
BROADCASTER_PID=$!
wait $SAMPLER_PID
wait $SINK_PID
# stop broadcaster
kill -SIGINT $BROADCASTER_PID
# wait for broadcaster to finish
wait $BROADCASTER_PID