diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py index 9486c7fdc..fd58cda23 100755 --- a/tests/hwsim/run-tests.py +++ b/tests/hwsim/run-tests.py @@ -92,7 +92,7 @@ def main(): print_res = False parser = argparse.ArgumentParser(description='hwsim test runner') - parser.add_argument('--logdir', metavar='', default='logs', + parser.add_argument('--logdir', metavar='', 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) diff --git a/tests/hwsim/start.sh b/tests/hwsim/start.sh index df076277e..0c43294db 100755 --- a/tests/hwsim/start.sh +++ b/tests/hwsim/start.sh @@ -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