tests: Split wpa_supplicant debug logs into per test case files

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2013-10-31 13:09:14 +02:00 committed by Jouni Malinen
parent c9aa430896
commit 353e5067ff
3 changed files with 22 additions and 5 deletions

View file

@ -134,9 +134,9 @@ conditions:
run-all.sh directs debug logs into the logs subdirectory (or $LOGDIR if
present in the environment). Log file names include the current UNIX
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
- *.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
- hwsim0 = wlantest debug log
- hwsim0.pcapng = capture with all frames exchanged during the tests

View file

@ -297,6 +297,23 @@ def main():
logger.info(e)
reset_devs(dev, apdev)
for i in range(0, 3):
try:
import getpass
srcname = os.path.join(args.logdir, 'log' + str(i))
dstname = os.path.join(args.logdir, name + '.log' + str(i))
num = 0
while os.path.exists(dstname):
dstname = os.path.join(args.logdir, name + '.log' + str(i) + '-' + str(num))
num = num + 1
os.rename(srcname, dstname)
dev[i].request("RELOG")
subprocess.call(['sudo', 'chown', '-f', getpass.getuser(),
srcname])
except Exception, e:
logger.info("Failed to rename log files")
logger.info(e)
if log_handler:
log_handler.stream.close()
logger.removeHandler(log_handler)

View file

@ -59,12 +59,12 @@ sudo ifconfig hwsim0 up
sudo $WLANTEST -i hwsim0 -n $LOGDIR/hwsim0.pcapng -c -d > $LOGDIR/hwsim0 &
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 > $LOGDIR/log$i &
$(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 &
sleep 1
sudo chown -f $USER $LOGDIR/hwsim0.pcapng
sudo chown -f $USER $LOGDIR/hwsim0.pcapng $LOGDIR/log*
if [ "x$VALGRIND" = "xy" ]; then
sudo chown -f $USER $LOGDIR/*valgrind*
fi