tests: Split run-tests.py logger info into per test case files
The run-tests.py -l argument does not take an argument value anymore. Instead, debug output is directed to a separate file <test>.log for each test case. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
e955226208
commit
c9aa430896
24 changed files with 51 additions and 28 deletions
|
@ -141,7 +141,7 @@ timestamp and a postfix to identify the specific log:
|
||||||
- hwsim0 = wlantest debug log
|
- hwsim0 = wlantest debug log
|
||||||
- hwsim0.pcapng = capture with all frames exchanged during the tests
|
- hwsim0.pcapng = capture with all frames exchanged during the tests
|
||||||
- tcpdump = tcpdump output
|
- tcpdump = tcpdump output
|
||||||
- run = debug prints from the test scripts
|
- *.log = debug prints from the test scripts
|
||||||
- trace.dat = Linux tracing record (if enabled)
|
- trace.dat = Linux tracing record (if enabled)
|
||||||
- hlr_auc_gw - hlr_auc_gw (EAP-SIM/AKA/AKA' authentication) log
|
- hlr_auc_gw - hlr_auc_gw (EAP-SIM/AKA/AKA' authentication) log
|
||||||
- auth_serv - hostapd as RADIUS authentication server log
|
- auth_serv - hostapd as RADIUS authentication server log
|
||||||
|
|
|
@ -11,7 +11,7 @@ import time
|
||||||
import logging
|
import logging
|
||||||
import wpaspy
|
import wpaspy
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
hapd_ctrl = '/var/run/hostapd'
|
hapd_ctrl = '/var/run/hostapd'
|
||||||
hapd_global = '/var/run/hostapd-global'
|
hapd_global = '/var/run/hostapd-global'
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
|
|
||||||
def test_connectivity(ifname1, ifname2):
|
def test_connectivity(ifname1, ifname2):
|
||||||
if os.path.isfile("../../mac80211_hwsim/tools/hwsim_test"):
|
if os.path.isfile("../../mac80211_hwsim/tools/hwsim_test"):
|
||||||
|
|
|
@ -63,7 +63,7 @@ if ! ./start.sh $CONCURRENT $VALGRIND $TRACE; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./run-tests.py -D --logdir "$LOGDIR" $TRACE_ARGS -l run $DB -e failed -r results.txt $CONCURRENT_TESTS $@ || errors=1
|
./run-tests.py -D --logdir "$LOGDIR" $TRACE_ARGS -l $DB -e failed -r results.txt $CONCURRENT_TESTS $@ || errors=1
|
||||||
|
|
||||||
./stop-wifi.sh
|
./stop-wifi.sh
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import argparse
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
|
|
||||||
sys.path.append('../../wpaspy')
|
sys.path.append('../../wpaspy')
|
||||||
|
|
||||||
|
@ -101,8 +101,8 @@ def main():
|
||||||
help="verbose debug output")
|
help="verbose debug output")
|
||||||
group.add_argument('-q', const=logging.WARNING, action='store_const',
|
group.add_argument('-q', const=logging.WARNING, action='store_const',
|
||||||
dest='loglevel', help="be quiet")
|
dest='loglevel', help="be quiet")
|
||||||
group.add_argument('-l', metavar='<filename>', dest='logfile',
|
group.add_argument('-l', action='store_true', dest='logfile',
|
||||||
help='debug log filename (in log directory)')
|
help='store debug log to a file (in log directory)')
|
||||||
|
|
||||||
parser.add_argument('-e', metavar="<filename>", dest='errorfile',
|
parser.add_argument('-e', metavar="<filename>", dest='errorfile',
|
||||||
nargs='?', const="failed",
|
nargs='?', const="failed",
|
||||||
|
@ -142,11 +142,17 @@ def main():
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
if args.logfile:
|
if args.logfile:
|
||||||
logging.basicConfig(filename=os.path.join(args.logdir, args.logfile),
|
logger.setLevel(logging.DEBUG)
|
||||||
level=logging.DEBUG)
|
file_name = os.path.join(args.logdir, 'run-tests.log')
|
||||||
|
log_handler = logging.FileHandler(file_name)
|
||||||
|
fmt = "%(asctime)s %(levelname)s %(message)s"
|
||||||
|
log_formatter = logging.Formatter(fmt)
|
||||||
|
log_handler.setFormatter(log_formatter)
|
||||||
|
logger.addHandler(log_handler)
|
||||||
log_to_file = True
|
log_to_file = True
|
||||||
else:
|
else:
|
||||||
logging.basicConfig(level=args.loglevel)
|
logging.basicConfig(level=args.loglevel)
|
||||||
|
log_handler = None
|
||||||
log_to_file = False
|
log_to_file = False
|
||||||
if args.loglevel == logging.WARNING:
|
if args.loglevel == logging.WARNING:
|
||||||
print_res = True
|
print_res = True
|
||||||
|
@ -216,6 +222,15 @@ def main():
|
||||||
if args.testmodules:
|
if args.testmodules:
|
||||||
if not t.__module__.replace('test_', '', 1) in args.testmodules:
|
if not t.__module__.replace('test_', '', 1) in args.testmodules:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if log_handler:
|
||||||
|
log_handler.stream.close()
|
||||||
|
logger.removeHandler(log_handler)
|
||||||
|
file_name = os.path.join(args.logdir, name + '.log')
|
||||||
|
log_handler = logging.FileHandler(file_name)
|
||||||
|
log_handler.setFormatter(log_formatter)
|
||||||
|
logger.addHandler(log_handler)
|
||||||
|
|
||||||
with DataCollector(args.logdir, name, args.tracing, args.dmesg):
|
with DataCollector(args.logdir, name, args.tracing, args.dmesg):
|
||||||
logger.info("START " + name)
|
logger.info("START " + name)
|
||||||
if log_to_file:
|
if log_to_file:
|
||||||
|
@ -282,6 +297,14 @@ def main():
|
||||||
logger.info(e)
|
logger.info(e)
|
||||||
reset_devs(dev, apdev)
|
reset_devs(dev, apdev)
|
||||||
|
|
||||||
|
if log_handler:
|
||||||
|
log_handler.stream.close()
|
||||||
|
logger.removeHandler(log_handler)
|
||||||
|
file_name = os.path.join(args.logdir, 'run-tests.log')
|
||||||
|
log_handler = logging.FileHandler(file_name)
|
||||||
|
log_handler.setFormatter(log_formatter)
|
||||||
|
logger.addHandler(log_handler)
|
||||||
|
|
||||||
if conn:
|
if conn:
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
import time
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
|
|
||||||
import hwsim_utils
|
import hwsim_utils
|
||||||
import hostapd
|
import hostapd
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
import time
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
import hwsim_utils
|
import hwsim_utils
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
import time
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
|
|
||||||
import hwsim_utils
|
import hwsim_utils
|
||||||
import hostapd
|
import hostapd
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
import time
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
import os.path
|
import os.path
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
import time
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
|
|
||||||
import hwsim_utils
|
import hwsim_utils
|
||||||
import hostapd
|
import hostapd
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
import time
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
|
|
||||||
import hwsim_utils
|
import hwsim_utils
|
||||||
import hostapd
|
import hostapd
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
|
|
||||||
import hwsim_utils
|
import hwsim_utils
|
||||||
from hostapd import HostapdGlobal
|
from hostapd import HostapdGlobal
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
import time
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
|
|
||||||
import hwsim_utils
|
import hwsim_utils
|
||||||
import hostapd
|
import hostapd
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import hostapd
|
import hostapd
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# See README for more details.
|
# See README for more details.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
import time
|
import time
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
import time
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
|
|
||||||
import hwsim_utils
|
import hwsim_utils
|
||||||
import hostapd
|
import hostapd
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
import time
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
|
|
||||||
import hwsim_utils
|
import hwsim_utils
|
||||||
from wlantest import Wlantest
|
from wlantest import Wlantest
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# See README for more details.
|
# See README for more details.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
|
|
||||||
import hwsim_utils
|
import hwsim_utils
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# See README for more details.
|
# See README for more details.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
import time
|
import time
|
||||||
import threading
|
import threading
|
||||||
import Queue
|
import Queue
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# See README for more details.
|
# See README for more details.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
|
|
||||||
import hwsim_utils
|
import hwsim_utils
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# See README for more details.
|
# See README for more details.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
|
|
||||||
import hwsim_utils
|
import hwsim_utils
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# See README for more details.
|
# See README for more details.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
|
|
||||||
import hwsim_utils
|
import hwsim_utils
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import subprocess
|
||||||
import logging
|
import logging
|
||||||
import wpaspy
|
import wpaspy
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
|
|
||||||
class Wlantest:
|
class Wlantest:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
|
@ -13,7 +13,7 @@ import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import wpaspy
|
import wpaspy
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger()
|
||||||
wpas_ctrl = '/var/run/wpa_supplicant'
|
wpas_ctrl = '/var/run/wpa_supplicant'
|
||||||
|
|
||||||
class WpaSupplicant:
|
class WpaSupplicant:
|
||||||
|
|
Loading…
Reference in a new issue