tests: Fix DPP capability checking to avoid failures in non-DPP build

"finally" handler should not trigger a new exception when trying to
clear state for non-DPP builds. In addition, couple of checks for DPP
capability in the build were missing.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2020-01-26 13:28:43 +02:00
parent 4c0af8ad6c
commit 5bf51d38b0
3 changed files with 38 additions and 33 deletions

View file

@ -330,8 +330,10 @@ class WpaSupplicant:
if not self.ping():
logger.info("No PING response from " + self.ifname + " after reset")
def set(self, field, value):
def set(self, field, value, allow_fail=False):
if "OK" not in self.request("SET " + field + " " + value):
if allow_fail:
return
raise Exception("Failed to set wpa_supplicant parameter " + field)
def add_network(self):