From: George Milescu Date: Fri, 6 Aug 2010 22:13:00 +0000 (+0200) Subject: Updated relative paths for client-specific scripts; updated run_scenario.sh to suppor... X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=988855b96fc6fc2286af22142e22f8d4b835be0b;p=p2p-testing-infrastructure.git Updated relative paths for client-specific scripts; updated run_scenario.sh to support independant clean call Signed-off-by: George Milescu --- diff --git a/ConfigFiles/campaign01.cfg b/ConfigFiles/campaign01.cfg index dc266dc..e46171d 100644 --- a/ConfigFiles/campaign01.cfg +++ b/ConfigFiles/campaign01.cfg @@ -4,11 +4,11 @@ # # ScenarioDescription PlotScript scenario01.cfg scenario01.r -scenario02.cfg scenario02.r -scenario03.cfg scenario03.r -scenario04.cfg scenario04.r -scenario05.cfg scenario05.r -scenario06.cfg scenario06.r -scenario07.cfg scenario07.r -scenario08.cfg scenario08.r -scenario09.cfg scenario09.r +#scenario02.cfg scenario02.r +#scenario03.cfg scenario03.r +#scenario04.cfg scenario04.r +#scenario05.cfg scenario05.r +#scenario06.cfg scenario06.r +#scenario07.cfg scenario07.r +#scenario08.cfg scenario08.r +#scenario09.cfg scenario09.r \ No newline at end of file diff --git a/ConfigFiles/client_script_mappings b/ConfigFiles/client_script_mappings index b736d56..64367cd 100644 --- a/ConfigFiles/client_script_mappings +++ b/ConfigFiles/client_script_mappings @@ -145,25 +145,25 @@ parse_client_log() clients/hrk/parse_hrk.sh ${log_folder} ${log_file} ;; "tribler_seeder") - clients/tribler/parse_tribler.sh ${log_file} + clients/tribler/parse_tribler.sh ${log_folder} ${log_file} ;; "tribler_leecher") - clients/tribler/parse_tribler.sh ${log_file} + clients/tribler/parse_tribler.sh ${log_folder} ${log_file} ;; "tribler_doe") - clients/tribler/parse_tribler.sh ${log_file} + clients/tribler/parse_tribler.sh ${log_folder} ${log_file} ;; "tribler_proxy_01") - clients/tribler/parse_tribler.sh ${log_file} + clients/tribler/parse_tribler.sh ${log_folder} ${log_file} ;; "tribler_proxy_02") - clients/tribler/parse_tribler.sh ${log_file} + clients/tribler/parse_tribler.sh ${log_folder} ${log_file} ;; "tribler_proxy_03") - clients/tribler/parse_tribler.sh ${log_file} + clients/tribler/parse_tribler.sh ${log_folder} ${log_file} ;; "tribler_proxy_04") - clients/tribler/parse_tribler.sh ${log_file} + clients/tribler/parse_tribler.sh ${log_folder} ${log_file} ;; esac } diff --git a/ConfigFiles/globalconfig b/ConfigFiles/globalconfig index 0ebded5..9bf948b 100644 --- a/ConfigFiles/globalconfig +++ b/ConfigFiles/globalconfig @@ -17,8 +17,8 @@ TEST_INFRASTRUCTURE_REL_PATH="../../P2P-Testing-Infrastructure" # No / at the end is important for rsync to work properly TEST_INFRASTRUCTURE_ABS_PATH="/home/george/P2P-Next/P2P-Testing-Infrastructure" -# TRIBLER_REL_PATH is relative to ControlScripts/clients/ folder -TRIBLER_REL_PATH="../../../../TriblerBranches/proxyservice-5.3" +# TRIBLER_REL_PATH is relative to ControlScripts folder +TRIBLER_REL_PATH="../../TriblerBranches/proxyservice-5.3" TRIBLER_ABS_PATH="/home/george/P2P-Next/TriblerBranches/proxyservice-5.3" # TRIBLER_UTIL_REL_PATH is relative to Util folder diff --git a/ControlScripts/clients/hrk/start_hrk_leecher.sh b/ControlScripts/clients/hrk/start_hrk_leecher.sh index b3c16b5..69265b0 100755 --- a/ControlScripts/clients/hrk/start_hrk_leecher.sh +++ b/ControlScripts/clients/hrk/start_hrk_leecher.sh @@ -8,21 +8,24 @@ # * starts a hrktorrent session - use LD_LIBRARY_PATH to point to # libtorrent-rasterbar location # * at the end deletes the downloaded data +# +# If you run this script manually, you must run it from the P2P-Testing-Infrastructure/ControlScripts folder +# # Read the global configuration file # Check if the global configuration file exists -if [ ! -e ../../../ConfigFiles/globalconfig ]; then - echo "Warning: The global config file ../../../ConfigFiles/globalconfig does not exist." +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." else - source ../../../ConfigFiles/globalconfig + source ../ConfigFiles/globalconfig fi # Read the node-specific configuration file (TORRENT_FILE) # Check if the node-specific configuration file exists -if [ ! -e ../../../ClientWorkingFolders/TmpLogs/node_config ]; then - echo "Warning: The global config file ../../../ClientWorkingFolders/TmpLogs/node_config does not exist." +if [ ! -e ../ClientWorkingFolders/TmpLogs/node_config ]; then + echo "Warning: The global config file ../ClientWorkingFolders/TmpLogs/node_config does not exist." else - source ../../../ClientWorkingFolders/TmpLogs/node_config + source ../ClientWorkingFolders/TmpLogs/node_config fi cd $WORKING_FOLDER_REL_PATH/Regular/ diff --git a/ControlScripts/clients/hrk/start_hrk_seeder.sh b/ControlScripts/clients/hrk/start_hrk_seeder.sh index ab31826..7d979cf 100755 --- a/ControlScripts/clients/hrk/start_hrk_seeder.sh +++ b/ControlScripts/clients/hrk/start_hrk_seeder.sh @@ -8,21 +8,24 @@ # * starts a hrktorrent session - use LD_LIBRARY_PATH to point to # libtorrent-rasterbar location # * at the end deletes the downloaded data +# +# If you run this script manually, you must run it from the P2P-Testing-Infrastructure/ControlScripts folder +# # Read the global configuration file # Check if the global configuration file exists -if [ ! -e ../../../ConfigFiles/globalconfig ]; then - echo "Warning: The global config file ../../../ConfigFiles/globalconfig does not exist." +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." else - source ../../../ConfigFiles/globalconfig + source ../ConfigFiles/globalconfig fi # Read the node-specific configuration file (TORRENT_FILE) # Check if the node-specific configuration file exists -if [ ! -e ../../../ClientWorkingFolders/TmpLogs/node_config ]; then - echo "Warning: The global config file ../../../ClientWorkingFolders/TmpLogs/node_config does not exist." +if [ ! -e ../ClientWorkingFolders/TmpLogs/node_config ]; then + echo "Warning: The global config file ../ClientWorkingFolders/TmpLogs/node_config does not exist." else - source ../../../ClientWorkingFolders/TmpLogs/node_config + source ../ClientWorkingFolders/TmpLogs/node_config fi cd $WORKING_FOLDER_REL_PATH/TorrentsAndData/ diff --git a/ControlScripts/clients/tribler/start_tribler_doe.sh b/ControlScripts/clients/tribler/start_tribler_doe.sh index ffa569f..ff14157 100755 --- a/ControlScripts/clients/tribler/start_tribler_doe.sh +++ b/ControlScripts/clients/tribler/start_tribler_doe.sh @@ -7,21 +7,24 @@ # * 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 +# +# If you run this script manually, you must run it from the P2P-Testing-Infrastructure/ControlScripts folder +# # Read the global configuration file # Check if the global configuration file exists -if [ ! -e ../../../ConfigFiles/globalconfig ]; then - echo "Warning: The global config file ../../../ConfigFiles/globalconfig does not exist." +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." else - source ../../../ConfigFiles/globalconfig + source ../ConfigFiles/globalconfig fi # Read the node-specific configuration file (TORRENT_FILE) # Check if the node-specific configuration file exists -if [ ! -e ../../../ClientWorkingFolders/TmpLogs/node_config ]; then - echo "Warning: The global config file ../../../ClientWorkingFolders/TmpLogs/node_config does not exist." +if [ ! -e ../ClientWorkingFolders/TmpLogs/node_config ]; then + echo "Warning: The global config file ../ClientWorkingFolders/TmpLogs/node_config does not exist." else - source ../../../ClientWorkingFolders/TmpLogs/node_config + source ../ClientWorkingFolders/TmpLogs/node_config fi export PYTHONPATH=$PYTHONPATH:. diff --git a/ControlScripts/clients/tribler/start_tribler_leecher.sh b/ControlScripts/clients/tribler/start_tribler_leecher.sh index 5b686e8..1c38bee 100755 --- a/ControlScripts/clients/tribler/start_tribler_leecher.sh +++ b/ControlScripts/clients/tribler/start_tribler_leecher.sh @@ -7,21 +7,25 @@ # * 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 +# +# If you run this script manually, you must run it from the P2P-Testing-Infrastructure/ControlScripts folder +# # Read the global configuration file # Check if the global configuration file exists -if [ ! -e ../../../ConfigFiles/globalconfig ]; then - echo "Warning: The global config file ../../../ConfigFiles/globalconfig does not exist." +echo "pwd=$(pwd)" +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." else - source ../../../ConfigFiles/globalconfig + source ../ConfigFiles/globalconfig fi # Read the node-specific configuration file (TORRENT_FILE) # Check if the node-specific configuration file exists -if [ ! -e ../../../ClientWorkingFolders/TmpLogs/node_config ]; then - echo "Warning: The global config file ../../../ClientWorkingFolders/TmpLogs/node_config does not exist." +if [ ! -e ../ClientWorkingFolders/TmpLogs/node_config ]; then + echo "Warning: The global config file ../ClientWorkingFolders/TmpLogs/node_config does not exist." else - source ../../../ClientWorkingFolders/TmpLogs/node_config + source ../ClientWorkingFolders/TmpLogs/node_config fi export PYTHONPATH=$PYTHONPATH:. diff --git a/ControlScripts/clients/tribler/start_tribler_proxy.sh b/ControlScripts/clients/tribler/start_tribler_proxy.sh index 660ff38..2cd8cbb 100755 --- a/ControlScripts/clients/tribler/start_tribler_proxy.sh +++ b/ControlScripts/clients/tribler/start_tribler_proxy.sh @@ -10,6 +10,9 @@ # # Script arguments: # * proxy number [1-4] +# +# If you run this script manually, you must run it from the P2P-Testing-Infrastructure/ControlScripts folder +# if [ ! $# -eq 1 ]; then echo "usage: $0 proxy-no" @@ -18,18 +21,18 @@ fi # Read the global configuration file # Check if the global configuration file exists -if [ ! -e ../../../ConfigFiles/globalconfig ]; then - echo "Warning: The global config file ../../../ConfigFiles/globalconfig does not exist." +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." else - source ../../../ConfigFiles/globalconfig + source ../ConfigFiles/globalconfig fi # Read the node-specific configuration file # Check if the node-specific configuration file exists -if [ ! -e ../../../ClientWorkingFolders/TmpLogs/node_config ]; then - echo "Warning: The global config file ../../../ClientWorkingFolders/TmpLogs/node_config does not exist." +if [ ! -e ../ClientWorkingFolders/TmpLogs/node_config ]; then + echo "Warning: The global config file ../ClientWorkingFolders/TmpLogs/node_config does not exist." else - source ../../../ClientWorkingFolders/TmpLogs/node_config + source ../ClientWorkingFolders/TmpLogs/node_config fi # Read arguments diff --git a/ControlScripts/clients/tribler/start_tribler_seeder.sh b/ControlScripts/clients/tribler/start_tribler_seeder.sh index fd0bd3b..b85ddf0 100755 --- a/ControlScripts/clients/tribler/start_tribler_seeder.sh +++ b/ControlScripts/clients/tribler/start_tribler_seeder.sh @@ -6,21 +6,25 @@ # 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 +# +# If you run this script manually, you must run it from the P2P-Testing-Infrastructure/ControlScripts folder +# # Read the global configuration file # Check if the global configuration file exists -if [ ! -e ../../../ConfigFiles/globalconfig ]; then - echo "Warning: The global config file ../../../ConfigFiles/globalconfig does not exist." +echo "pwd=$(pwd)" +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." else - source ../../../ConfigFiles/globalconfig + source ../ConfigFiles/globalconfig fi # Read the node-specific configuration file (TORRENT_FILE) # Check if the node-specific configuration file exists -if [ ! -e ../../../ClientWorkingFolders/TmpLogs/node_config ]; then - echo "Warning: The global config file ../../../ClientWorkingFolders/TmpLogs/node_config does not exist." +if [ ! -e ../ClientWorkingFolders/TmpLogs/node_config ]; then + echo "Warning: The global config file ../ClientWorkingFolders/TmpLogs/node_config does not exist." else - source ../../../ClientWorkingFolders/TmpLogs/node_config + source ../ClientWorkingFolders/TmpLogs/node_config fi diff --git a/ControlScripts/pre-run.sh b/ControlScripts/pre-run.sh index 8ab88e1..84436f5 100755 --- a/ControlScripts/pre-run.sh +++ b/ControlScripts/pre-run.sh @@ -12,4 +12,4 @@ else source ../ClientWorkingFolders/TmpLogs/node_config fi -./bw_limit_ct.sh set ${IFACE} ${DL_BW} ${DL_BURST} ${UL_BW} ${UL_BURST} +./bw_limit.sh set ${IFACE} ${DL_BW} ${DL_BURST} ${UL_BW} ${UL_BURST} diff --git a/ControlScripts/run_scenario.sh b/ControlScripts/run_scenario.sh index f6c2f62..c3b17a7 100755 --- a/ControlScripts/run_scenario.sh +++ b/ControlScripts/run_scenario.sh @@ -181,6 +181,25 @@ scenario_clean() { 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 " ** Cleaning-up $SERVER:$PORT" + # Create node config file + if ! ssh -n -p ${PORT} ${USER}@${SERVER} " +cat > $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/node_config << END +IFACE=\"${REMOTE_IF}\" +DL_BW=\"${DL_BW}\" +DL_BURST=\"${DL_BURST}\" +UL_BW=\"${UL_BW}\" +UL_BURST=\"${UL_BURST}\" +PRE_RUN_SCRIPT=\"${PRE_RUN_SCRIPT}\" +POST_RUN_SCRIPT=\"${POST_RUN_SCRIPT}\" +CLIENT_TYPE=\"${CLIENT_TYPE}\" +TORRENT_FILE=\"${TORRENT_FILE}\" +PERIODS=\"${PERIODS}\" +END +" &>> ${ERR_LOG}; then + echo "Error: cannot create scenario config file" + exit 1 + 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" &>> $ERR_LOG; then