diff --git a/.ci/Jenkinsfile-hardware b/.ci/Jenkinsfile-hardware index 3044ff2b56..73483107a7 100644 --- a/.ci/Jenkinsfile-hardware +++ b/.ci/Jenkinsfile-hardware @@ -362,7 +362,7 @@ pipeline { sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_stress"' // test dataman - sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests dataman" || true' + sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests dataman" --ignore-stdout-errors' sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests file" || true' sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "uorb_tests"' @@ -449,7 +449,7 @@ pipeline { sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "uorb_tests latency_test" || true' // test dataman - sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests dataman" || true' + sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests dataman" --ignore-stdout-errors' } } stage("status") { diff --git a/Tools/HIL/run_nsh_cmd.py b/Tools/HIL/run_nsh_cmd.py index dcdd9ec1e7..7c37679adf 100755 --- a/Tools/HIL/run_nsh_cmd.py +++ b/Tools/HIL/run_nsh_cmd.py @@ -39,7 +39,7 @@ def print_line(line): print('{0}'.format(line), end='') -def do_nsh_cmd(port_url, baudrate, cmd): +def do_nsh_cmd(port_url, baudrate, cmd, ignore_stdout_errors=False): ser = serial.serial_for_url(url=port_url, baudrate=baudrate, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=1, xonxoff=False, rtscts=False, dsrdtr=False, inter_byte_timeout=1) timeout_start = time.monotonic() @@ -106,7 +106,7 @@ def do_nsh_cmd(port_url, baudrate, cmd): if success_cmd in serial_line: sys.exit(return_code) else: - if "ERROR " in serial_line: + if "ERROR " in serial_line and not ignore_stdout_errors: return_code = -1 print_line(serial_line) @@ -148,6 +148,8 @@ def main(): parser.add_argument('--device', "-d", nargs='?', default=default_device, help='', required=device_required) parser.add_argument("--baudrate", "-b", dest="baudrate", type=int, help="serial port baud rate (default=57600)", default=57600) parser.add_argument("--cmd", "-c", dest="cmd", help="Command to run") + parser.add_argument('--ignore-stdout-errors', action='store_true', + help='Ignore errors printed to stdout') args = parser.parse_args() tmp_file = "{0}/pyserial_spy_file.txt".format(tempfile.gettempdir()) @@ -155,7 +157,7 @@ def main(): print("pyserial url: {0}".format(port_url)) - do_nsh_cmd(port_url, args.baudrate, args.cmd) + do_nsh_cmd(port_url, args.baudrate, args.cmd, args.ignore_stdout_errors) if __name__ == "__main__": main()