tests: Add brctl showmacs output to proxyarp_open test cases
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 30 Jan 2015 11:33:32 +0000 (13:33 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 30 Jan 2015 16:55:22 +0000 (18:55 +0200)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_ap_hs20.py

index 33c9f14..d8f94c8 100644 (file)
@@ -2913,6 +2913,13 @@ def get_permanent_neighbors(ifname):
     cmd.stdout.close()
     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):
     prefix = "proxyarp_open"
     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)):
         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")
     logger.info("After connect: " + str(matches))
     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",
              opcode=2)
 
+    macs = get_bridge_macs("ap-br0")
+    logger.info("After ARP Probe + Announcement (showmacs): " + str(macs))
+
     matches = get_permanent_neighbors("ap-br0")
     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",
              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")
     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)
     for i in range(3):
         cmd[i].terminate()
+    macs = get_bridge_macs("ap-br0")
+    logger.info("After disconnect (showmacs): " + str(macs))
     matches = get_permanent_neighbors("ap-br0")
     logger.info("After disconnect: " + str(matches))
     if len(matches) > 0: