From: Jouni Malinen Date: Fri, 15 Mar 2019 11:40:04 +0000 (+0200) Subject: tests: Clear pending monitor events before starting scan X-Git-Tag: hostap_2_8~210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=043a29ecc4ff958ae9176f8568b81aa8d7b3e79a;p=thirdparty%2Fhostap.git 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 --- diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index bd42350a6..f5cc851d0 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -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: