tests: Verify P2P group formation with 80+80 MHz channel

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2015-10-29 20:47:36 +02:00 committed by Jouni Malinen
parent c27f4c9006
commit 35b61a496a
3 changed files with 160 additions and 5 deletions

View file

@ -246,13 +246,27 @@ def go_neg_pin(i_dev, r_dev, i_intent=None, r_intent=None, i_method='enter', r_m
i_dev.dump_monitor() i_dev.dump_monitor()
return [i_res, r_res] return [i_res, r_res]
def go_neg_pin_authorized(i_dev, r_dev, i_intent=None, r_intent=None, expect_failure=False, i_go_neg_status=None, i_method='enter', r_method='display', test_data=True, i_freq=None, r_freq=None): def go_neg_pin_authorized(i_dev, r_dev, i_intent=None, r_intent=None,
expect_failure=False, i_go_neg_status=None,
i_method='enter', r_method='display', test_data=True,
i_freq=None, r_freq=None,
i_freq2=None, r_freq2=None,
i_max_oper_chwidth=None, r_max_oper_chwidth=None,
i_ht40=False, i_vht=False, r_ht40=False, r_vht=False):
i_dev.p2p_listen() i_dev.p2p_listen()
pin = r_dev.wps_read_pin() pin = r_dev.wps_read_pin()
logger.info("Start GO negotiation " + i_dev.ifname + " -> " + r_dev.ifname) logger.info("Start GO negotiation " + i_dev.ifname + " -> " + r_dev.ifname)
r_dev.p2p_go_neg_auth(i_dev.p2p_dev_addr(), pin, r_method, go_intent=r_intent, freq=r_freq) r_dev.p2p_go_neg_auth(i_dev.p2p_dev_addr(), pin, r_method,
go_intent=r_intent, freq=r_freq, freq2=r_freq2,
max_oper_chwidth=r_max_oper_chwidth, ht40=r_ht40,
vht=r_vht)
r_dev.p2p_listen() r_dev.p2p_listen()
i_res = i_dev.p2p_go_neg_init(r_dev.p2p_dev_addr(), pin, i_method, timeout=20, go_intent=i_intent, expect_failure=expect_failure, freq=i_freq) i_res = i_dev.p2p_go_neg_init(r_dev.p2p_dev_addr(), pin, i_method,
timeout=20, go_intent=i_intent,
expect_failure=expect_failure, freq=i_freq,
freq2=i_freq2,
max_oper_chwidth=i_max_oper_chwidth,
ht40=i_ht40, vht=i_vht)
r_res = r_dev.p2p_go_neg_auth_result(expect_failure=expect_failure) r_res = r_dev.p2p_go_neg_auth_result(expect_failure=expect_failure)
logger.debug("i_res: " + str(i_res)) logger.debug("i_res: " + str(i_res))
logger.debug("r_res: " + str(r_res)) logger.debug("r_res: " + str(r_res))

View file

@ -1001,3 +1001,122 @@ def test_p2p_delay_go_csa(dev, apdev, params):
finally: finally:
wpas.global_request("SET p2p_go_freq_change_policy 2") wpas.global_request("SET p2p_go_freq_change_policy 2")
def test_p2p_channel_vht80p80(dev):
"""P2P group formation and VHT 80+80 MHz channel"""
try:
set_country("US", dev[0])
[i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_intent=15,
i_freq=5180,
i_freq2=5775,
i_max_oper_chwidth=160,
i_ht40=True, i_vht=True,
r_dev=dev[1], r_intent=0,
test_data=False)
check_grpform_results(i_res, r_res)
freq = int(i_res['freq'])
if freq < 5000:
raise Exception("Unexpected channel %d MHz - did not follow 5 GHz preference" % freq)
sig = dev[1].group_request("SIGNAL_POLL").splitlines()
if "FREQUENCY=5180" not in sig:
raise Exception("Unexpected SIGNAL_POLL value(1): " + str(sig))
if "WIDTH=80+80 MHz" not in sig:
raise Exception("Unexpected SIGNAL_POLL value(2): " + str(sig))
if "CENTER_FRQ1=5210" not in sig:
raise Exception("Unexpected SIGNAL_POLL value(3): " + str(sig))
if "CENTER_FRQ2=5775" not in sig:
raise Exception("Unexpected SIGNAL_POLL value(4): " + str(sig))
remove_group(dev[0], dev[1])
finally:
set_country("00")
dev[1].flush_scan_cache()
def test_p2p_channel_vht80p80_autogo(dev):
"""P2P autonomous GO and VHT 80+80 MHz channel"""
addr0 = dev[0].p2p_dev_addr()
try:
set_country("US", dev[0])
if "OK" not in dev[0].global_request("P2P_GROUP_ADD vht freq=5180 freq2=5775"):
raise Exception("Could not start GO")
ev = dev[0].wait_global_event(["P2P-GROUP-STARTED"], timeout=5)
if ev is None:
raise Exception("GO start up timed out")
dev[0].group_form_result(ev)
pin = dev[1].wps_read_pin()
dev[0].p2p_go_authorize_client(pin)
dev[1].global_request("P2P_CONNECT " + addr0 + " " + pin + " join freq=5180")
ev = dev[1].wait_global_event(["P2P-GROUP-STARTED"], timeout=10)
if ev is None:
raise Exception("Peer did not get connected")
sig = dev[1].group_request("SIGNAL_POLL").splitlines()
if "FREQUENCY=5180" not in sig:
raise Exception("Unexpected SIGNAL_POLL value(1): " + str(sig))
if "WIDTH=80+80 MHz" not in sig:
raise Exception("Unexpected SIGNAL_POLL value(2): " + str(sig))
if "CENTER_FRQ1=5210" not in sig:
raise Exception("Unexpected SIGNAL_POLL value(3): " + str(sig))
if "CENTER_FRQ2=5775" not in sig:
raise Exception("Unexpected SIGNAL_POLL value(4): " + str(sig))
remove_group(dev[0], dev[1])
finally:
set_country("00")
dev[1].flush_scan_cache()
def test_p2p_channel_vht80_autogo(dev):
"""P2P autonomous GO and VHT 80 MHz channel"""
addr0 = dev[0].p2p_dev_addr()
try:
set_country("US", dev[0])
if "OK" not in dev[0].global_request("P2P_GROUP_ADD vht freq=5180 max_oper_chwidth=80"):
raise Exception("Could not start GO")
ev = dev[0].wait_global_event(["P2P-GROUP-STARTED"], timeout=5)
if ev is None:
raise Exception("GO start up timed out")
dev[0].group_form_result(ev)
pin = dev[1].wps_read_pin()
dev[0].p2p_go_authorize_client(pin)
dev[1].global_request("P2P_CONNECT " + addr0 + " " + pin + " join freq=5180")
ev = dev[1].wait_global_event(["P2P-GROUP-STARTED"], timeout=10)
if ev is None:
raise Exception("Peer did not get connected")
sig = dev[1].group_request("SIGNAL_POLL").splitlines()
if "FREQUENCY=5180" not in sig:
raise Exception("Unexpected SIGNAL_POLL value(1): " + str(sig))
if "WIDTH=80 MHz" not in sig:
raise Exception("Unexpected SIGNAL_POLL value(2): " + str(sig))
remove_group(dev[0], dev[1])
finally:
set_country("00")
dev[1].flush_scan_cache()
def test_p2p_channel_vht80p80_persistent(dev):
"""P2P persistent group re-invocation and VHT 80+80 MHz channel"""
addr0 = dev[0].p2p_dev_addr()
form(dev[0], dev[1])
try:
set_country("US", dev[0])
invite(dev[0], dev[1], extra="vht freq=5745 freq2=5210")
[go_res, cli_res] = check_result(dev[0], dev[1])
sig = dev[1].group_request("SIGNAL_POLL").splitlines()
if "FREQUENCY=5745" not in sig:
raise Exception("Unexpected SIGNAL_POLL value(1): " + str(sig))
if "WIDTH=80+80 MHz" not in sig:
raise Exception("Unexpected SIGNAL_POLL value(2): " + str(sig))
if "CENTER_FRQ1=5775" not in sig:
raise Exception("Unexpected SIGNAL_POLL value(3): " + str(sig))
if "CENTER_FRQ2=5210" not in sig:
raise Exception("Unexpected SIGNAL_POLL value(4): " + str(sig))
remove_group(dev[0], dev[1])
finally:
set_country("00")
dev[1].flush_scan_cache()

View file

@ -546,7 +546,9 @@ class WpaSupplicant:
return res return res
def p2p_go_neg_auth(self, peer, pin, method, go_intent=None, persistent=False, freq=None): def p2p_go_neg_auth(self, peer, pin, method, go_intent=None,
persistent=False, freq=None, freq2=None,
max_oper_chwidth=None, ht40=False, vht=False):
if not self.discover_peer(peer): if not self.discover_peer(peer):
raise Exception("Peer " + peer + " not found") raise Exception("Peer " + peer + " not found")
self.dump_monitor() self.dump_monitor()
@ -558,6 +560,14 @@ class WpaSupplicant:
cmd = cmd + ' go_intent=' + str(go_intent) cmd = cmd + ' go_intent=' + str(go_intent)
if freq: if freq:
cmd = cmd + ' freq=' + str(freq) cmd = cmd + ' freq=' + str(freq)
if freq2:
cmd = cmd + ' freq2=' + str(freq2)
if max_oper_chwidth:
cmd = cmd + ' max_oper_chwidth=' + str(max_oper_chwidth)
if ht40:
cmd = cmd + ' ht40'
if vht:
cmd = cmd + ' vht'
if persistent: if persistent:
cmd = cmd + " persistent" cmd = cmd + " persistent"
if "OK" in self.global_request(cmd): if "OK" in self.global_request(cmd):
@ -582,7 +592,11 @@ class WpaSupplicant:
self.dump_monitor() self.dump_monitor()
return self.group_form_result(ev, expect_failure, go_neg_res) return self.group_form_result(ev, expect_failure, go_neg_res)
def p2p_go_neg_init(self, peer, pin, method, timeout=0, go_intent=None, expect_failure=False, persistent=False, persistent_id=None, freq=None, provdisc=False, wait_group=True): def p2p_go_neg_init(self, peer, pin, method, timeout=0, go_intent=None,
expect_failure=False, persistent=False,
persistent_id=None, freq=None, provdisc=False,
wait_group=True, freq2=None, max_oper_chwidth=None,
ht40=False, vht=False):
if not self.discover_peer(peer): if not self.discover_peer(peer):
raise Exception("Peer " + peer + " not found") raise Exception("Peer " + peer + " not found")
self.dump_monitor() self.dump_monitor()
@ -594,6 +608,14 @@ class WpaSupplicant:
cmd = cmd + ' go_intent=' + str(go_intent) cmd = cmd + ' go_intent=' + str(go_intent)
if freq: if freq:
cmd = cmd + ' freq=' + str(freq) cmd = cmd + ' freq=' + str(freq)
if freq2:
cmd = cmd + ' freq2=' + str(freq2)
if max_oper_chwidth:
cmd = cmd + ' max_oper_chwidth=' + str(max_oper_chwidth)
if ht40:
cmd = cmd + ' ht40'
if vht:
cmd = cmd + ' vht'
if persistent: if persistent:
cmd = cmd + " persistent" cmd = cmd + " persistent"
elif persistent_id: elif persistent_id: