From: Jouni Malinen Date: Mon, 22 Mar 2021 22:38:45 +0000 (+0200) Subject: tests: MSCS X-Git-Tag: hostap_2_10~345 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1aa2bc46f7de35c9b566253e9c5806eaf69d874a;p=thirdparty%2Fhostap.git tests: MSCS Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_mscs.py b/tests/hwsim/test_mscs.py new file mode 100644 index 000000000..b200550b3 --- /dev/null +++ b/tests/hwsim/test_mscs.py @@ -0,0 +1,231 @@ +# Test cases for MSCS +# Copyright (c) 2021, Jouni Malinen +# +# This software may be distributed under the terms of the BSD license. +# See README for more details. + +import struct +import time + +import hostapd +from utils import * + +def register_mcsc_req(hapd): + type = 0x00d0 + match = "1304" + if "OK" not in hapd.request("REGISTER_FRAME %04x %s" % (type, match)): + raise Exception("Could not register frame reception for Robust AV Streaming") + +def handle_mscs_req(hapd, wrong_dialog=False, status_code=0): + msg = hapd.mgmt_rx() + if msg['subtype'] != 13: + logger.info("RX:" + str(msg)) + raise Exception("Received unexpected Management frame") + categ, act, dialog_token = struct.unpack('BBB', msg['payload'][0:3]) + if categ != 19 or act != 4: + logger.info("RX:" + str(msg)) + raise Exception("Received unexpected Action frame") + + if wrong_dialog: + dialog_token = (dialog_token + 1) % 256 + msg['da'] = msg['sa'] + msg['sa'] = hapd.own_addr() + msg['payload'] = struct.pack('