From: Andrei Otcheretianski Date: Mon, 13 Jul 2015 06:49:10 +0000 (+0300) Subject: tests: Add asp_provision method to wpa_supplicant X-Git-Tag: hostap_2_5~293 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1a1b015622e8acc6f5319e27c651a89496a63d6b;p=thirdparty%2Fhostap.git tests: Add asp_provision method to wpa_supplicant Add asp_provision method which issues either P2PS PD Request or, if the status is provided, continues the deferred flow by sending follow on PD Request. Signed-off-by: Andrei Otcheretianski Reviewed-by: Max Stepanov Reviewed-by: Ilan Peer --- diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index e99e91ea2..a515b8336 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -1104,3 +1104,16 @@ class WpaSupplicant: [name,value] = l.split('=', 1) vals[name] = value return vals + + def asp_provision(self, peer, adv_id, adv_mac, session_id, session_mac, + method="1000", info="", status=None): + if status is None: + cmd = "P2P_ASP_PROVISION" + params = "info='%s' method=%s" % (info, method) + else: + cmd = "P2P_ASP_PROVISION_RESP" + params = "status=%d" % status + + if "OK" not in self.global_request("%s %s adv_id=%s adv_mac=%s session=%d session_mac=%s %s" % + (cmd, peer, adv_id, adv_mac, session_id, session_mac, params)): + raise Exception("%s request failed" % cmd)