]> p2p-next.cs.pub.ro Git - p2p-testing-infrastructure.git/commitdiff
ControlScripts: update scripts to be aware of pre-run and post-run scripts and scenar...
authorRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Fri, 6 Aug 2010 09:15:34 +0000 (12:15 +0300)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Fri, 6 Aug 2010 09:15:34 +0000 (12:15 +0300)
15 files changed:
ControlScripts/detect_complete_client.sh
ControlScripts/parse_client_log.sh
ControlScripts/parse_hrk.sh
ControlScripts/parse_leecher.sh
ControlScripts/run_scenario.sh
ControlScripts/schedule_client.sh
ControlScripts/start_doe.sh
ControlScripts/start_hrk_leecher.sh
ControlScripts/start_hrk_seeder.sh
ControlScripts/start_leecher.sh
ControlScripts/start_proxy.sh
ControlScripts/start_seeder.sh
ControlScripts/start_tracker.sh
ControlScripts/start_tribler.sh
ControlScripts/stop_client.sh

index 638a206dc59fe233506ffafeb1a835597f332218..19c44e811cb121ebdac41bc71e5abc12d2d114be 100755 (executable)
 # use _DEBUG="off" to turn off debug printing
 _DEBUG="on"
 
-if test $# -ne 2; then
-       echo "usage: $0 client-type log-file" 1>&2
+if test $# -ne 1; then
+       echo "usage: $0 log-file" 1>&2
        exit 1
 fi
 
 # Read the global configuration variables
 source ../ConfigFiles/globalconfig.txt
 
+# Read scenarion configuration file (CLIENT_TYPE)
+source ${BASE_PATH}/ClientWorkingFolders/TmpLogs/scenario_config
+
 # Read client mappings configuration file
 source ../ConfigFiles/client_script_mappings
 
-client_type=$1
-log_file=$2
+log_file=$1
 
-detect_complete_client ${client_type} ${log_file}
+detect_complete_client ${CLIENT_TYPE} ${log_file}
index 13deef5e376e46cf25fcbe92bdbe204b186d5391..ff5f7d4f0cc67608f863b15767e267e74cb55d08 100755 (executable)
 # use _DEBUG="off" to turn off debug printing
 _DEBUG="on"
 
-if test $# -ne 3; then
-       echo "usage: $0 client-type log-folder log-file" 1>&2
+if test $# -ne 2; then
+       echo "usage: $0 log-folder log-file" 1>&2
        exit 1
 fi
 
 # Read the global configuration variables
 source ../ConfigFiles/globalconfig.txt
 
+# Read scenarion configuration file (CLIENT_TYPE)
+source ${BASE_PATH}/ClientWorkingFolders/TmpLogs/scenario_config
+
 # Read client mappings configuration file
 source ../ConfigFiles/client_script_mappings
 
-client_type=$1
-log_folder=$2
-log_file=$3
+log_folder=$1
+log_file=$2
 
-parse_client_log ${client_type} ${log_folder} ${log_file}
+parse_client_log ${CLIENT_TYPE} ${log_folder} ${log_file}
index b996e27c103aedb9ca8e8c65a573865278921429..863e36de0c93001a726210f1c75c30187838b7b9 100755 (executable)
@@ -2,9 +2,7 @@
 #
 # 2010 Razvan Deaconescu, razvan.deaconescu@cs.pub.ro
 #
-# Bash script used to parse the log file generated by a seeder client and to generate a data file
-# The script
-#  * TODO
+# Bash script used to parse the log file generated by a hrk client
 #
 # Script arguments:
 #  * a folder where the log and data files are stored
index 32b476da2649ecc2b95eca65f1b799e7e5f4b6ca..11974e860455d0027ef3fa152d5e736f12d2afff 100755 (executable)
@@ -2,9 +2,8 @@
 #
 # Copyright: George Milescu 2010 - george.milescu@gmail.com
 #
-# Bash script used to parse the log file generated by a regular (leecher) client and to generate a data file
-# The script
-#  * TODO
+# Bash script used to parse the log file generated by a regular
+#(leecher) client and to generate a data file
 #
 # Script arguments:
 #  * a folder where the log and data files are stored
