ControlScripts: working version of schedule_client scripts with pre-run/post-run...
authorRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Fri, 6 Aug 2010 14:47:59 +0000 (17:47 +0300)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Fri, 6 Aug 2010 14:51:12 +0000 (17:51 +0300)
ControlScripts/schedule_client.sh

index 325e2df..ac23869 100755 (executable)
@@ -8,18 +8,13 @@
 #  * manages when client completes
 
 # use _DEBUG="off" to turn off debug printing
-_DEBUG="off"
-
-DEBUG()
-{
-       test ${_DEBUG} = "on" && $@
-}
+_DEBUG="on"
 
 # Read the global configuration variables
 source ../ConfigFiles/globalconfig
 
 # Read scenarion configuration file
-source ${BASE_PATH}/ClientWorkingFolders/TmpLogs/scenario_config
+source ../ClientWorkingFolders/TmpLogs/scenario_config
 
 # Read client mappings configuration file
 source ../ConfigFiles/client_script_mappings
@@ -35,6 +30,7 @@ parse_periods()
        local tmp_array=($(echo "$PERIODS" | sed 's/[,()]/ /g'))
        start_time=${tmp_array[0]}
        local len=${#tmp_array[@]}
+       DEBUG echo "PERIODS: $PERIODS"
 
        stop_time=${tmp_array[$(($len-1))]}
 
@@ -76,7 +72,8 @@ DEBUG echo "stop_time is ${stop_time}"
 
 to_sleep=${start_time}
 sleep ${to_sleep}
-start_client
+DEBUG echo "CLIENT_TYPE is ${CLIENT_TYPE}"
+start_client ${CLIENT_TYPE}
 background_pid=$!
 DEBUG echo "background_pid is ${background_pid}"
 old_time=${start_time}
@@ -103,4 +100,4 @@ test_infinite ${stop_time}
 
 to_sleep=$((${stop_time} - ${old_time}))
 sleep ${to_sleep}
-stop_client
+stop_client ${CLIENT_TYPE}