From 848bb8dea9ec5765a559df753a8cd0cfe290cabf Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 17 Nov 2013 21:25:17 +0200 Subject: [PATCH] tests: Use per-test case log/capture file from wlantest Signed-hostap: Jouni Malinen --- tests/hwsim/run-tests.py | 5 +++++ tests/hwsim/start.sh | 4 ++-- tests/hwsim/wlantest.py | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py index 697fd6f5a..d4097f6a6 100755 --- a/tests/hwsim/run-tests.py +++ b/tests/hwsim/run-tests.py @@ -22,6 +22,7 @@ sys.path.append('../../wpaspy') from wpasupplicant import WpaSupplicant from hostapd import HostapdGlobal from check_kernel import check_kernel +from wlantest import Wlantest def reset_devs(dev, apdev): ok = True @@ -332,6 +333,10 @@ def main(): hapd = None 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() diff = end - start diff --git a/tests/hwsim/start.sh b/tests/hwsim/start.sh index 86900d1b0..f87d2f389 100755 --- a/tests/hwsim/start.sh +++ b/tests/hwsim/start.sh @@ -63,7 +63,7 @@ if [ "$CONCURRENT" = "y" ]; then sudo iw wlan2 interface add sta2 type station fi 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 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 & @@ -71,7 +71,7 @@ done 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* $LOGDIR/hostapd +sudo chown -f $USER $LOGDIR/hwsim0.pcapng $LOGDIR/hwsim0 $LOGDIR/log* $LOGDIR/hostapd if [ "x$VALGRIND" = "xy" ]; then sudo chown -f $USER $LOGDIR/*valgrind* fi diff --git a/tests/hwsim/wlantest.py b/tests/hwsim/wlantest.py index d9dc5cefe..c6dba12a7 100644 --- a/tests/hwsim/wlantest.py +++ b/tests/hwsim/wlantest.py @@ -26,6 +26,11 @@ class Wlantest: if "FAIL" in res: 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): res = subprocess.check_output([self.wlantest_cli, "add_passphrase", passphrase])