[PATCH 2/2] test: change vlan_id back and forth

Michael Braun michael-dev at fami-braun.de
Sun Apr 26 08:22:56 EDT 2015


Enhance test ap_vlan_wpa2_radius_id_change to change the VLAN-ID
back as a last step. This ensures that the wpa_group for VLAN-ID 1
did not enter FATAL_FAILURE state during the test.

Signed-off-by: Michael Braun <michael-dev at fami-braun.de>
---
 tests/hwsim/test_ap_vlan.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/tests/hwsim/test_ap_vlan.py b/tests/hwsim/test_ap_vlan.py
index 7b10ea7..f26c634 100644
--- a/tests/hwsim/test_ap_vlan.py
+++ b/tests/hwsim/test_ap_vlan.py
@@ -104,6 +104,8 @@ def test_ap_vlan_wpa2_radius_id_change(dev, apdev):
                    scan_freq="2412")
     hwsim_utils.test_connectivity_iface(dev[0], hapd, "brvlan1")
 
+    logger.info("VLAN-ID -> 2")
+
     authserv.disable()
     authserv.set('eap_user_file', "auth_serv/eap_user_vlan.conf")
     authserv.enable()
@@ -121,6 +123,26 @@ def test_ap_vlan_wpa2_radius_id_change(dev, apdev):
         raise Exception("Unexpected state after reauth: " + state)
     hwsim_utils.test_connectivity_iface(dev[0], hapd, "brvlan2")
 
+    logger.info("VLAN-ID -> 1")
+    time.sleep(1)
+
+    authserv.disable()
+    authserv.set('eap_user_file', "auth_serv/eap_user.conf")
+    authserv.enable()
+
+    dev[0].dump_monitor()
+    dev[0].request("REAUTHENTICATE")
+    ev = dev[0].wait_event(["CTRL-EVENT-EAP-SUCCESS"], timeout=15)
+    if ev is None:
+        raise Exception("EAP reauthentication timed out")
+    ev = dev[0].wait_event(["WPA: Key negotiation completed"], timeout=5)
+    if ev is None:
+        raise Exception("4-way handshake after reauthentication timed out")
+    state = dev[0].get_status_field('wpa_state')
+    if state != "COMPLETED":
+        raise Exception("Unexpected state after reauth: " + state)
+    hwsim_utils.test_connectivity_iface(dev[0], hapd, "brvlan1")
+
 def test_ap_vlan_wpa2_radius_required(dev, apdev):
     """AP VLAN with WPA2-Enterprise and RADIUS attributes required"""
     params = hostapd.wpa2_eap_params(ssid="test-vlan")
-- 
1.9.1



More information about the HostAP mailing list