checked all sourced filed prior to them being sourced
authorGeorge Milescu <george.milescu@gmail.com>
Fri, 6 Aug 2010 17:27:43 +0000 (19:27 +0200)
committerGeorge Milescu <george.milescu@gmail.com>
Fri, 6 Aug 2010 17:27:43 +0000 (19:27 +0200)
Signed-off-by: George Milescu <george.milescu@gmail.com>
24 files changed:
ConfigFiles/globalconfig
ControlScripts/clients/hrk/start_hrk_leecher.sh
ControlScripts/clients/hrk/start_hrk_seeder.sh
ControlScripts/clients/tribler/start_tribler_doe.sh
ControlScripts/clients/tribler/start_tribler_leecher.sh
ControlScripts/clients/tribler/start_tribler_proxy.sh
ControlScripts/clients/tribler/start_tribler_seeder.sh
ControlScripts/detect_complete_client.sh
ControlScripts/parse_client_log.sh
ControlScripts/post-run.sh
ControlScripts/post-run_ct.sh
ControlScripts/post-run_nop.sh
ControlScripts/pre-run.ch [deleted file]
ControlScripts/pre-run.sh [new file with mode: 0755]
ControlScripts/pre-run_ct.ch [deleted file]
ControlScripts/pre-run_ct.sh [new file with mode: 0755]
ControlScripts/pre-run_nop.sh
ControlScripts/run_scenario.sh
ControlScripts/schedule_client.sh
ControlScripts/start_tracker.sh
ControlScripts/stop_client.sh
Utils/grep_search.sh
Utils/show_version.sh
Utils/start_tribler_gui.sh [moved from ControlScripts/clients/tribler/start_tribler_gui.sh with 83% similarity]

index 4973816..0ebded5 100644 (file)
@@ -7,19 +7,23 @@
 
 TESTING_INFRASTRUCTURE_ABS_PATH="/home/george/P2P-Next/P2P-Testing-Infrastructure"
 
-# P2P_NEXT_REL_PATH is relative to ControlScripts folder
+# P2P_NEXT_REL_PATH is relative to Utils folder - used by sync_* scripts
 P2P_NEXT_REL_PATH="../../"
 # The / at the end is important for rsync to work properly
 P2P_NEXT_ABS_PATH="/home/george/P2P-Next/"
 
-# TEST_INFRASTRUCTURE_REL_PATH is relative to ControlScripts folder
+# TEST_INFRASTRUCTURE_REL_PATH is relative to ControlScripts folder - used by run_scenario.sh
 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 folder
-TRIBLER_REL_PATH="../../TriblerBranches/proxyservice-m32"
-TRIBLER_ABS_PATH="/home/george/P2P-Next/TriblerBranches/proxyservice-m32"
+# TRIBLER_REL_PATH is relative to ControlScripts/clients/<client-name> 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
+TRIBLER_UTIL_REL_PATH="../../TriblerBranches/proxyservice-5.3"
+TRIBLER_UTIL_ABS_PATH="/home/george/P2P-Next/TriblerBranches/proxyservice-5.3"
 
 # HRK_PATH
 HRK_ABS_PATH="/home/p2p/p2p-clients/hrktorrent/hrktorrent"
@@ -30,13 +34,13 @@ HRK_LOG_ABS_PATH="/home/p2p/p2p-clients/hrktorrent-logging/hrktorrent"
 # WORKING_FOLDER_REL_PATH is relative to TRIBLER_ABS_PATH folder
 WORKING_FOLDER_REL_PATH="../../P2P-Testing-Infrastructure/ClientWorkingFolders"
 
-# BITTORNADO_REL_PATH is relative to ControlScripts folder
+# BITTORNADO_REL_PATH is relative to ControlScripts folder - used by start_tracker.sh
 BITTORNADO_REL_PATH="../../BTclients/BitTornado/BitTornado-CVS"
 
-# CONFIG_FILES_REL_PATH is relative to ControlScripts folder
+# CONFIG_FILES_REL_PATH is relative to ControlScripts folder - used by run_scenario.sh
 CONFIG_FILES_REL_PATH="../ConfigFiles"
 
