From 357edd386f4eae144f650e12b4a251e9f20b18c5 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 12 Dec 2014 20:12:24 +0200 Subject: [PATCH] tests: Additional VENDOR_ELEM coverage Signed-off-by: Jouni Malinen --- tests/hwsim/test_wpas_ctrl.py | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py index 0b6e465fa..6a6bcd968 100644 --- a/tests/hwsim/test_wpas_ctrl.py +++ b/tests/hwsim/test_wpas_ctrl.py @@ -1197,3 +1197,51 @@ def test_wpas_ctrl_data_test(dev, apdev): if "OK" not in dev[0].request("DATA_TEST_FRAME 00112233445566778899aabbccdd"): raise Exception("DATA_TEST_FRAME failed") + +def test_wpas_ctrl_vendor_elem(dev, apdev): + """wpa_supplicant ctrl_iface VENDOR_ELEM""" + if "OK" not in dev[0].request("VENDOR_ELEM_ADD 1 "): + raise Exception("VENDOR_ELEM_ADD failed") + cmds = [ "-1 ", + "13 ", + "1", + "1 123", + "1 12qq34" ] + for cmd in cmds: + if "FAIL" not in dev[0].request("VENDOR_ELEM_ADD " + cmd): + raise Exception("Invalid VENDOR_ELEM_ADD command accepted: " + cmd) + + cmds = [ "-1 ", + "13 " ] + for cmd in cmds: + if "FAIL" not in dev[0].request("VENDOR_ELEM_GET " + cmd): + raise Exception("Invalid VENDOR_ELEM_GET command accepted: " + cmd) + + dev[0].request("VENDOR_ELEM_REMOVE 1 *") + cmds = [ "-1 ", + "13 ", + "1", + "1", + "1 123", + "1 12qq34", + "1 12", + "1 0000" ] + for cmd in cmds: + if "FAIL" not in dev[0].request("VENDOR_ELEM_REMOVE " + cmd): + raise Exception("Invalid VENDOR_ELEM_REMOVE command accepted: " + cmd) + + dev[0].request("VENDOR_ELEM_ADD 1 000100") + if "OK" not in dev[0].request("VENDOR_ELEM_REMOVE 1 "): + raise Exception("VENDOR_ELEM_REMOVE failed") + cmds = [ "-1 ", + "13 ", + "1", + "1 123", + "1 12qq34", + "1 12", + "1 0000" ] + for cmd in cmds: + if "FAIL" not in dev[0].request("VENDOR_ELEM_REMOVE " + cmd): + raise Exception("Invalid VENDOR_ELEM_REMOVE command accepted: " + cmd) + if "OK" not in dev[0].request("VENDOR_ELEM_REMOVE 1 000100"): + raise Exception("VENDOR_ELEM_REMOVE failed")