ARMmbed / mbed-os-tools

The tools to test and work with Mbed OS
Apache License 2.0
33 stars 67 forks source link

htrun requires a working DAPLink-style serial port, even when a communication port is specified #267

Closed Patater closed 3 years ago

Patater commented 3 years ago

Description

When specifying a communication port manually (e.g. using the -p /dev/ttyUSB1 option), htrun incorrectly still attempts to verify the existence and proper functioning of the Mbed/DAPLink-style serial port. It doesn't need this, so it shouldn't attempt to verify it.

$ mbedhtrun -f build/test.elf  -p /dev/ttyUSB1:115200 -e ./path/to/host_tests/ -r pyocd -c pyocd --target-id 9902
...
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/home/user/Documents/ARM/virt_env/lib/python3.8/site-packages/mbed_os_tools/test/host_tests_conn_proxy/conn_proxy.py", line 150, in conn_process
    connector = conn_primitive_factory(conn_resource, config, event_queue, logger)
  File "/home/user/Documents/ARM/virt_env/lib/python3.8/site-packages/mbed_os_tools/test/host_tests_conn_proxy/conn_proxy.py", line 104, in conn_primitive_factory
    connector = SerialConnectorPrimitive(
  File "/home/user/Documents/ARM/virt_env/lib/python3.8/site-packages/mbed_os_tools/test/host_tests_conn_proxy/conn_primitive_serial.py", line 46, in __init__
    serial_port = HostTestPluginBase().check_serial_port_ready(self.port, target_id=self.target_id, timeout=self.polling_timeout)
  File "/home/user/Documents/ARM/virt_env/lib/python3.8/site-packages/mbed_os_tools/test/host_tests_plugins/host_test_plugins.py", line 202, in check_serial_port_ready

Don't require a functional serial port (don't look before leaping) if a communication port is manually specified. check_serial_port_ready() probably need not be called.

Issue request type

[ ] Question
[ ] Enhancement
[X] Bug