-# CONFIG_FILES_REL_PATH is relative to ControlScripts folder
+# CONFIG_FILES_REL_PATH is relative to ControlScripts folder - used by run_campaign.sh
 RESULTS_FOLDER_REL_PATH="../Results"
 
 # DEBUG function
index a891afb..b3c16b5 100755 (executable)
@@ -17,8 +17,13 @@ else
        source ../../../ConfigFiles/globalconfig
 fi
 
-# Read scenarion configuration file (TORRENT_FILE)
-source ../ClientWorkingFolders/TmpLogs/scenario_config
+# 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."
+else
+       source ../../../ClientWorkingFolders/TmpLogs/node_config
+fi
 
 cd $WORKING_FOLDER_REL_PATH/Regular/
 
index f36e0a2..ab31826 100755 (executable)
@@ -17,8 +17,13 @@ else
        source ../../../ConfigFiles/globalconfig
 fi
 
-# Read scenarion configuration file (TORRENT_FILE)
-source ../ClientWorkingFolders/TmpLogs/scenario_config
+# 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."
+else
+       source ../../../ClientWorkingFolders/TmpLogs/node_config
+fi
 
 cd $WORKING_FOLDER_REL_PATH/TorrentsAndData/
 
index 51ab1d5..ffa569f 100755 (executable)
@@ -16,8 +16,13 @@ else
        source ../../../ConfigFiles/globalconfig
 fi
 
-# Read scenarion configuration file (TORRENT_FILE)
-source ../ClientWorkingFolders/TmpLogs/scenario_config
+# 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."
+else
+       source ../../../ClientWorkingFolders/TmpLogs/node_config
+fi
 
 export PYTHONPATH=$PYTHONPATH:.
 
index c0cee87..5b686e8 100755 (executable)
@@ -16,8 +16,13 @@ else
        source ../../../ConfigFiles/globalconfig
 fi
 
-# Read scenarion configuration file (TORRENT_FILE)
-source ../ClientWorkingFolders/TmpLogs/scenario_config
+# 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."
+else
+       source ../../../ClientWorkingFolders/TmpLogs/node_config
+fi
 
 export PYTHONPATH=$PYTHONPATH:.
 
index 301510e..660ff38 100755 (executable)
@@ -24,8 +24,13 @@ else
        source ../../../ConfigFiles/globalconfig
 fi
 
-# Read scenarion configuration file
-source ../ClientWorkingFolders/TmpLogs/scenario_config
+# 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."
+else
+       source ../../../ClientWorkingFolders/TmpLogs/node_config
+fi
 
 # Read arguments
 PROXY_NO=$1
index b8e5f3f..fd0bd3b 100755 (executable)
@@ -15,8 +15,14 @@ else
        source ../../../ConfigFiles/globalconfig
 fi
 
-# Read scenarion configuration file (TORRENT_FILE)
-source ../ClientWorkingFolders/TmpLogs/scenario_config
+# 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."
+else
+       source ../../../ClientWorkingFolders/TmpLogs/node_config
+fi
+
 
 export PYTHONPATH=$PYTHONPATH:.
 
index 294200b..4d7c960 100755 (executable)
@@ -24,11 +24,21 @@ else
        source ../ConfigFiles/globalconfig
 fi
 
-# Read scenarion configuration file (CLIENT_TYPE)
-source ../ClientWorkingFolders/TmpLogs/scenario_config
+# Read the node-specific configuration file (CLIENT_TYPE)
+# 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."
+else
+       source ../ClientWorkingFolders/TmpLogs/node_config
+fi
 
 # Read client mappings configuration file
-source ../ConfigFiles/client_script_mappings
+# Check if the client mappings configuration file exists
+if [ ! -e ../ConfigFiles/client_script_mappings ]; then
+       echo "Warning: The client mappings config file ../ConfigFiles/client_script_mappings does not exist."
+else
+       source ../ConfigFiles/client_script_mappings
+fi
 
 log_file=$1
 
index 228b2ce..437acf5 100755 (executable)
@@ -25,7 +25,12 @@ else
 fi
 
 # Read client mappings configuration file
