tests: Report unknown WpaSupplicant::connect() arguments

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2020-06-06 11:25:40 +03:00 committed by Jouni Malinen
parent db23b8f95b
commit b96a4fa996

View file

@ -1110,6 +1110,15 @@ class WpaSupplicant:
if field in kwargs and kwargs[field]:
self.set_network(id, field, kwargs[field])
known_args = {"raw_psk", "password_hex", "peerkey", "okc", "ocsp",
"only_add_network", "wait_connect"}
unknown = set(kwargs.keys())
unknown -= set(quoted)
unknown -= set(not_quoted)
unknown -= known_args
if unknown:
raise Exception("Unknown WpaSupplicant::connect() arguments: " + str(unknown))
if "raw_psk" in kwargs and kwargs['raw_psk']:
self.set_network(id, "psk", kwargs['raw_psk'])
if "password_hex" in kwargs and kwargs['password_hex']: