aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2020-05-06 08:59:11 (GMT)
committerJouni Malinen <j@w1.fi>2020-05-06 08:59:11 (GMT)
commit046f2d1fb9aad0bf2ee68296e2de105a3f7c37fe (patch)
tree70c9cbb2781e2b6372d9da27fbd88bbe19644aa5
parent481fdfc462dda6929a895b7df7b935efa35ccd83 (diff)
downloadhostap-046f2d1fb9aad0bf2ee68296e2de105a3f7c37fe.zip
hostap-046f2d1fb9aad0bf2ee68296e2de105a3f7c37fe.tar.gz
hostap-046f2d1fb9aad0bf2ee68296e2de105a3f7c37fe.tar.bz2
tests: DPP URI version information
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
-rw-r--r--tests/hwsim/test_dpp.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/hwsim/test_dpp.py b/tests/hwsim/test_dpp.py
index b9709e5..fe30728 100644
--- a/tests/hwsim/test_dpp.py
+++ b/tests/hwsim/test_dpp.py
@@ -110,6 +110,33 @@ def test_dpp_qr_code_parsing(dev, apdev):
dev[0].dpp_qr_code(uri)
+def test_dpp_uri_version(dev, apdev):
+ """DPP URI version information"""
+ check_dpp_capab(dev[0], min_ver=2)
+
+ id0 = dev[0].dpp_bootstrap_gen()
+ uri = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
+ logger.info("Generated URI: " + uri)
+
+ id1 = dev[0].dpp_qr_code(uri)
+ uri = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id1)
+ info = dev[0].request("DPP_BOOTSTRAP_INFO %d" % id1)
+ logger.info("Parsed URI info:\n" + info)
+ if "version=2" not in info.splitlines():
+ raise Exception("Unexpected version information (v2)")
+
+ dev[0].set("dpp_version_override", "1")
+ id0 = dev[0].dpp_bootstrap_gen()
+ uri = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
+ logger.info("Generated URI: " + uri)
+
+ id1 = dev[0].dpp_qr_code(uri)
+ uri = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id1)
+ info = dev[0].request("DPP_BOOTSTRAP_INFO %d" % id1)
+ logger.info("Parsed URI info:\n" + info)
+ if "version=0" not in info.splitlines():
+ raise Exception("Unexpected version information (without indication)")
+
def test_dpp_qr_code_parsing_fail(dev, apdev):
"""DPP QR Code parsing local failure"""
check_dpp_capab(dev[0])