From: Razvan Deaconescu Date: Fri, 6 Aug 2010 09:16:53 +0000 (+0300) Subject: ControlScripts: update client_script_mappings to be aware of scenario_config file X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=cf28ac79d064c2cebcd83287f779bae16f23f40f;p=p2p-testing-infrastructure.git ControlScripts: update client_script_mappings to be aware of scenario_config file --- diff --git a/ConfigFiles/client_script_mappings b/ConfigFiles/client_script_mappings index 9d4e11d..a148a86 100644 --- a/ConfigFiles/client_script_mappings +++ b/ConfigFiles/client_script_mappings @@ -5,19 +5,19 @@ # start/stop/detect scripts # +# Read scenarion configuration file +source ${BASE_PATH}/ClientWorkingFolders/TmpLogs/scenario_config + start_client() { - local client_type=$1 - local torrent_file=$2 - DEBUG echo "starting client ..." - case "${client_type}" in + case "${CLIENT_TYPE}" in "hrktorrent_seeder") - ./start_hrk_seeder.sh ${torrent_file} & + ./start_hrk_seeder.sh & return $! ;; "hrktorrent_leecher") - ./start_hrk_leecher.sh ${torrent_file} & + ./start_hrk_leecher.sh & return $! ;; esac @@ -25,10 +25,10 @@ start_client() stop_client() { - local client_type=$1 + local CLIENT_TYPE=$1 DEBUG echo "stopping client ..." - case "${client_type}" in + case "${CLIENT_TYPE}" in "hrktorrent_seeder") ./stop_hrk.sh ;; @@ -40,11 +40,10 @@ stop_client() detect_complete_client() { - local client_type=$1 - local log_file=$2 + local log_file=$1 DEBUG echo "stopping client ..." - case "${client_type}" in + case "${CLIENT_TYPE}" in "hrktorrent_seeder") ./detect_complete_hrk.sh ${log_file} ;; @@ -56,12 +55,11 @@ detect_complete_client() parse_client_log() { - local client_type=$1 - local log_folder=$2 - local log_file=$3 + local log_folder=$1 + local log_file=$2 DEBUG echo "stopping client ..." - case "${client_type}" in + case "${CLIENT_TYPE}" in "hrktorrent_seeder") ./parse_hrk.sh ${log_folder} ${log_file} ;;