From 5e6e21d451f2f1a9725a031323664bb593768c4f Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 21 Jan 2015 13:25:33 +0000 Subject: [PATCH] added first version of automated test script git-svn-id: https://zerberus.eonerc.rwth-aachen.de:8443/svn/s2ss/trunk@275 8ec27952-4edc-4aab-86aa-e87bb2611832 --- contrib/tests.sh | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100755 contrib/tests.sh diff --git a/contrib/tests.sh b/contrib/tests.sh new file mode 100755 index 000000000..fdb36faff --- /dev/null +++ b/contrib/tests.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +set -e + +# Configuration + +HOST=$(hostname -s) + +#LOCAL_IP=10.10.12.2 +LOCAL_IP=127.0.0.1 +LOCAL_PORT=12001 + +#REMOTE_IP=10.10.12.3 +REMOTE_IP=127.0.0.1 +REMOTE_PORT=12002 + +#LOCAL_DIR=/s2ss/server/ +#REMOTE_DIR=/s2ss/server/ +LOCAL_DIR=/home/stv0g/workspace/rwth/acs/s2ss/server +REMOTE_DIR=$LOCAL_DIR +######################### End of Configuration ################################ +# There's no need to change something below this line + +SSH="ssh -T $REMOTE_IP" + +TEST_CONFIG=" + affinity = 0x02; # Mask of cores the server should run on + priority = 50; # Scheduler priority for the server + debug = 10; # The level of verbosity for debug messages + stats = 3; # The interval in seconds fo path statistics + + nodes = { + remote = { + type = \"udp\"; + local = \"$LOCAL_IP:$LOCAL_PORT\"; + remote = \"$REMOTE_IP:$REMOTE_PORT\"; + } + }; +" + + +REMOTE_CONFIG=" + affinity = 0x02; # Mask of cores the server should run on + priority = 50; # Scheduler priority for the server + debug = 0; # The level of verbosity for debug messages + stats = 0; # The interval in seconds fo path statistics + + nodes = { + remote = { + type = \"udp\"; + local = \"$REMOTE_IP:$REMOTE_PORT\"; + remote = \"$LOCAL_IP:$LOCAL_PORT\"; + }, + }; + + paths = ({ + in = \"remote\"; + out = \"remote\"; + }); +" + +# Start remote server +$SSH -n "echo '$REMOTE_CONFIG' | sudo $REMOTE_DIR/server -" & +REMOTE_PID=$! +echo "Started remote server with pid: $REMOTE_PID" + +# Start tests +echo "$TEST_CONFIG" | $LOCAL_DIR/test - rtt -f 3 -c 100000 3>> test_output + +# Stop remote server +$SSH sudo kill $REMOTE_PID +echo "Stopped remote server with pid: $REMOTE_PID" \ No newline at end of file