]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Use a symlink for default LOGDIR between scripts
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 31 Oct 2013 12:27:57 +0000 (14:27 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 31 Oct 2013 12:27:57 +0000 (14:27 +0200)
This allows run-tests.py to use the same logs/<date> default logdir as
start.sh which is quite convenient for manual test runs.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

tests/hwsim/run-tests.py
tests/hwsim/start.sh

index 9486c7fdc4c3eaaa90a60c764df6e7bfbed359aa..fd58cda230ede14234676856f957f99ce9b270fb 100755 (executable)
@@ -92,7 +92,7 @@ def main():
     print_res = False
 
     parser = argparse.ArgumentParser(description='hwsim test runner')
-    parser.add_argument('--logdir', metavar='<directory>', default='logs',
+    parser.add_argument('--logdir', metavar='<directory>',
                         help='log output directory for all other options, ' +
                              'must be given if other log options are used')
     group = parser.add_mutually_exclusive_group()
@@ -135,11 +135,11 @@ def main():
         print 'Invalid arguments - both test module and tests given'
         sys.exit(2)
 
-    if (args.logfile or args.errorfile or
-        args.resultsfile or args.tracing):
-        if not args.logdir:
-            print 'Need --logdir for the given options'
-            sys.exit(2)
+    if not args.logdir:
+        if os.path.exists('logs/current'):
+            args.logdir = 'logs/current'
+        else:
+            args.logdir = 'logs'
 
     if args.logfile:
         logger.setLevel(logging.DEBUG)
index df076277e07014ce4ec90e7ef525c49ba727bdef..0c43294db35aa2e89d05f142ed5a6c74ffabf94a 100755 (executable)
@@ -8,8 +8,11 @@ WLANTEST=$DIR/../../wlantest/wlantest
 HLR_AUC_GW=$DIR/../../hostapd/hlr_auc_gw
 
 if [ -z "$LOGDIR" ] ; then
-    LOGDIR="$DIR/logs/$(date +%s)"
+    DATE="$(date +%s)"
+    LOGDIR="$DIR/logs/$DATE"
     mkdir -p $LOGDIR
+    rm -rf $DIR/logs/current
+    ln -sf $DATE $DIR/logs/current
 fi
 
 if groups | tr ' ' "\n" | grep -q ^admin$; then