index 60f8abd9c3d1cfc2298da4ead39ce2da637a9b62..67ecd338dbbe28fd32bc08fb09f131f44c95d7dd 100755 (executable)
@@ -137,7 +137,7 @@ scenario_schedule()
        echo "---------------------- scenario_schedule" >> $ERR_LOG
        while IFS=$'\t' read SERVER PORT USER REMOTE_PATH REMOTE_IF DL_BW DL_BURST UL_BW UL_BURST PRE_RUN_SCRIPT POST_RUN_SCRIPT CLIENT_TYPE TORRENT_FILE PERIODS; do
                echo " ** Scheduling $SERVER:$PORT"
-               if ! ssh -f -p $PORT ${USER}@${SERVER} "cd $REMOTE_PATH/P2P-Testing-Infrastructure/ControlScripts; ./schedule_client.sh ${CLIENT_TYPE} ${TORRENT_FILE} \"${PERIODS}\" &> $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/\$(hostname).log" &>> $ERR_LOG; then
+               if ! ssh -f -p $PORT ${USER}@${SERVER} "cd $REMOTE_PATH/P2P-Testing-Infrastructure/ControlScripts; ./schedule_client.sh &> $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/\$(hostname).log" &>> $ERR_LOG; then
                        echo "Error: error running client_schedule.sh on $SERVER"
                        break
                fi
