tests: Split wpa_supplicant debug logs into per test case files
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
c9aa430896
commit
353e5067ff
3 changed files with 22 additions and 5 deletions
|
@ -134,9 +134,9 @@ conditions:
|
||||||
run-all.sh directs debug logs into the logs subdirectory (or $LOGDIR if
|
run-all.sh directs debug logs into the logs subdirectory (or $LOGDIR if
|
||||||
present in the environment). Log file names include the current UNIX
|
present in the environment). Log file names include the current UNIX
|
||||||
timestamp and a postfix to identify the specific log:
|
timestamp and a postfix to identify the specific log:
|
||||||
- log0 = wpa_supplicant debug log for the first radio
|
- *.log0 = wpa_supplicant debug log for the first radio
|
||||||
- log1 = wpa_supplicant debug log for the second radio
|
- *.log1 = wpa_supplicant debug log for the second radio
|
||||||
- log2 = wpa_supplicant debug log for the third radio
|
- *.log2 = wpa_supplicant debug log for the third radio
|
||||||
- hostapd = hostapd debug log
|
- hostapd = hostapd debug 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
|
||||||
|
|
|
@ -297,6 +297,23 @@ def main():
|
||||||
logger.info(e)
|
logger.info(e)
|
||||||
reset_devs(dev, apdev)
|
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:
|
if log_handler:
|
||||||
log_handler.stream.close()
|
log_handler.stream.close()
|
||||||
logger.removeHandler(log_handler)
|
logger.removeHandler(log_handler)
|
||||||
|
|
|
@ -59,12 +59,12 @@ sudo ifconfig hwsim0 up
|
||||||
sudo $WLANTEST -i hwsim0 -n $LOGDIR/hwsim0.pcapng -c -d > $LOGDIR/hwsim0 &
|
sudo $WLANTEST -i hwsim0 -n $LOGDIR/hwsim0.pcapng -c -d > $LOGDIR/hwsim0 &
|
||||||
for i in 0 1 2; do
|
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 \
|
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
|
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 > $LOGDIR/hostapd &
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
sudo chown -f $USER $LOGDIR/hwsim0.pcapng
|
sudo chown -f $USER $LOGDIR/hwsim0.pcapng $LOGDIR/log*
|
||||||
if [ "x$VALGRIND" = "xy" ]; then
|
if [ "x$VALGRIND" = "xy" ]; then
|
||||||
sudo chown -f $USER $LOGDIR/*valgrind*
|
sudo chown -f $USER $LOGDIR/*valgrind*
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue