hwsim tests: Pass commit as an argument
Rather than saving the current commit to a file, pass it as an argument to run-tests.py. Signed-hostap: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
3b464a3c21
commit
aee9446d0c
3 changed files with 5 additions and 12 deletions
|
@ -10,7 +10,7 @@ fi
|
||||||
if [ -z "$DBFILE" ]; then
|
if [ -z "$DBFILE" ]; then
|
||||||
DB=""
|
DB=""
|
||||||
else
|
else
|
||||||
DB="-S $DBFILE"
|
DB="-S $DBFILE --commit $(git rev-parse HEAD)"
|
||||||
if [ -n "$BUILD" ]; then
|
if [ -n "$BUILD" ]; then
|
||||||
DB="$DB -b $BUILD"
|
DB="$DB -b $BUILD"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -63,7 +63,6 @@ def main():
|
||||||
test_names = list(set([t.__name__ for t in tests]))
|
test_names = list(set([t.__name__ for t in tests]))
|
||||||
|
|
||||||
run = None
|
run = None
|
||||||
commit = None
|
|
||||||
print_res = False
|
print_res = False
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='hwsim test runner')
|
parser = argparse.ArgumentParser(description='hwsim test runner')
|
||||||
|
@ -82,6 +81,8 @@ def main():
|
||||||
help='results filename')
|
help='results filename')
|
||||||
parser.add_argument('-S', metavar='<sqlite3 db>', dest='database',
|
parser.add_argument('-S', metavar='<sqlite3 db>', dest='database',
|
||||||
help='database to write results to')
|
help='database to write results to')
|
||||||
|
parser.add_argument('--commit', metavar='<commit id>',
|
||||||
|
help='commit ID, only for database')
|
||||||
parser.add_argument('-b', metavar='<build>', dest='build', help='build ID')
|
parser.add_argument('-b', metavar='<build>', dest='build', help='build ID')
|
||||||
parser.add_argument('-L', action='store_true', dest='update_tests_db',
|
parser.add_argument('-L', action='store_true', dest='update_tests_db',
|
||||||
help='List tests (and update descriptions in DB)')
|
help='List tests (and update descriptions in DB)')
|
||||||
|
@ -119,13 +120,6 @@ def main():
|
||||||
|
|
||||||
if conn:
|
if conn:
|
||||||
run = str(int(time.time()))
|
run = str(int(time.time()))
|
||||||
try:
|
|
||||||
with open("commit") as f:
|
|
||||||
val = f.readlines()
|
|
||||||
if len(val) > 0:
|
|
||||||
commit = val[0].rstrip()
|
|
||||||
except IOError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
if args.update_tests_db:
|
if args.update_tests_db:
|
||||||
for t in tests:
|
for t in tests:
|
||||||
|
@ -203,7 +197,7 @@ def main():
|
||||||
else:
|
else:
|
||||||
passed.append(t.__name__)
|
passed.append(t.__name__)
|
||||||
result = "PASS"
|
result = "PASS"
|
||||||
report(conn, args.build, commit, run, t.__name__, result, diff)
|
report(conn, args.build, args.commit, run, t.__name__, result, diff)
|
||||||
result = result + " " + t.__name__ + " "
|
result = result + " " + t.__name__ + " "
|
||||||
result = result + str(diff.total_seconds()) + " " + str(end)
|
result = result + str(diff.total_seconds()) + " " + str(end)
|
||||||
logger.info(result)
|
logger.info(result)
|
||||||
|
@ -219,7 +213,7 @@ def main():
|
||||||
diff = end - start
|
diff = end - start
|
||||||
logger.info(e)
|
logger.info(e)
|
||||||
failed.append(t.__name__)
|
failed.append(t.__name__)
|
||||||
report(conn, args.build, commit, run, t.__name__, "FAIL", diff)
|
report(conn, args.build, args.commit, run, t.__name__, "FAIL", diff)
|
||||||
result = "FAIL " + t.__name__ + " " + str(diff.total_seconds()) + " " + str(end)
|
result = "FAIL " + t.__name__ + " " + str(diff.total_seconds()) + " " + str(end)
|
||||||
logger.info(result)
|
logger.info(result)
|
||||||
if log_to_file:
|
if log_to_file:
|
||||||
|
|
|
@ -50,7 +50,6 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$DIR/stop-wifi.sh
|
$DIR/stop-wifi.sh
|
||||||
git show -s --format=%H > commit
|
|
||||||
sudo modprobe mac80211_hwsim radios=5
|
sudo modprobe mac80211_hwsim radios=5
|
||||||
if [ "$CONCURRENT" = "y" ]; then
|
if [ "$CONCURRENT" = "y" ]; then
|
||||||
sudo iw wlan0 interface add sta0 type station
|
sudo iw wlan0 interface add sta0 type station
|
||||||
|
|
Loading…
Reference in a new issue