tests: Add helper functions for Hotspot 2.0 test cases

These make it easier to add new test cases for Interworking network
selection.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2013-10-29 14:20:29 +02:00 committed by Jouni Malinen
parent f4defd91cd
commit bbe867672e
2 changed files with 87 additions and 92 deletions

View file

@ -118,6 +118,10 @@ class WpaSupplicant:
raise Exception("SET_NETWORK failed")
return None
def hs20_enable(self):
self.request("SET interworking 1")
self.request("SET hs20 1")
def add_cred(self):
id = self.request("ADD_CRED")
if "FAIL" in id:
@ -142,6 +146,23 @@ class WpaSupplicant:
raise Exception("SET_CRED failed")
return None
def add_cred_values(self, realm=None, username=None, password=None,
domain=None, imsi=None, eap=None):
id = self.add_cred()
if realm:
self.set_cred_quoted(id, "realm", realm)
if username:
self.set_cred_quoted(id, "username", username)
if password:
self.set_cred_quoted(id, "password", password)
if domain:
self.set_cred_quoted(id, "domain", domain)
if imsi:
self.set_cred_quoted(id, "imsi", imsi)
if eap:
self.set_cred(id, "eap", eap)
return id;
def select_network(self, id):
id = self.request("SELECT_NETWORK " + str(id))
if "FAIL" in id: