if not ev:
raise Exception("DFS event timed out")
if event and event not in ev:
- raise Exception("Unexpected DFS event")
+ raise Exception("Unexpected DFS event: " + ev + " (expected: %s)" % event)
return ev
def start_dfs_ap(ap, allow_failure=False, ssid="dfs", ht=True, ht40=False,
ev = wait_dfs_event(hapd, "DFS-CAC-START", 5)
if "DFS-CAC-START" not in ev:
- raise Exception("Unexpected DFS event")
+ raise Exception("Unexpected DFS event: " + ev)
state = hapd.get_status_field("state")
if state != "DFS":
else:
logger.info("Trying to start AP on another DFS channel")
if "DFS-CAC-START" not in ev:
- raise Exception("Unexpected DFS event")
+ raise Exception("Unexpected DFS event: " + ev)
if "freq=5260" in ev:
raise Exception("Unexpected DFS CAC freq")
ev = wait_dfs_event(hapd, None, 5)
if "AP-ENABLED" not in ev:
- raise Exception("Unexpected DFS event")
+ raise Exception("Unexpected DFS event: " + ev)
dev[0].connect("dfs", key_mgmt="NONE")
finally:
dev[0].request("DISCONNECT")
ev = wait_dfs_event(hapd, None, 5)
if "AP-ENABLED" not in ev:
- raise Exception("Unexpected DFS event")
+ raise Exception("Unexpected DFS event: " + ev)
dev[0].connect("dfs", key_mgmt="NONE")
if hapd.get_status_field('vht_oper_centr_freq_seg0_idx') != "42":
ev = wait_dfs_event(hapd, None, 5)
if "AP-ENABLED" not in ev:
- raise Exception("Unexpected DFS event")
+ raise Exception("Unexpected DFS event: " + ev)
dev[0].connect("dfs", key_mgmt="NONE")
finally:
dev[0].request("DISCONNECT")
ev = wait_dfs_event(hapd, None, 5)
if "AP-ENABLED" not in ev:
- raise Exception("Unexpected DFS event")
+ raise Exception("Unexpected DFS event: " + ev)
dev[0].connect("dfs", key_mgmt="NONE")
finally:
dev[0].request("DISCONNECT")
ev = wait_dfs_event(hapd, None, 5)
if "AP-ENABLED" not in ev:
- raise Exception("Unexpected DFS event")
+ raise Exception("Unexpected DFS event: " + ev)
dev[0].connect("dfs", key_mgmt="NONE")
finally:
dev[0].request("DISCONNECT")