@@ -156,7 +156,7 @@ scenario_wait() {
                # Start the scripts on the remote clients
                # -n is used to redirect the ssh stdin from /dev/null, in order to keep the stdin in place for the read command
                # The ssh call is blocking
-               if ! ssh -n -p $PORT ${USER}@${SERVER} "cd $REMOTE_PATH/P2P-Testing-Infrastructure/ControlScripts; ./detect_complete_client.sh ${CLIENT_TYPE} $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/\$(hostname).log" &>> $ERR_LOG; then
+               if ! ssh -n -p $PORT ${USER}@${SERVER} "cd $REMOTE_PATH/P2P-Testing-Infrastructure/ControlScripts; ./detect_complete_client.sh $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/\$(hostname).log" &>> $ERR_LOG; then
                        echo "Error: error while waiting for client on $SERVER to finish"
                        break
                fi
@@ -174,7 +174,7 @@ scenario_clean() {
 
                # stopping the client on the server
                # -n is used to redirect the ssh stdin from /dev/null, in order to keep the stdin in place for the read command
-               if ! ssh -n -p $PORT ${USER}@${SERVER} "cd $REMOTE_PATH/P2P-Testing-Infrastructure/ControlScripts; ./stop_client.sh ${CLIENT_TYPE}" &>> $ERR_LOG; then
+               if ! ssh -n -p $PORT ${USER}@${SERVER} "cd $REMOTE_PATH/P2P-Testing-Infrastructure/ControlScripts; ./stop_client.sh" &>> $ERR_LOG; then
                        echo "Error: error stopping client on $SERVER"
                fi
                # wait for the remote client to finish completly
@@ -214,7 +214,7 @@ scenario_parse() {
 
                echo " with hostname $REMOTE_HOSTNAME"
 
-               if ! ./parse_client_log.sh ${CLIENT_TYPE} $SCENARIO_RESULTS_FOLDER ${REMOTE_HOSTNAME}.log; then
+               if ! ./parse_client_log.sh $SCENARIO_RESULTS_FOLDER ${REMOTE_HOSTNAME}.log; then
                        echo "Error parsing file $SCENARIO_RESULTS_FOLDER/${REMOTE_HOSTNAME}.log"
                        exit 1
                fi
index 3d826747b74b80637f6408b785adcea279c2aeca..3ed77de2208ab7e591011709d6b74faed7e717af 100755 (executable)
@@ -15,23 +15,15 @@ DEBUG()
        test ${_DEBUG} = "on" && $@
 }
 
-if test $# -lt 3; then
-       echo "usage: $0 client-type torrent-file periods" 1>&2
-       exit 1
-fi
-
 # Read the global configuration variables
 source ../ConfigFiles/globalconfig.txt
 
+# Read scenarion configuration file
+source ${BASE_PATH}/ClientWorkingFolders/TmpLogs/scenario_config
+
 # Read client mappings configuration file
 source ../ConfigFiles/client_script_mappings
 
-client_type=$1
-torrent_file=$2
-
-shift 2
-periods=$@
-
 client_pid=0
 
 declare start_time
@@ -40,7 +32,7 @@ declare -a suspend_resume
 
 parse_periods()
 {
-       local tmp_array=($(echo "$periods" | sed 's/[,()]/ /g'))
+       local tmp_array=($(echo "$PERIODS" | sed 's/[,()]/ /g'))
        start_time=${tmp_array[0]}
        local len=${#tmp_array[@]}
 
@@ -84,7 +76,7 @@ DEBUG echo "stop_time is ${stop_time}"
 
 to_sleep=${start_time}
 sleep ${to_sleep}
-start_client ${client_type} ${torrent_file}
+start_client
 background_pid=$!
 DEBUG echo "background_pid is ${background_pid}"
 old_time=${start_time}
@@ -111,4 +103,4 @@ test_infinite ${stop_time}
 
 to_sleep=$((${stop_time} - ${old_time}))
 sleep ${to_sleep}
-stop_client ${client_type}
+stop_client
index 61cc7fd99e348e3979792ffa3c7a97fbd4912f66..948394bd191d73421015e2d38787c0122442400e 100755 (executable)
@@ -7,20 +7,12 @@
 #  * changes current working directory to proxyservice-m32
 #  * starts a tribler cmd-line instance with the supplied .torrent file. The .torrent file must be located in the TorrentsAndData folder
 #  * at the end deletes the downloaded data
-#
-# Script arguments:
-#  * .torrent file
-
-if [ ! $# -eq 1 ]; then
-       echo "usage: $0 torrent-file"
-       exit 1
-fi
 
 # Read the global configuration variables
 source ../ConfigFiles/globalconfig.txt
 
-# Read arguments
-TORRENT_FILE=$1
+# Read scenarion configuration file (TORRENT_FILE)
+source ${BASE_PATH}/ClientWorkingFolders/TmpLogs/scenario_config
 
 export PYTHONPATH=$PYTHONPATH:.
 
index 2a0c3f861ac17298f547f903a52a5868657ed33c..5e6dcc5fda0cb9b7f11b3e698168d0dcd3ddc8b6 100755 (executable)
@@ -8,20 +8,15 @@
 #  * starts a hrktorrent session - use LD_LIBRARY_PATH to point to
 #    libtorrent-rasterbar location
 #  * at the end deletes the downloaded data
-#
-# Script arguments:
-#  * .torrent file
-
-if [ ! $# -eq 1 ]; then
-       echo "usage: $0 torrent-file"
-       exit 1
-fi
 
 # Read the global configuration variables
 source ../ConfigFiles/globalconfig.txt
 
-# Read arguments
-TORRENT_FILE=$1
+# Read scenarion configuration file (TORRENT_FILE)
+source ${BASE_PATH}/ClientWorkingFolders/TmpLogs/scenario_config
+
+# Read the global configuration variables
+source ../ConfigFiles/globalconfig.txt
 
 cd $WORKING_FOLDER_REL_PATH/Regular/
 
index d6cf4d5b67f17fdc91e832afc00a9998c2b1524d..cf5238888fa643e223e6f9406d95358e74e74fba 100755 (executable)
@@ -8,20 +8,12 @@
 #  * starts a hrktorrent session - use LD_LIBRARY_PATH to point to
 #    libtorrent-rasterbar location
 #  * at the end deletes the downloaded data
-#
-# Script arguments:
-#  * .torrent file
-
-if [ ! $# -eq 1 ]; then
-       echo "usage: $0 torrent-file"
-       exit 1
-fi
 
 # Read the global configuration variables
 source ../ConfigFiles/globalconfig.txt
 
-# Read arguments
-TORRENT_FILE=$1
+# Read scenarion configuration file (TORRENT_FILE)
+source ${BASE_PATH}/ClientWorkingFolders/TmpLogs/scenario_config
 
 cd $WORKING_FOLDER_REL_PATH/TorrentsAndData/
 
index c92dc74450e67868c37ac93cee2d1d0464ebf4eb..785e9e3df630514c71cb53d36f1533478dd4ccb7 100755 (executable)
@@ -7,20 +7,12 @@
 #  * changes current working directory to proxyservice-m32
 #  * starts a tribler cmd-line instance with the supplied .torrent file. The .torrent file must be located in the TorrentsAndData folder
 #  * at the end deletes the downloaded data
-#
-# Script arguments:
-#  * .torrent file
-
-if [ ! $# -eq 1 ]; then
-       echo "usage: $0 torrent-file"
-       exit 1
-fi
 
 # Read the global configuration variables
 source ../ConfigFiles/globalconfig.txt
 
-# Read arguments
-TORRENT_FILE=$1
+# Read scenarion configuration file (TORRENT_FILE)
+source ${BASE_PATH}/ClientWorkingFolders/TmpLogs/scenario_config
 
 export PYTHONPATH=$PYTHONPATH:.
 
index 93cb40bf1c0b14292ceb9a228b61cfbbe1399c0f..afff0622fdfe62ace5e709a301b3c5600e3aaf50 100755 (executable)
@@ -19,6 +19,9 @@ fi
 # Read the global configuration variables
 source ../ConfigFiles/globalconfig.txt
 
+# Read scenarion configuration file
+source ${BASE_PATH}/ClientWorkingFolders/TmpLogs/scenario_config
+
 # Read arguments
 PROXY_NO=$1
 
index b221760e94b55cf8a292000ac473877091510c70..fd65c89d33cf3258bef6a6a0cf426afdd2ed6e81 100755 (executable)
@@ -6,20 +6,12 @@
 # The script
 #  * changes current working directory to proxyservice-m32
 #  * starts a command line BT client seeding the supplied .torrent file. The .torrent file must be located in the TorrentsAndData folder
-#
-# Script arguments:
-#  * .torrent file
-
-if [ ! $# -eq 1 ]; then
-       echo "usage: $0 torrent-file"
-       exit 1
-fi
 
 # Read the global configuration variables
 source ../ConfigFiles/globalconfig.txt
 
-# Read arguments
-TORRENT_FILE=$1
+# Read scenarion configuration file (TORRENT_FILE)
+source ${BASE_PATH}/ClientWorkingFolders/TmpLogs/scenario_config
 
 export PYTHONPATH=$PYTHONPATH:.
 
index fab5dadec4b7df3fb70fc5ab80b87ca29613063b..c8058a90b7948592229440d8b8b3f3f931c0c177 100755 (executable)
@@ -10,6 +10,9 @@
 # Read the global configuration variables
 source ../ConfigFiles/globalconfig.txt
 
+# Read scenarion configuration file
+source ${BASE_PATH}/ClientWorkingFolders/TmpLogs/scenario_config
+
 export PYTHONPATH=$PYTHONPATH:.
 
 cd $BITTORNADO_REL_PATH
index e3d8ea24b2a3d5de647ce35d5fbac3f715019d20..ca47186c7db08c59e6d3c65089a844364f362549 100755 (executable)
@@ -10,6 +10,9 @@
 # Read the global configuration variables
 source ../ConfigFiles/globalconfig.txt
 
+# Read scenarion configuration file
+source ${BASE_PATH}/ClientWorkingFolders/TmpLogs/scenario_config
+
 export PYTHONPATH=$PYTHONPATH:.
 
 cd $TRIBLER_REL_PATH
index e3e679b6d7502115fd53ab4cc739e727ba9cd647..570deb3fdc55861dcec1040eae839ea59046eb6e 100755 (executable)
@@ -6,25 +6,19 @@
 # The script
 #  * stops a client
 #  * stop schedule_client.sh script
-#
-# Command line argument specifies client type
 
 # use _DEBUG="off" to turn off debug printing
 _DEBUG="on"
 
-if test $# -ne 1; then
-       echo "usage: $0 client-type" 1>&2
-       exit 1
-fi
-
 # Read the global configuration variables
 source ../ConfigFiles/globalconfig.txt
 
+# Read scenarion configuration file (CLIENT_TYPE)
+source ${BASE_PATH}/ClientWorkingFolders/TmpLogs/scenario_config
+
 # Read client mappings configuration file
 source ../ConfigFiles/client_script_mappings
 
-client_type=$1
-
-stop_client ${client_type}
+stop_client ${CLIENT_TYPE}
 
 pkill -f schedule_client.sh