]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Check current_sessions in ap_hs20_terms_and_conditions_sql
authorJouni Malinen <jouni@codeaurora.org>
Thu, 21 Jun 2018 21:13:15 +0000 (00:13 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 22 Jun 2018 16:37:10 +0000 (19:37 +0300)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_ap_hs20.py

index 97bd91d335f5e713af54c9d8e04756367c57452e..8b2e563d414a527f99bd1bcf880a454ab598a18c 100644 (file)
@@ -5872,6 +5872,8 @@ def test_ap_hs20_terms_and_conditions_sql(dev, apdev, params):
         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)")
+        cur.execute("CREATE TABLE current_sessions(mac_addr TEXT PRIMARY KEY, identity TEXT, start_time TEXT, nas TEXT, hs20_t_c_filtering BOOLEAN, waiting_coa_ack BOOLEAN, coa_ack_received BOOLEAN)")
+
 
     try:
         params = { "ssid": "as", "beacon_int": "2000",
@@ -5916,6 +5918,14 @@ def test_ap_hs20_terms_and_conditions_sql(dev, apdev, params):
             raise Exception("Terms and Conditions Acceptance notification not received")
         dev[0].dump_monitor()
 
+        with con:
+            cur = con.cursor()
+            cur.execute("SELECT * from current_sessions")
+            rows = cur.fetchall()
+            if len(rows) != 1:
+                raise Exeception("Unexpected number of rows in current_sessions (%d; expected %d)" % (len(rows), 1))
+            logger.info("current_sessions: " + str(rows))
+
         dev[0].request("DISCONNECT")
         dev[0].wait_disconnected()
         dev[0].dump_monitor()