-source ../ConfigFiles/client_script_mappings
+# Check if the client mappings configuration file exists
+if [ ! -e ../ConfigFiles/client_script_mappings ]; then
+       echo "Warning: The client mappings config file ../ConfigFiles/client_script_mappings does not exist."
+else
+       source ../ConfigFiles/client_script_mappings
+fi
 
 client_type=$1
 log_folder=$2
index 6b02bb5..1c39f64 100755 (executable)
@@ -4,7 +4,12 @@
 #
 # post-run script for local bandwidth limitation scenarios
 
-# source configuration file
-source ../ClientWorkingFolders/TmpLogs/scenario_config
+# 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."
+else
+       source ../ClientWorkingFolders/TmpLogs/node_config
+fi
 
 ./bw_limit.sh del ${IFACE}
index 5a4ea20..b4926b3 100755 (executable)
@@ -4,7 +4,12 @@
 #
 # post-run script for container bandwidth limitation scenarios
 
-# source configuration file
-source ../ClientWorkingFolders/TmpLogs/scenario_config
+# 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."
+else
+       source ../ClientWorkingFolders/TmpLogs/node_config
+fi
 
 ./bw_limit_ct.sh del ${IFACE}
index 73b99f2..965b775 100755 (executable)
@@ -4,5 +4,11 @@
 #
 # pre-run script for client-based limitation scenarios
 
-# source configuration file
-source ../ClientWorkingFolders/TmpLogs/scenario_config
+# 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."
+else
+       source ../ClientWorkingFolders/TmpLogs/node_config
+fi
+
diff --git a/ControlScripts/pre-run.ch b/ControlScripts/pre-run.ch
deleted file mode 100755 (executable)
index 657a952..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-# 2010, Razvan Deaconescu
-#
-# pre-run script for local bandwidth limitation scenarios
-
-# source configuration file
-source ../ClientWorkingFolders/TmpLogs/scenario_config
diff --git a/ControlScripts/pre-run.sh b/ControlScripts/pre-run.sh
new file mode 100755 (executable)
index 0000000..8ab88e1
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# 2010, Razvan Deaconescu
+#
+# pre-run script for local bandwidth limitation scenarios
+
+# 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."
+else
+       source ../ClientWorkingFolders/TmpLogs/node_config
+fi
+
+./bw_limit_ct.sh set ${IFACE} ${DL_BW} ${DL_BURST} ${UL_BW} ${UL_BURST}
diff --git a/ControlScripts/pre-run_ct.ch b/ControlScripts/pre-run_ct.ch
deleted file mode 100755 (executable)
index a0165b8..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-# 2010, Razvan Deaconescu
-#
-# pre-run script for container bandwidth limitation scenarios
-
-# source configuration file
-source ../ClientWorkingFolders/TmpLogs/scenario_config
-
-./bw_limit_ct.sh set ${IFACE} ${DL_BW} ${DL_BURST} ${UL_BW} ${UL_BURST}
diff --git a/ControlScripts/pre-run_ct.sh b/ControlScripts/pre-run_ct.sh
new file mode 100755 (executable)
index 0000000..f294763
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# 2010, Razvan Deaconescu
+#
+# pre-run script for container bandwidth limitation scenarios
+
+# 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."
+else
+       source ../ClientWorkingFolders/TmpLogs/node_config
+fi
+
+./bw_limit_ct.sh set ${IFACE} ${DL_BW} ${DL_BURST} ${UL_BW} ${UL_BURST}
index 779bd0a..965b775 100755 (executable)
@@ -4,7 +4,11 @@
 #
 # pre-run script for client-based limitation scenarios
 
-# source configuration file
-source ../ClientWorkingFolders/TmpLogs/scenario_config
+# 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."
+else
+       source ../ClientWorkingFolders/TmpLogs/node_config
+fi
 
