From: Jouni Malinen Date: Sat, 26 Apr 2014 18:35:07 +0000 (+0300) Subject: tests: Additional REMOVE_CRED coverage X-Git-Tag: hostap_2_2~202 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b85a9430f09cd9967a99368323853b1fd925b10;p=thirdparty%2Fhostap.git tests: Additional REMOVE_CRED coverage Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py index 09b0f8ec5..d3caa15c8 100644 --- a/tests/hwsim/test_wpas_ctrl.py +++ b/tests/hwsim/test_wpas_ctrl.py @@ -340,6 +340,39 @@ def test_wpas_ctrl_cred(dev): if len(dev[0].request("LIST_CREDS").splitlines()) != 1: raise Exception("Unexpected LIST_CREDS result(4)") + id = add_cred(dev[0]) + set_cred_quoted(dev[0], id, "domain", "foo.example.com") + id = add_cred(dev[0]) + set_cred_quoted(dev[0], id, "domain", "bar.example.com") + id = add_cred(dev[0]) + set_cred_quoted(dev[0], id, "domain", "foo.example.com") + if "OK" not in dev[0].request("REMOVE_CRED sp_fqdn=foo.example.com"): + raise Exception("REMOVE_CRED failed") + creds = dev[0].request("LIST_CREDS") + if "foo.example.com" in creds: + raise Exception("REMOVE_CRED sp_fqdn did not remove cred") + if "bar.example.com" not in creds: + raise Exception("REMOVE_CRED sp_fqdn removed incorrect cred") + dev[0].request("REMOVE_CRED all") + + id = add_cred(dev[0]) + set_cred_quoted(dev[0], id, "domain", "foo.example.com") + set_cred_quoted(dev[0], id, "provisioning_sp", "sp.foo.example.com") + id = add_cred(dev[0]) + set_cred_quoted(dev[0], id, "domain", "bar.example.com") + set_cred_quoted(dev[0], id, "provisioning_sp", "sp.bar.example.com") + id = add_cred(dev[0]) + set_cred_quoted(dev[0], id, "domain", "foo.example.com") + set_cred_quoted(dev[0], id, "provisioning_sp", "sp.foo.example.com") + if "OK" not in dev[0].request("REMOVE_CRED provisioning_sp=sp.foo.example.com"): + raise Exception("REMOVE_CRED failed") + creds = dev[0].request("LIST_CREDS") + if "foo.example.com" in creds: + raise Exception("REMOVE_CRED provisioning_sp did not remove cred") + if "bar.example.com" not in creds: + raise Exception("REMOVE_CRED provisioning_sp removed incorrect cred") + dev[0].request("REMOVE_CRED all") + # Test large number of creds and LIST_CREDS truncation dev[0].dump_monitor() for i in range(0, 100):