]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix test skipping for some DFS/VHT cases
authorJouni Malinen <j@w1.fi>
Sat, 17 Jan 2015 11:04:11 +0000 (13:04 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 17 Jan 2015 11:04:11 +0000 (13:04 +0200)
Due to a typo and missing hapd variable initialization, some of the DFS
and VHT test cases were marked as failures even though they were
supposed to be marked as skipped in case the kernel and wireless-regdb
did not have sufficient support for these modes.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_vht.py
tests/hwsim/test_dfs.py

index 72f0ee876cb423232ec3940f30105819c1330e40..cb229a90bf63177ba8051c4bd18351aab32f31a3 100644 (file)
@@ -82,7 +82,7 @@ def test_ap_vht80_params(dev, apdev):
     except Exception, e:
         if isinstance(e, Exception) and str(e) == "AP startup failed":
             if not vht_supported():
-                raise HwsimSwkip("80 MHz channel not supported in regulatory information")
+                raise HwsimSkip("80 MHz channel not supported in regulatory information")
         raise
     finally:
         dev[0].request("DISCONNECT")
@@ -323,9 +323,12 @@ def test_ap_vht80plus80(dev, apdev):
                    "vht_oper_centr_freq_seg1_idx": "155" }
         hapd2 = hostapd.add_ap(apdev[1]['ifname'], params, wait_enabled=False)
 
-        ev = hapd2.wait_event(["AP-ENABLED"], timeout=5)
+        ev = hapd2.wait_event(["AP-ENABLED", "AP-DISABLED"], timeout=5)
         if not ev:
             raise Exception("AP setup timed out(2)")
+        if "AP-DISABLED" in ev:
+            # Assume this failed due to missing regulatory update for now
+            raise HwsimSkip("80+80 MHz channel not supported in regulatory information")
 
         state = hapd2.get_status_field("state")
         if state != "ENABLED":
index cdf3c642d0ca51216b87eed8a5a91edd34fba087..028f6938a86ea5ed1a6b7c2bad575ed3743f4591 100644 (file)
@@ -86,6 +86,7 @@ def dfs_simulate_radar(hapd):
 def test_dfs(dev, apdev):
     """DFS CAC functionality on clear channel"""
     try:
+        hapd = None
         hapd = start_dfs_ap(apdev[0], allow_failure=True)
 
         ev = wait_dfs_event(hapd, "DFS-CAC-COMPLETED", 70)
@@ -138,6 +139,7 @@ def test_dfs(dev, apdev):
 def test_dfs_radar(dev, apdev):
     """DFS CAC functionality with radar detected"""
     try:
+        hapd = None
         hapd2 = None
         hapd = start_dfs_ap(apdev[0], allow_failure=True)
         time.sleep(1)
@@ -225,6 +227,7 @@ def test_dfs_radar_on_non_dfs_channel(dev, apdev):
 def test_dfs_radar_chanlist(dev, apdev):
     """DFS chanlist when radar is detected"""
     try:
+        hapd = None
         hapd = start_dfs_ap(apdev[0], chanlist="40 44", allow_failure=True)
         time.sleep(1)
 
@@ -258,6 +261,7 @@ def test_dfs_radar_chanlist(dev, apdev):
 def test_dfs_radar_chanlist_vht80(dev, apdev):
     """DFS chanlist when radar is detected and VHT80 configured"""
     try:
+        hapd = None
         hapd = start_dfs_ap(apdev[0], chanlist="36", ht40=True, vht80=True,
                             allow_failure=True)
         time.sleep(1)
@@ -295,6 +299,7 @@ def test_dfs_radar_chanlist_vht80(dev, apdev):
 def test_dfs_radar_chanlist_vht20(dev, apdev):
     """DFS chanlist when radar is detected and VHT40 configured"""
     try:
+        hapd = None
         hapd = start_dfs_ap(apdev[0], chanlist="36", vht20=True,
                             allow_failure=True)
         time.sleep(1)
@@ -329,6 +334,7 @@ def test_dfs_radar_chanlist_vht20(dev, apdev):
 def test_dfs_radar_no_ht(dev, apdev):
     """DFS chanlist when radar is detected and no HT configured"""
     try:
+        hapd = None
         hapd = start_dfs_ap(apdev[0], chanlist="36", ht=False,
                             allow_failure=True)
         time.sleep(1)
@@ -363,6 +369,7 @@ def test_dfs_radar_no_ht(dev, apdev):
 def test_dfs_radar_ht40minus(dev, apdev):
     """DFS chanlist when radar is detected and HT40- configured"""
     try:
+        hapd = None
         hapd = start_dfs_ap(apdev[0], chanlist="36", ht40minus=True,
                             allow_failure=True)
         time.sleep(1)