]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: pending_tc table check for HS 2.0 Terms and Conditions
authorJouni Malinen <jouni@codeaurora.org>
Mon, 30 Apr 2018 17:19:01 +0000 (20:19 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 30 Apr 2018 17:19:32 +0000 (20:19 +0300)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_ap_hs20.py

index af70d59d0f55656b9137ac66d3099c4918e13f7b..ff0725e70384243600eab9e2bcbe1045c26f3227 100644 (file)
@@ -5839,6 +5839,7 @@ def test_ap_hs20_terms_and_conditions_sql(dev, apdev, params):
         cur.execute("INSERT INTO users(identity,methods,password,phase2) VALUES ('user-mschapv2','TTLS-MSCHAPV2','password',1)")
         cur.execute("INSERT INTO wildcards(identity,methods) VALUES ('','TTLS,TLS')")
         cur.execute("CREATE TABLE authlog(timestamp TEXT, session TEXT, nas_ip TEXT, username TEXT, note TEXT)")
+        cur.execute("CREATE TABLE pending_tc(mac_addr TEXT PRIMARY KEY, identity TEXT)")
 
     try:
         params = { "ssid": "as", "beacon_int": "2000",
@@ -5890,6 +5891,14 @@ def test_ap_hs20_terms_and_conditions_sql(dev, apdev, params):
         # Simulate T&C server operation on user reading the updated version
         with con:
             cur = con.cursor()
+            cur.execute("SELECT identity FROM pending_tc WHERE mac_addr='" +
+                        dev[0].own_addr() + "'")
+            rows = cur.fetchall()
+            if len(rows) != 1:
+                raise Exception("No pending_tc entry found")
+            if rows[0][0] != 'user-mschapv2':
+                raise Exception("Unexpected pending_tc identity value")
+
             cur.execute("UPDATE users SET t_c_timestamp=123456789 WHERE identity='user-mschapv2'")
 
         dev[0].request("RECONNECT")