tests: Use per-test case log/capture file from wlantest

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-11-17 21:25:17 +02:00
parent de8bb171f6
commit 848bb8dea9
3 changed files with 12 additions and 2 deletions

View file

@ -22,6 +22,7 @@ sys.path.append('../../wpaspy')
from wpasupplicant import WpaSupplicant from wpasupplicant import WpaSupplicant
from hostapd import HostapdGlobal from hostapd import HostapdGlobal
from check_kernel import check_kernel from check_kernel import check_kernel
from wlantest import Wlantest
def reset_devs(dev, apdev): def reset_devs(dev, apdev):
ok = True ok = True
@ -332,6 +333,10 @@ def main():
hapd = None hapd = None
rename_log(args.logdir, 'hostapd', name, hapd) rename_log(args.logdir, 'hostapd', name, hapd)
wt = Wlantest()
rename_log(args.logdir, 'hwsim0.pcapng', name, wt)
rename_log(args.logdir, 'hwsim0', name, wt)
end = datetime.now() end = datetime.now()
diff = end - start diff = end - start

View file

@ -63,7 +63,7 @@ if [ "$CONCURRENT" = "y" ]; then
sudo iw wlan2 interface add sta2 type station sudo iw wlan2 interface add sta2 type station
fi fi
sudo ifconfig hwsim0 up 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 -dt -L $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 $LOGDIR/p2p$i.conf \ sudo $(printf -- "$VALGRIND_WPAS" $i) $WPAS -g /tmp/wpas-wlan$i -G$GROUP -Dnl80211 -iwlan$i -c $LOGDIR/p2p$i.conf \
$(printf -- "$CONCURRENT_ARGS" $i) -ddKt$TRACE -f $LOGDIR/log$i & $(printf -- "$CONCURRENT_ARGS" $i) -ddKt$TRACE -f $LOGDIR/log$i &
@ -71,7 +71,7 @@ done
sudo $VALGRIND_HAPD $HAPD -ddKt$TRACE -g /var/run/hostapd-global -G $GROUP -ddKt -f $LOGDIR/hostapd & sudo $VALGRIND_HAPD $HAPD -ddKt$TRACE -g /var/run/hostapd-global -G $GROUP -ddKt -f $LOGDIR/hostapd &
sleep 1 sleep 1
sudo chown -f $USER $LOGDIR/hwsim0.pcapng $LOGDIR/log* $LOGDIR/hostapd sudo chown -f $USER $LOGDIR/hwsim0.pcapng $LOGDIR/hwsim0 $LOGDIR/log* $LOGDIR/hostapd
if [ "x$VALGRIND" = "xy" ]; then if [ "x$VALGRIND" = "xy" ]; then
sudo chown -f $USER $LOGDIR/*valgrind* sudo chown -f $USER $LOGDIR/*valgrind*
fi fi

View file

@ -26,6 +26,11 @@ class Wlantest:
if "FAIL" in res: if "FAIL" in res:
raise Exception("wlantest_cli flush failed") raise Exception("wlantest_cli flush failed")
def relog(self):
res = subprocess.check_output([self.wlantest_cli, "relog"])
if "FAIL" in res:
raise Exception("wlantest_cli relog failed")
def add_passphrase(self, passphrase): def add_passphrase(self, passphrase):
res = subprocess.check_output([self.wlantest_cli, "add_passphrase", res = subprocess.check_output([self.wlantest_cli, "add_passphrase",
passphrase]) passphrase])