tests: DPP3 protocol version during network introduction
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
parent
b21b310148
commit
00b2fb2d04
2 changed files with 52 additions and 1 deletions
|
@ -1881,7 +1881,7 @@ def test_dpp_auto_connect_2_conf_ver1(dev, apdev):
|
||||||
dev[0].set("dpp_config_processing", "0", allow_fail=True)
|
dev[0].set("dpp_config_processing", "0", allow_fail=True)
|
||||||
|
|
||||||
def run_dpp_auto_connect(dev, apdev, processing, ap_version=0, sta_version=0,
|
def run_dpp_auto_connect(dev, apdev, processing, ap_version=0, sta_version=0,
|
||||||
sta1_version=0):
|
sta1_version=0, stop_after_prov=False):
|
||||||
check_dpp_capab(dev[0])
|
check_dpp_capab(dev[0])
|
||||||
check_dpp_capab(dev[1])
|
check_dpp_capab(dev[1])
|
||||||
|
|
||||||
|
@ -1920,6 +1920,8 @@ def run_dpp_auto_connect(dev, apdev, processing, ap_version=0, sta_version=0,
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("DPP network profile not generated")
|
raise Exception("DPP network profile not generated")
|
||||||
id = ev.split(' ')[1]
|
id = ev.split(' ')[1]
|
||||||
|
if stop_after_prov:
|
||||||
|
return id, hapd
|
||||||
|
|
||||||
if processing == 1:
|
if processing == 1:
|
||||||
dev[0].select_network(id, freq=2412)
|
dev[0].select_network(id, freq=2412)
|
||||||
|
|
49
tests/hwsim/test_dpp3.py
Normal file
49
tests/hwsim/test_dpp3.py
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
# Test cases for Device Provisioning Protocol (DPP) version 3
|
||||||
|
# Copyright (c) 2021, Qualcomm Innovation Center, Inc.
|
||||||
|
#
|
||||||
|
# This software may be distributed under the terms of the BSD license.
|
||||||
|
# See README for more details.
|
||||||
|
|
||||||
|
from test_dpp import check_dpp_capab, run_dpp_auto_connect
|
||||||
|
|
||||||
|
def test_dpp_network_intro_version(dev, apdev):
|
||||||
|
"""DPP Network Introduction and protocol version"""
|
||||||
|
check_dpp_capab(dev[0], min_ver=3)
|
||||||
|
|
||||||
|
try:
|
||||||
|
id, hapd = run_dpp_auto_connect(dev, apdev, 1, stop_after_prov=True)
|
||||||
|
dev[0].select_network(id, freq=2412)
|
||||||
|
dev[0].wait_connected()
|
||||||
|
finally:
|
||||||
|
dev[0].set("dpp_config_processing", "0", allow_fail=True)
|
||||||
|
|
||||||
|
def test_dpp_network_intro_version_change(dev, apdev):
|
||||||
|
"""DPP Network Introduction and protocol version change"""
|
||||||
|
check_dpp_capab(dev[0], min_ver=3)
|
||||||
|
|
||||||
|
try:
|
||||||
|
dev[0].set("dpp_version_override", "2")
|
||||||
|
id, hapd = run_dpp_auto_connect(dev, apdev, 1, stop_after_prov=True)
|
||||||
|
dev[0].set("dpp_version_override", "3")
|
||||||
|
dev[0].select_network(id, freq=2412)
|
||||||
|
dev[0].wait_connected()
|
||||||
|
finally:
|
||||||
|
dev[0].set("dpp_config_processing", "0", allow_fail=True)
|
||||||
|
|
||||||
|
def test_dpp_network_intro_version_missing_req(dev, apdev):
|
||||||
|
"""DPP Network Introduction and protocol version missing from request"""
|
||||||
|
check_dpp_capab(dev[0], min_ver=3)
|
||||||
|
|
||||||
|
try:
|
||||||
|
dev[0].set("dpp_version_override", "2")
|
||||||
|
id, hapd = run_dpp_auto_connect(dev, apdev, 1, stop_after_prov=True)
|
||||||
|
dev[0].set("dpp_version_override", "3")
|
||||||
|
dev[0].set("dpp_test", "92")
|
||||||
|
dev[0].select_network(id, freq=2412)
|
||||||
|
ev = dev[0].wait_event(["DPP-INTRO"], timeout=10)
|
||||||
|
if ev is None:
|
||||||
|
raise Exception("DPP network introduction result not seen on STA")
|
||||||
|
if "status=8" not in ev:
|
||||||
|
raise Exception("Unexpected network introduction result on STA: " + ev)
|
||||||
|
finally:
|
||||||
|
dev[0].set("dpp_config_processing", "0", allow_fail=True)
|
Loading…
Reference in a new issue