Skip to content

Commit

Permalink
tests: ctrl_iface LIST_CREDS
Browse files Browse the repository at this point in the history
Signed-off-by: Jouni Malinen <j@w1.fi>
  • Loading branch information
jmalinen committed Apr 13, 2014
1 parent 939f5b2 commit c7a4bf8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/hwsim/test_wpas_ctrl.py
Expand Up @@ -251,6 +251,8 @@ def test_wpas_ctrl_cred(dev):

id3 = add_cred(dev[0])
id4 = add_cred(dev[0])
if len(dev[0].request("LIST_CREDS").splitlines()) != 6:
raise Exception("Unexpected LIST_CREDS result(1)")

remove_cred(dev[0], id1)
remove_cred(dev[0], id3)
Expand All @@ -259,6 +261,8 @@ def test_wpas_ctrl_cred(dev):
remove_cred(dev[0], id)
if "FAIL" not in dev[0].request("REMOVE_CRED 1"):
raise Exception("Unexpected success on invalid remove cred")
if len(dev[0].request("LIST_CREDS").splitlines()) != 1:
raise Exception("Unexpected LIST_CREDS result(2)")

id = add_cred(dev[0])
values = [ ("temporary", "1", False),
Expand Down Expand Up @@ -310,7 +314,14 @@ def test_wpas_ctrl_cred(dev):
expect = v[1]
if val != expect:
raise Exception("Unexpected GET_CRED value for {}: {} != {}".format(v[0], val, expect))
creds = dev[0].request("LIST_CREDS").splitlines()
if len(creds) != 2:
raise Exception("Unexpected LIST_CREDS result(3)")
if creds[1] != "0\texample.com\tuser@example.com\texample.com\t310026-000000000":
raise Exception("Unexpected LIST_CREDS value")
remove_cred(dev[0], id)
if len(dev[0].request("LIST_CREDS").splitlines()) != 1:
raise Exception("Unexpected LIST_CREDS result(4)")

def test_wpas_ctrl_pno(dev):
"""wpa_supplicant ctrl_iface pno"""
Expand Down

0 comments on commit c7a4bf8

Please sign in to comment.