]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Split hostapd debug log into per test case files
authorJouni Malinen <j@w1.fi>
Sat, 2 Nov 2013 09:53:38 +0000 (11:53 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 2 Nov 2013 09:53:38 +0000 (11:53 +0200)
Signed-hostap: Jouni Malinen <j@w1.fi>

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

index 3c88f30ecccbaa944e3889805f45095e2ef5502f..f4e4a90609f39959329b957078b816ace3dab8ec 100644 (file)
@@ -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
index 10f2206c0dcac0123629cab3463b39d8674d2830..678013f277968e34d302499c9b9be50d8eba51d3 100644 (file)
@@ -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):
index 594c495afd0d2aab7b6aa304a83b8b328895cf7d..a560f8eb4e66fc44fb0bf2e33f1b06083ae6f8e4 100755 (executable)
@@ -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())
index 0c43294db35aa2e89d05f142ed5a6c74ffabf94a..f875010bf4d3fc906b5e34c7ca33fc3e7c9d6d95 100755 (executable)
@@ -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