tests: Clear pending monitor events before starting scan

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>
This commit is contained in:
Jouni Malinen 2019-03-15 13:40:04 +02:00 committed by Jouni Malinen
parent 4131ba5c55
commit 043a29ecc4

View 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: