]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Clear pending monitor events before starting scan
authorJouni Malinen <jouni@codeaurora.org>
Fri, 15 Mar 2019 11:40:04 +0000 (13:40 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 15 Mar 2019 11:51:55 +0000 (13:51 +0200)
The wait_event() call for scan completion could have processed a
previously received event from a prior scan instead of the newly started
one. This could result in flush_scan_cache() assuming there are still
results in the cache even though the scan request to clear the cache had
not even be started yet.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/wpasupplicant.py

index bd42350a67dac98485f2fb77ffc0414acbf087e1..f5cc851d0e2d40178f23f569a7990ca9a933421a 100644 (file)
@@ -1050,6 +1050,8 @@ class WpaSupplicant:
 
     def scan(self, type=None, freq=None, no_wait=False, only_new=False,
              passive=False):
+        if not no_wait:
+            self.dump_monitor()
         if type:
             cmd = "SCAN TYPE=" + type
         else: