Browse Source

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

Signed-hostap: Jouni Malinen <j@w1.fi>
Jouni Malinen 11 years ago
parent
commit
848bb8dea9
3 changed files with 12 additions and 2 deletions
  1. 5 0
      tests/hwsim/run-tests.py
  2. 2 2
      tests/hwsim/start.sh
  3. 5 0
      tests/hwsim/wlantest.py

+ 5 - 0
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
 

+ 2 - 2
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

+ 5 - 0
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])