Jenkins HIL run more tests

This commit is contained in:
Daniel Agar 2019-06-15 11:09:21 -04:00
parent 4910bed45b
commit d30e30a2a6
2 changed files with 46 additions and 11 deletions

View File

@ -411,7 +411,7 @@ pipeline {
unstash 'px4_fmu-v5_stackcheck' unstash 'px4_fmu-v5_stackcheck'
sh './platforms/nuttx/Debug/jlink_gdb_upload.sh build/px4_fmu-v5_stackcheck/px4_fmu-v5_stackcheck.elf' sh './platforms/nuttx/Debug/jlink_gdb_upload.sh build/px4_fmu-v5_stackcheck/px4_fmu-v5_stackcheck.elf'
sh './Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-FTDI_*` --baudrate 57600' sh './Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-FTDI_*` --baudrate 57600'
sh './Tools/HIL/run_tests.py --device `find /dev/serial -name *usb-FTDI_*`' // sh './Tools/HIL/run_tests.py --device `find /dev/serial -name *usb-FTDI_*`' // TODO: currently unusably slow
} catch (Exception err) { } catch (Exception err) {
// always report passed for now // always report passed for now
currentBuild.result = 'SUCCESS' currentBuild.result = 'SUCCESS'

View File

@ -6,36 +6,42 @@ from subprocess import call, Popen
from argparse import ArgumentParser from argparse import ArgumentParser
import re import re
def do_tests(port, baudrate): def do_test(port, baudrate, test_name):
databits = serial.EIGHTBITS databits = serial.EIGHTBITS
stopbits = serial.STOPBITS_ONE stopbits = serial.STOPBITS_ONE
parity = serial.PARITY_NONE parity = serial.PARITY_NONE
ser = serial.Serial(port, baudrate, databits, parity, stopbits, 100) ser = serial.Serial(port, baudrate, databits, parity, stopbits, 100)
ser.write('\n\n') ser.write('\n\n')
finished = 0 finished = 0
while finished == 0: while finished == 0:
serial_line = ser.readline() serial_line = ser.readline()
print(serial_line.replace('\n','')) print(serial_line.replace('\n',''))
if "nsh>" in serial_line: if "nsh>" in serial_line:
finished = 1 finished = 1
time.sleep(0.05) time.sleep(0.05)
ser.write('tests perf\n') ser.write('tests ' + test_name + '\n')
finished = 0 finished = 0
success = False
while finished == 0: while finished == 0:
serial_line = ser.readline() serial_line = ser.readline()
print(serial_line.replace('\n','')) print(serial_line.replace('\n',''))
if "perf PASSED" in serial_line: if test_name + " PASSED" in serial_line:
finished = 1 finished = 1
ser.close() success = True
elif test_name + " FAILED" in serial_line:
finished = 1
success = False
time.sleep(0.05) time.sleep(0.05)
ser.close() ser.close()
return success
def main(): def main():
parser = ArgumentParser(description=__doc__) parser = ArgumentParser(description=__doc__)
@ -43,7 +49,36 @@ def main():
parser.add_argument("--baudrate", "-b", dest="baudrate", type=int, help="Mavlink port baud rate (default=57600)", default=57600) parser.add_argument("--baudrate", "-b", dest="baudrate", type=int, help="Mavlink port baud rate (default=57600)", default=57600)
args = parser.parse_args() args = parser.parse_args()
do_tests(args.device, args.baudrate)
do_test(args.device, args.baudrate, "autodeclination")
do_test(args.device, args.baudrate, "bezier")
do_test(args.device, args.baudrate, "bson")
do_test(args.device, args.baudrate, "commander")
do_test(args.device, args.baudrate, "controllib")
do_test(args.device, args.baudrate, "conv")
do_test(args.device, args.baudrate, "ctlmath")
#do_test(args.device, args.baudrate, "dataman")
do_test(args.device, args.baudrate, "float")
do_test(args.device, args.baudrate, "hrt")
do_test(args.device, args.baudrate, "int")
do_test(args.device, args.baudrate, "IntrusiveQueue")
do_test(args.device, args.baudrate, "List")
do_test(args.device, args.baudrate, "mathlib")
do_test(args.device, args.baudrate, "matrix")
do_test(args.device, args.baudrate, "microbench_hrt")
do_test(args.device, args.baudrate, "microbench_math")
do_test(args.device, args.baudrate, "microbench_matrix")
do_test(args.device, args.baudrate, "microbench_uorb")
#do_test(args.device, args.baudrate, "mixer")
do_test(args.device, args.baudrate, "param")
do_test(args.device, args.baudrate, "parameters")
do_test(args.device, args.baudrate, "perf")
do_test(args.device, args.baudrate, "search_min")
do_test(args.device, args.baudrate, "sleep")
do_test(args.device, args.baudrate, "smoothz")
do_test(args.device, args.baudrate, "time")
do_test(args.device, args.baudrate, "uorb")
do_test(args.device, args.baudrate, "versioning")
if __name__ == "__main__": if __name__ == "__main__":
main() main()