aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-12-18 10:22:13 (GMT)
committerJouni Malinen <j@w1.fi>2016-12-18 11:01:49 (GMT)
commit0851a180b9c7c4d0e3d63bdcead6714eea28f121 (patch)
tree883adea40efc057f92f997fb73d644d79df51722
parent1a4b4c84661a4cb1f6f41396bddfa1299f4da911 (diff)
downloadhostap-0851a180b9c7c4d0e3d63bdcead6714eea28f121.zip
hostap-0851a180b9c7c4d0e3d63bdcead6714eea28f121.tar.gz
hostap-0851a180b9c7c4d0e3d63bdcead6714eea28f121.tar.bz2
tests: Verify hostapd mgmt_tx() success
Raise an exception if MGMT_TX command to hostapd fails. Previously, such errors were ignored silently. Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--tests/hwsim/hostapd.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/hwsim/hostapd.py b/tests/hwsim/hostapd.py
index 51ad02e..5c583a2 100644
--- a/tests/hwsim/hostapd.py
+++ b/tests/hwsim/hostapd.py
@@ -326,7 +326,8 @@ class Hostapd:
def mgmt_tx(self, msg):
t = (msg['fc'], 0) + mac2tuple(msg['da']) + mac2tuple(msg['sa']) + mac2tuple(msg['bssid']) + (0,)
hdr = struct.pack('<HH6B6B6BH', *t)
- self.request("MGMT_TX " + binascii.hexlify(hdr + msg['payload']))
+ if "OK" not in self.request("MGMT_TX " + binascii.hexlify(hdr + msg['payload'])):
+ raise Exception("MGMT_TX command to hostapd failed")
def get_sta(self, addr, info=None, next=False):
cmd = "STA-NEXT " if next else "STA "