tests: WDS 4addr behavior on reassociation and with open and WEP
This extends the ap_wds_sta test case to cover post-reassociation case (both with and without Authentication frame exchange) and add similar test cases to cover open and WEP cases in addition to this existing WPA2-PSK test case. These cover functionality testing for the previous fix in reassociation-without-new-authentication case. In addition, these find a new mac80211 issue for the WEP + 4addr combination. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
cb2b666670
commit
f0b6d1edfb
2 changed files with 78 additions and 2 deletions
|
@ -156,9 +156,9 @@ def test_connectivity(dev1, dev2, dscp=None, tos=None, max_tries=1,
|
||||||
raise Exception(last_err)
|
raise Exception(last_err)
|
||||||
|
|
||||||
def test_connectivity_iface(dev1, dev2, ifname, dscp=None, tos=None,
|
def test_connectivity_iface(dev1, dev2, ifname, dscp=None, tos=None,
|
||||||
max_tries=1):
|
max_tries=1, timeout=5):
|
||||||
test_connectivity(dev1, dev2, dscp, tos, ifname2=ifname,
|
test_connectivity(dev1, dev2, dscp, tos, ifname2=ifname,
|
||||||
max_tries=max_tries)
|
max_tries=max_tries, timeout=timeout)
|
||||||
|
|
||||||
def test_connectivity_p2p(dev1, dev2, dscp=None, tos=None):
|
def test_connectivity_p2p(dev1, dev2, dscp=None, tos=None):
|
||||||
test_connectivity(dev1, dev2, dscp, tos, dev1group=True, dev2group=True)
|
test_connectivity(dev1, dev2, dscp, tos, dev1group=True, dev2group=True)
|
||||||
|
|
|
@ -174,7 +174,83 @@ def test_ap_wds_sta(dev, apdev):
|
||||||
dev[0].connect(ssid, psk=passphrase, scan_freq="2412")
|
dev[0].connect(ssid, psk=passphrase, scan_freq="2412")
|
||||||
hwsim_utils.test_connectivity_iface(dev[0], hapd, "wds-br0",
|
hwsim_utils.test_connectivity_iface(dev[0], hapd, "wds-br0",
|
||||||
max_tries=15)
|
max_tries=15)
|
||||||
|
dev[0].request("REATTACH")
|
||||||
|
dev[0].wait_connected()
|
||||||
|
hwsim_utils.test_connectivity_iface(dev[0], hapd, "wds-br0",
|
||||||
|
max_tries=15)
|
||||||
|
dev[0].request("SET reassoc_same_bss_optim 1")
|
||||||
|
dev[0].request("REATTACH")
|
||||||
|
dev[0].wait_connected()
|
||||||
|
hwsim_utils.test_connectivity_iface(dev[0], hapd, "wds-br0",
|
||||||
|
max_tries=5, timeout=1)
|
||||||
finally:
|
finally:
|
||||||
|
dev[0].request("SET reassoc_same_bss_optim 0")
|
||||||
|
dev[0].cmd_execute(['iw', dev[0].ifname, 'set', '4addr', 'off'])
|
||||||
|
dev[0].cmd_execute(['ip', 'link', 'set', 'dev', 'wds-br0', 'down'])
|
||||||
|
dev[0].cmd_execute(['brctl', 'delbr', 'wds-br0'])
|
||||||
|
|
||||||
|
def test_ap_wds_sta_open(dev, apdev):
|
||||||
|
"""Open AP with STA using 4addr mode"""
|
||||||
|
ssid = "test-wds-open"
|
||||||
|
params = {}
|
||||||
|
params['ssid'] = ssid
|
||||||
|
params['wds_sta'] = "1"
|
||||||
|
params['wds_bridge'] = "wds-br0"
|
||||||
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
|
|
||||||
|
try:
|
||||||
|
dev[0].cmd_execute(['brctl', 'addbr', 'wds-br0'])
|
||||||
|
dev[0].cmd_execute(['brctl', 'setfd', 'wds-br0', '0'])
|
||||||
|
dev[0].cmd_execute(['ip', 'link', 'set', 'dev', 'wds-br0', 'up'])
|
||||||
|
dev[0].cmd_execute(['iw', dev[0].ifname, 'set', '4addr', 'on'])
|
||||||
|
dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412")
|
||||||
|
hwsim_utils.test_connectivity_iface(dev[0], hapd, "wds-br0",
|
||||||
|
max_tries=15)
|
||||||
|
dev[0].request("REATTACH")
|
||||||
|
dev[0].wait_connected()
|
||||||
|
hwsim_utils.test_connectivity_iface(dev[0], hapd, "wds-br0",
|
||||||
|
max_tries=15)
|
||||||
|
dev[0].request("SET reassoc_same_bss_optim 1")
|
||||||
|
dev[0].request("REATTACH")
|
||||||
|
dev[0].wait_connected()
|
||||||
|
hwsim_utils.test_connectivity_iface(dev[0], hapd, "wds-br0",
|
||||||
|
max_tries=5, timeout=1)
|
||||||
|
finally:
|
||||||
|
dev[0].request("SET reassoc_same_bss_optim 0")
|
||||||
|
dev[0].cmd_execute(['iw', dev[0].ifname, 'set', '4addr', 'off'])
|
||||||
|
dev[0].cmd_execute(['ip', 'link', 'set', 'dev', 'wds-br0', 'down'])
|
||||||
|
dev[0].cmd_execute(['brctl', 'delbr', 'wds-br0'])
|
||||||
|
|
||||||
|
def test_ap_wds_sta_wep(dev, apdev):
|
||||||
|
"""WEP AP with STA using 4addr mode"""
|
||||||
|
ssid = "test-wds-wep"
|
||||||
|
params = {}
|
||||||
|
params['ssid'] = ssid
|
||||||
|
params['wep_key0'] = '"hello"'
|
||||||
|
params['wds_sta'] = "1"
|
||||||
|
params['wds_bridge'] = "wds-br0"
|
||||||
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
|
|
||||||
|
try:
|
||||||
|
dev[0].cmd_execute(['brctl', 'addbr', 'wds-br0'])
|
||||||
|
dev[0].cmd_execute(['brctl', 'setfd', 'wds-br0', '0'])
|
||||||
|
dev[0].cmd_execute(['ip', 'link', 'set', 'dev', 'wds-br0', 'up'])
|
||||||
|
dev[0].cmd_execute(['iw', dev[0].ifname, 'set', '4addr', 'on'])
|
||||||
|
dev[0].connect(ssid, key_mgmt="NONE", wep_key0='"hello"',
|
||||||
|
scan_freq="2412")
|
||||||
|
hwsim_utils.test_connectivity_iface(dev[0], hapd, "wds-br0",
|
||||||
|
max_tries=15)
|
||||||
|
dev[0].request("REATTACH")
|
||||||
|
dev[0].wait_connected()
|
||||||
|
hwsim_utils.test_connectivity_iface(dev[0], hapd, "wds-br0",
|
||||||
|
max_tries=15)
|
||||||
|
dev[0].request("SET reassoc_same_bss_optim 1")
|
||||||
|
dev[0].request("REATTACH")
|
||||||
|
dev[0].wait_connected()
|
||||||
|
hwsim_utils.test_connectivity_iface(dev[0], hapd, "wds-br0",
|
||||||
|
max_tries=5, timeout=1)
|
||||||
|
finally:
|
||||||
|
dev[0].request("SET reassoc_same_bss_optim 0")
|
||||||
dev[0].cmd_execute(['iw', dev[0].ifname, 'set', '4addr', 'off'])
|
dev[0].cmd_execute(['iw', dev[0].ifname, 'set', '4addr', 'off'])
|
||||||
dev[0].cmd_execute(['ip', 'link', 'set', 'dev', 'wds-br0', 'down'])
|
dev[0].cmd_execute(['ip', 'link', 'set', 'dev', 'wds-br0', 'down'])
|
||||||
dev[0].cmd_execute(['brctl', 'delbr', 'wds-br0'])
|
dev[0].cmd_execute(['brctl', 'delbr', 'wds-br0'])
|
||||||
|
|
Loading…
Reference in a new issue