# 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}
# 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}
#
# 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
#
# 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
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
# 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
# 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
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
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
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[@]}
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}
to_sleep=$((${stop_time} - ${old_time}))
sleep ${to_sleep}
-stop_client ${client_type}
+stop_client
# * 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:.
# * 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/
# * 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/
# * 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:.
# 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
# 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:.
# 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
# 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
# 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