FairMQ/examples/copypush/test-ex-copypush.sh.in
2018-05-02 16:12:57 +02:00

39 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
export FAIRMQ_PATH=@FAIRMQ_BIN_DIR@
# setup a trap to kill everything if the test fails/timeouts
trap 'kill -TERM $SAMPLER_PID; kill -TERM $SINK1_PID; kill -TERM $SINK2_PID; wait $SAMPLER_PID; wait $SINK1_PID; wait $SINK2_PID;' TERM
SAMPLER="fairmq-ex-copypush-sampler"
SAMPLER+=" --id sampler1"
SAMPLER+=" --verbosity veryhigh"
SAMPLER+=" --control static --color false"
SAMPLER+=" --max-iterations 1"
SAMPLER+=" --channel-config name=data,type=push,method=bind,rateLogging=0,address=tcp://*:5555,address=tcp://*:5556"
@CMAKE_CURRENT_BINARY_DIR@/$SAMPLER &
SAMPLER_PID=$!
SINK1="fairmq-ex-copypush-sink"
SINK1+=" --id sink1"
SINK1+=" --verbosity veryhigh"
SINK1+=" --control static --color false"
SINK1+=" --max-iterations 1"
SINK1+=" --channel-config name=data,type=pull,method=connect,rateLogging=0,address=tcp://localhost:5555"
@CMAKE_CURRENT_BINARY_DIR@/$SINK1 &
SINK1_PID=$!
SINK2="fairmq-ex-copypush-sink"
SINK2+=" --id sink2"
SINK2+=" --verbosity veryhigh"
SINK2+=" --control static --color false"
SINK2+=" --max-iterations 1"
SINK2+=" --channel-config name=data,type=pull,method=connect,rateLogging=0,address=tcp://localhost:5556"
@CMAKE_CURRENT_BINARY_DIR@/$SINK2 &
SINK2_PID=$!
# wait for everything to finish
wait $SAMPLER_PID
wait $SINK1_PID
wait $SINK2_PID