-./bw_limit_ct.sh set ${IFACE} ${DL_BW} ${DL_BURST} ${UL_BW} ${UL_BURST}
index 6bbb014..f6c2f62 100755 (executable)
@@ -108,7 +108,7 @@ scenario_setup() {
 
                # Create node config file
                if ! ssh -n -p ${PORT} ${USER}@${SERVER} "
-cat > $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/scenario_config << END
+cat > $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/node_config << END
 IFACE=\"${REMOTE_IF}\"
 DL_BW=\"${DL_BW}\"
 DL_BURST=\"${DL_BURST}\"
@@ -196,8 +196,8 @@ scenario_clean() {
                fi
 
                # Remove node config file
-               if ! ssh -n -p ${PORT} ${USER}@${SERVER} "rm $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/scenario_config" &>> ${ERR_LOG}; then
-                       echo "Error: cannot remove scenario_config file"
+               if ! ssh -n -p ${PORT} ${USER}@${SERVER} "rm $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/node_config" &>> ${ERR_LOG}; then
+                       echo "Error: cannot remove node_config file"
                fi
 
                # Retrieve log files
index 59ac82a..e445ccf 100755 (executable)
@@ -18,11 +18,21 @@ else
        source ../ConfigFiles/globalconfig
 fi
 
-# Read scenarion configuration file
-source ../ClientWorkingFolders/TmpLogs/scenario_config
+# 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."
+else
+       source ../ClientWorkingFolders/TmpLogs/node_config
+fi
 
 # Read client mappings configuration file
-source ../ConfigFiles/client_script_mappings
+# Check if the client mappings configuration file exists
+if [ ! -e ../ConfigFiles/client_script_mappings ]; then
+       echo "Warning: The client mappings config file ../ConfigFiles/client_script_mappings does not exist."
+else
+       source ../ConfigFiles/client_script_mappings
+fi
 
 client_pid=0
 
index 2f2173a..c1f2450 100755 (executable)
@@ -15,9 +15,6 @@ else
        source ../ConfigFiles/globalconfig
 fi
 
-# Read scenarion configuration file
-source ../ClientWorkingFolders/TmpLogs/scenario_config
-
 export PYTHONPATH=$PYTHONPATH:.
 
 cd $BITTORNADO_REL_PATH
index eab657e..27ab8ff 100755 (executable)
@@ -18,11 +18,21 @@ else
        source ../ConfigFiles/globalconfig
 fi
 
-# Read scenarion configuration file (CLIENT_TYPE)
-source ../ClientWorkingFolders/TmpLogs/scenario_config
+# Read the node-specific configuration (CLIENT_TYPE)
+# 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."
+else
+       source ../ClientWorkingFolders/TmpLogs/node_config
+fi
 
 # Read client mappings configuration file
-source ../ConfigFiles/client_script_mappings
+# Check if the client mappings configuration file exists
+if [ ! -e ../ConfigFiles/client_script_mappings ]; then
+       echo "Warning: The client mappings config file ../ConfigFiles/client_script_mappings does not exist."
+else
+       source ../ConfigFiles/client_script_mappings
+fi
 
 stop_client ${CLIENT_TYPE}
 
index 333bc71..04755e7 100755 (executable)
@@ -19,7 +19,7 @@ else
        source ../ConfigFiles/globalconfig
 fi
 
-cd $TRIBLER_REL_PATH
+cd $TRIBLER_UTIL_REL_PATH
 
 # -n: print line number
 # -I: ignore binary files
index 2769d05..dd3e962 100755 (executable)
@@ -17,6 +17,6 @@ fi
 
 export PYTHONPATH=$PYTHONPATH:.
 
-cd $TRIBLER_REL_PATH
+cd $TRIBLER_UTIL_REL_PATH
 
 python Tribler/Tools/cmdlinedl.py -v
similarity index 83%
rename from ControlScripts/clients/tribler/start_tribler_gui.sh
rename to Utils/start_tribler_gui.sh
index eb06688..74e879b 100755 (executable)
@@ -15,11 +15,8 @@ else
        source ../../../ConfigFiles/globalconfig
 fi
 
-# Read scenarion configuration file
-source ../ClientWorkingFolders/TmpLogs/scenario_config
-
 export PYTHONPATH=$PYTHONPATH:.
 
-cd $TRIBLER_REL_PATH
+cd $TRIBLER_UTIL_REL_PATH
 
 python2.6 Tribler/Main/tribler.py