tests: Add brctl showmacs output to proxyarp_open test cases

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2015-01-30 13:33:32 +02:00 committed by Jouni Malinen
parent 9934ee1967
commit 87f0ede914

View file

@ -2913,6 +2913,13 @@ def get_permanent_neighbors(ifname):
cmd.stdout.close() cmd.stdout.close()
return [ line for line in res.splitlines() if "PERMANENT" in line and ifname in line ] return [ line for line in res.splitlines() if "PERMANENT" in line and ifname in line ]
def get_bridge_macs(ifname):
cmd = subprocess.Popen(['brctl', 'showmacs', ifname],
stdout=subprocess.PIPE)
res = cmd.stdout.read()
cmd.stdout.close()
return res
def _test_proxyarp_open(dev, apdev, params, ebtables=False): def _test_proxyarp_open(dev, apdev, params, ebtables=False):
prefix = "proxyarp_open" prefix = "proxyarp_open"
if ebtables: if ebtables:
@ -3077,6 +3084,9 @@ def _test_proxyarp_open(dev, apdev, params, ebtables=False):
if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt)): if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt)):
raise Exception("DATA_TEST_FRAME failed") raise Exception("DATA_TEST_FRAME failed")
macs = get_bridge_macs("ap-br0")
logger.info("After connect (showmacs): " + str(macs))
matches = get_permanent_neighbors("ap-br0") matches = get_permanent_neighbors("ap-br0")
logger.info("After connect: " + str(matches)) logger.info("After connect: " + str(matches))
if len(matches) != 4: if len(matches) != 4:
@ -3106,6 +3116,9 @@ def _test_proxyarp_open(dev, apdev, params, ebtables=False):
send_arp(dev[1], sender_ip="192.168.1.127", target_ip="192.168.1.127", send_arp(dev[1], sender_ip="192.168.1.127", target_ip="192.168.1.127",
opcode=2) opcode=2)
macs = get_bridge_macs("ap-br0")
logger.info("After ARP Probe + Announcement (showmacs): " + str(macs))
matches = get_permanent_neighbors("ap-br0") matches = get_permanent_neighbors("ap-br0")
logger.info("After ARP Probe + Announcement: " + str(matches)) logger.info("After ARP Probe + Announcement: " + str(matches))
@ -3124,6 +3137,9 @@ def _test_proxyarp_open(dev, apdev, params, ebtables=False):
send_arp(hapd, hapd_bssid=bssid, sender_ip="192.168.1.130", send_arp(hapd, hapd_bssid=bssid, sender_ip="192.168.1.130",
target_ip="192.168.1.130", opcode=2) target_ip="192.168.1.130", opcode=2)
macs = get_bridge_macs("ap-br0")
logger.info("After ARP Probe + Announcement (showmacs): " + str(macs))
matches = get_permanent_neighbors("ap-br0") matches = get_permanent_neighbors("ap-br0")
logger.info("After ARP Probe + Announcement: " + str(matches)) logger.info("After ARP Probe + Announcement: " + str(matches))
@ -3186,6 +3202,8 @@ def _test_proxyarp_open(dev, apdev, params, ebtables=False):
time.sleep(0.5) time.sleep(0.5)
for i in range(3): for i in range(3):
cmd[i].terminate() cmd[i].terminate()
macs = get_bridge_macs("ap-br0")
logger.info("After disconnect (showmacs): " + str(macs))
matches = get_permanent_neighbors("ap-br0") matches = get_permanent_neighbors("ap-br0")
logger.info("After disconnect: " + str(matches)) logger.info("After disconnect: " + str(matches))
if len(matches) > 0: if len(matches) > 0: