From b1664455ea2457c5eaacc6e73ad59ccb6664509b Mon Sep 17 00:00:00 2001 From: MJB <mjb@it-innovation.soton.ac.uk> Date: Sun, 18 Feb 2018 19:59:10 +0000 Subject: [PATCH] parameterised the streaming test run.sh to set run directory, uri and number of clients --- test/streaming/run.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/test/streaming/run.sh b/test/streaming/run.sh index e13a07a..2c31de7 100755 --- a/test/streaming/run.sh +++ b/test/streaming/run.sh @@ -24,23 +24,30 @@ #// #///////////////////////////////////////////////////////////////////////// +if [ "$#" -ne 3 ]; then + echo "Error: illegal number of arguments: "$# + echo "Usage: run.sh TEST_RUN_DIR STREAM_URI MAX_CLIENTS" + exit +fi + # create test directories -testfolder=$(date +%Y%m%d%H%M%S) -testrundir="/vagrant/test/run" -testdir=$testrundir"/streaming/"$testfolder -echo "Test directory: "$testdir -mkdir -p "$testdir" +TEST_FOLDER=$(date +%Y%m%d%H%M%S) +TEST_RUN_DIR=$1 +TEST_DIR=$TEST_RUN_DIR"/streaming/"$TEST_FOLDER +echo "Test directory: "$TEST_DIR +mkdir -p "$TEST_DIR" # run testplan -cd $testdir +cd $TEST_DIR #jmeter -n -LDEBUG -t /vagrant/test/streaming/testplan.jmx -l results.jtx -j jmeter.log # quick bash equivalent in case Jmeter fails +STREAM_URI=$2 COUNTER=0 -MAX=10 -while [ $COUNTER -lt $MAX ]; do - cvlc -Vdummy --no-audio http://192.168.50.11/test_video/stream.mpd &>/tmp/stdout$COUNTER & +MAX_CLIENTS=$3 +while [ $COUNTER -lt $MAX_CLIENTS ]; do + cvlc -Vdummy --no-audio $STREAM_URI &>$TEST_DIR/stdout$COUNTER & sleep 1 let COUNTER=COUNTER+1 done -- GitLab