summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcesar/tools/board/scenarioloop13
1 files changed, 9 insertions, 4 deletions
diff --git a/cesar/tools/board/scenarioloop b/cesar/tools/board/scenarioloop
index 113ee14ebb..a1aff64d3f 100755
--- a/cesar/tools/board/scenarioloop
+++ b/cesar/tools/board/scenarioloop
@@ -7,7 +7,8 @@ function print_usage ()
[[ $# == 2 ]] && echo -en $2
printf "Usage: $0 -1 <UART board 1> -2 <UART board 2> "
printf -- "-d <output directory> -g <grmon_path> "
- printf "[-t trace_sleep] [-s scenario_sleep] [-l loop]\n"
+ printf "[-t <trace_sleep>] [-s <scenario_sleep>] "
+ printf "[-c <counter>] [-l <tty_log_directory>]\n"
exit $1
}
@@ -15,8 +16,9 @@ function print_usage ()
SCENARIO_SLEEP=90
TRACE_SLEEP=90
MAX_LOOP=9999
+TTY_LOG_DIR="/tmp/"
# Get default arguments.
-while getopts 1:2:d:s:t:l:g:h o
+while getopts 1:2:d:s:t:c:g:h:l o
do
case "$o" in
1) UART_1="$OPTARG";;
@@ -24,8 +26,9 @@ do
d) DIR="$OPTARG";;
s) SCENARIO_SLEEP="$OPTARG";;
t) TRACE_SLEEP="$OPTARG";;
- l) MAX_LOOP="$OPTARG";;
+ c) MAX_LOOP="$OPTARG";;
g) GRMON="$OPTARG";;
+ l) TTY_LOG_DIR="$OPTARG"
h)
print_usage 0
;;
@@ -48,6 +51,8 @@ PKILL=$(which pkill)
[[ -x $PKILL ]] || print_usage 1 "pkill not found\n"
FCMCTL=tools/board/fcmctl
[[ -x $FCMCTL ]] || print_usage 1 "fcmctl not found/executable\n"
+[[ -n $TTY_LOG_DIR ]] || print_usage 1 "No ttylog output directory defined\n"
+[[ -d $TTY_LOG_DIR ]] || print_usage 1 "ttylog output directory not found\n"
# Get date of the day.
STARTUP_DATE=$(date +%Y%m%d_%H%M)
@@ -74,7 +79,7 @@ do
filename=$(printf "%s_%04d" $STARTUP_DATE $COUNTER)
for i in $(seq 1 2)
do
- mv /tmp/sta$i.old $DIR/${filename}_${i}.txt
+ mv $TTY_LOG_DIR/sta$i.old $DIR/${filename}_${i}.txt
done
# Write "Crash forced" in log if needed.
if [[ $BOARD_1_FORCED == "true" ]]; then