diff --git a/tests/hwsim/README b/tests/hwsim/README index 3c88f30ec..f4e4a9060 100644 --- a/tests/hwsim/README +++ b/tests/hwsim/README @@ -137,10 +137,9 @@ timestamp and a postfix to identify the specific log: - *.log0 = wpa_supplicant debug log for the first radio - *.log1 = wpa_supplicant debug log for the second radio - *.log2 = wpa_supplicant debug log for the third radio -- hostapd = hostapd debug log +- *.hostapd = hostapd debug log - hwsim0 = wlantest debug log - hwsim0.pcapng = capture with all frames exchanged during the tests -- tcpdump = tcpdump output - *.log = debug prints from the test scripts - trace.dat = Linux tracing record (if enabled) - hlr_auc_gw - hlr_auc_gw (EAP-SIM/AKA/AKA' authentication) log diff --git a/tests/hwsim/hostapd.py b/tests/hwsim/hostapd.py index 10f2206c0..678013f27 100644 --- a/tests/hwsim/hostapd.py +++ b/tests/hwsim/hostapd.py @@ -33,6 +33,9 @@ class HostapdGlobal: def remove(self, ifname): self.ctrl.request("REMOVE " + ifname) + def relog(self): + self.ctrl.request("RELOG") + class Hostapd: def __init__(self, ifname): diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py index 594c495af..a560f8eb4 100755 --- a/tests/hwsim/run-tests.py +++ b/tests/hwsim/run-tests.py @@ -304,6 +304,23 @@ def main(): logger.info("Failed to rename log files") logger.info(e) + try: + import getpass + srcname = os.path.join(args.logdir, 'hostapd') + dstname = os.path.join(args.logdir, name + '.hostapd') + num = 0 + while os.path.exists(dstname): + dstname = os.path.join(args.logdir, name + '.hostapd-' + str(num)) + num = num + 1 + os.rename(srcname, dstname) + hapd = HostapdGlobal() + hapd.relog() + subprocess.call(['sudo', 'chown', '-f', getpass.getuser(), + srcname]) + except Exception, e: + logger.info("Failed to rename hostapd log file") + logger.info(e) + end = datetime.now() diff = end - start report(conn, args.prefill, args.build, args.commit, run, name, result, diff.total_seconds()) diff --git a/tests/hwsim/start.sh b/tests/hwsim/start.sh index 0c43294db..f875010bf 100755 --- a/tests/hwsim/start.sh +++ b/tests/hwsim/start.sh @@ -64,10 +64,10 @@ for i in 0 1 2; do sudo $(printf -- "$VALGRIND_WPAS" $i) $WPAS -g /tmp/wpas-wlan$i -G$GROUP -Dnl80211 -iwlan$i -c $DIR/p2p$i.conf \ $(printf -- "$CONCURRENT_ARGS" $i) -ddKt$TRACE -f $LOGDIR/log$i & done -sudo $VALGRIND_HAPD $HAPD -ddKt$TRACE -g /var/run/hostapd-global -G $GROUP -ddKt > $LOGDIR/hostapd & +sudo $VALGRIND_HAPD $HAPD -ddKt$TRACE -g /var/run/hostapd-global -G $GROUP -ddKt -f $LOGDIR/hostapd & sleep 1 -sudo chown -f $USER $LOGDIR/hwsim0.pcapng $LOGDIR/log* +sudo chown -f $USER $LOGDIR/hwsim0.pcapng $LOGDIR/log* $LOGDIR/hostapd if [ "x$VALGRIND" = "xy" ]; then sudo chown -f $USER $LOGDIR/*valgrind* fi