Whamcloud - gitweb
Add -D logdir option to Auster so that the whole logdir can be specified 88/288/2
authorChris <chris@whamcloud.com>
Thu, 3 Mar 2011 00:38:21 +0000 (00:38 +0000)
committerChris <chris@whamcloud.com>
Thu, 3 Mar 2011 10:42:18 +0000 (10:42 +0000)
Added a -D logdir so that Auster does not append a time based suffix to the dir
this means that the location of the logs can be known by the parent of Auster

Use Case: The job manager needs to place console logs into the logs directory
and is a parent of Auster, therefor the job manage creates a directory and passes
it to auster using the -D option

Issue: LU-105
Change-Id: Idbd258677b9c6624fdac43aa6223fe6f516bc989
Signed-off-by: Chris Gearing <chris@whamcloud.com>
lustre/tests/auster

index ed55576..21087e0 100755 (executable)
@@ -18,6 +18,7 @@ Usage ${0##*/} [options]  suite [suite optoins] [suite [suite options]]
 Run Lustre regression tests suites.
       -c CONFIG Test environment config file
       -d LOGDIR Top level directory for logs
 Run Lustre regression tests suites.
       -c CONFIG Test environment config file
       -d LOGDIR Top level directory for logs
+      -D FULLLOGDIR Full directory for logs
       -f STR    Config name (cfg/<name>.sh)
       -i N      Repeat tests N times (default 1). A new directory
                 will be created under LOGDIR for each iteration.
       -f STR    Config name (cfg/<name>.sh)
       -i N      Repeat tests N times (default 1). A new directory
                 will be created under LOGDIR for each iteration.
@@ -61,14 +62,15 @@ verbose=false
 repeat_count=1
 upload_logs=false
 reformat=false
 repeat_count=1
 upload_logs=false
 reformat=false
-test_logs_dir=/tmp/test_logs
+test_logs_dir=/tmp/test_logs/$(date +%Y-%m-%d)/$(date +%H%M%S)
 export SLOW=no
 export ${NAME:=local}
 export SLOW=no
 export ${NAME:=local}
-while getopts "c:d:nkf:i:rRslhv" opt
+while getopts "c:d:D:nkf:i:rRslhv" opt
 do
     case "$opt" in
        c) CONFIG=$OPTARG;;
 do
     case "$opt" in
        c) CONFIG=$OPTARG;;
-       d) test_logs_dir=$OPTARG;;
+       d) test_logs_dir=$OPTARG/$(date +%Y-%m-%d)/$(date +%H%M%S);;
+       D) test_logs_dir=$OPTARG;;
        k) export FAIL_ON_ERROR=false;;
         n) dry_run=:;;
         v) verbose=:;;
        k) export FAIL_ON_ERROR=false;;
         n) dry_run=:;;
         v) verbose=:;;
@@ -224,7 +226,7 @@ run_suite_logged() {
 #
 # Add this to test-framework somewhere.
 reset_logging() {
 #
 # Add this to test-framework somewhere.
 reset_logging() {
-    export LOGDIR=${1:-${test_logs_dir}/$(date +%Y-%m-%d)/$(date +%H%M%S)}
+    export LOGDIR=$1
     unset YAML_LOG
     init_logging
 }
     unset YAML_LOG
     init_logging
 }
@@ -236,10 +238,9 @@ split_commas() {
 run_suites() {
     local n=0
     local argv=("$@")
 run_suites() {
     local n=0
     local argv=("$@")
-    local basedir=${test_logs_dir}/$(date +%Y-%m-%d)/$(date +%H%M%S)
     while ((n < repeat_count)); do
        local RC=0
     while ((n < repeat_count)); do
        local RC=0
-       local logdir=$basedir
+       local logdir=${test_logs_dir}
        ((repeat_count > 1)) && logdir="$logdir/$n"
        reset_logging $logdir
        set -- "${argv[@]}"
        ((repeat_count > 1)) && logdir="$logdir/$n"
        reset_logging $logdir
        set -- "${argv[@]}"