tests: More SET_CRED coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-11-01 01:03:45 +02:00
parent 71a3b85fff
commit 1720ff58ec

View file

@ -411,6 +411,7 @@ def test_wpas_ctrl_cred(dev):
set_cred(dev[0], id, "temporary", "1")
set_cred(dev[0], id, "priority", "1")
set_cred(dev[0], id, "pcsc", "1")
set_cred(dev[0], id, "sim_num", "0")
set_cred_quoted(dev[0], id, "private_key_passwd", "test")
set_cred_quoted(dev[0], id, "domain_suffix_match", "test")
set_cred_quoted(dev[0], id, "phase1", "test")
@ -433,6 +434,16 @@ def test_wpas_ctrl_cred(dev):
if "FAIL" not in dev[0].request("SET_CRED " + str(id) + " foo 4142"):
raise Exception("Unexpected success on unknown field")
tests = ["sp_priority 256",
'roaming_partner "example.org"',
'roaming_partner "' + 200*'a' + '.example.org,"',
'roaming_partner "example.org,1"',
'roaming_partner "example.org,1,2"',
'roaming_partner "example.org,1,2,ABC"' ]
for t in tests:
if "FAIL" not in dev[0].request("SET_CRED " + str(id) + " " + t):
raise Exception("Unexpected success on invalid SET_CRED value: " + t)
id3 = add_cred(dev[0])
id4 = add_cred(dev[0])
if len(dev[0].request("LIST_CREDS").splitlines()) != 6: