From 657f50df27bc644bd72bcc4678a10585d2babf45 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 26 Apr 2014 21:39:13 +0300 Subject: [PATCH] tests: SET_CRED/GET_CRED error cases Signed-off-by: Jouni Malinen --- tests/hwsim/test_wpas_ctrl.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py index d3caa15c8..979cc68e4 100644 --- a/tests/hwsim/test_wpas_ctrl.py +++ b/tests/hwsim/test_wpas_ctrl.py @@ -239,6 +239,18 @@ def remove_cred(dev, id): def test_wpas_ctrl_cred(dev): """wpa_supplicant ctrl_iface cred set""" id1 = add_cred(dev[0]) + if "FAIL" not in dev[0].request("SET_CRED " + str(id1 + 1) + " temporary 1"): + raise Exception("SET_CRED succeeded unexpectedly on unknown cred id") + if "FAIL" not in dev[0].request("SET_CRED " + str(id1)): + raise Exception("Invalid SET_CRED succeeded unexpectedly") + if "FAIL" not in dev[0].request("SET_CRED " + str(id1) + " temporary"): + raise Exception("Invalid SET_CRED succeeded unexpectedly") + if "FAIL" not in dev[0].request("GET_CRED " + str(id1 + 1) + " temporary"): + raise Exception("GET_CRED succeeded unexpectedly on unknown cred id") + if "FAIL" not in dev[0].request("GET_CRED " + str(id1)): + raise Exception("Invalid GET_CRED succeeded unexpectedly") + if "FAIL" not in dev[0].request("GET_CRED " + str(id1) + " foo"): + raise Exception("Invalid GET_CRED succeeded unexpectedly") id = add_cred(dev[0]) id2 = add_cred(dev[0]) set_cred(dev[0], id, "temporary", "1")