hwsim tests: Create results database in VM tests
authorJohannes Berg <johannes.berg@intel.com>
Thu, 31 Oct 2013 14:36:44 +0000 (15:36 +0100)
committerJouni Malinen <j@w1.fi>
Sat, 2 Nov 2013 08:16:28 +0000 (10:16 +0200)
Create a results.db in the output directory when running
the tests in a VM. To make that easier, create the tables
in the python script if they don't exist.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>

tests/hwsim/run-tests.py
tests/hwsim/vm/inside.sh

index dea8a8e..b486013 100755 (executable)
@@ -155,6 +155,8 @@ def main():
     if args.database:
         import sqlite3
         conn = sqlite3.connect(args.database)
+        conn.execute('CREATE TABLE IF NOT EXISTS results (test,result,run,time,duration,build,commitid)')
+        conn.execute('CREATE TABLE IF NOT EXISTS tests (test,description)')
     else:
         conn = None
 
index 7645083..cbef727 100755 (executable)
@@ -63,6 +63,7 @@ else
        # finally run the tests
        export USER=0
        export LOGDIR=/tmp/logs
+       export DBFILE=$LOGDIR/results.db
 
        cd $TESTDIR
        ./run-all.sh $ARGS >/dev/ttyS0 2>&1