diff --git a/test/hitl/hitl_hfp.json b/test/hitl/hitl_hfp.json index 426123288..866e5233f 100644 --- a/test/hitl/hitl_hfp.json +++ b/test/hitl/hitl_hfp.json @@ -22,6 +22,10 @@ "name": "dfu_runtime", "firmware": "examples/device/dfu_runtime/_build/stm32l412nucleo/dfu_runtime.elf" }, + { + "name": "hid_boot_interface", + "firmware": "examples/device/hid_boot_interface/_build/stm32l412nucleo/hid_boot_interface.elf" + }, { "name": "board_test", "firmware": "examples/device/board_test/_build/stm32l412nucleo/board_test.elf" @@ -50,6 +54,10 @@ "name": "dfu_runtime", "firmware": "examples/device/dfu_runtime/_build/stm32f746disco/dfu_runtime.elf" }, + { + "name": "hid_boot_interface", + "firmware": "examples/device/hid_boot_interface/_build/stm32f746disco/hid_boot_interface.elf" + }, { "name": "board_test", "firmware": "examples/device/board_test/_build/stm32f746disco/board_test.elf" diff --git a/test/hitl/hitl_test.py b/test/hitl/hitl_test.py index dc6019470..695c6a28c 100644 --- a/test/hitl/hitl_test.py +++ b/test/hitl/hitl_test.py @@ -54,8 +54,7 @@ def test_cdc_dual_ports(id): time.sleep(1) timeout = timeout - 1 - assert os.path.exists(port1) and os.path.exists(port2), \ - 'Device not available' + assert timeout, 'Device not available' # Echo test ser1 = serial.Serial(port1) @@ -89,8 +88,7 @@ def test_cdc_msc(id): time.sleep(1) timeout = timeout - 1 - assert os.path.exists(port) and os.path.isfile(file), \ - 'Device not available' + assert timeout, 'Device not available' # Echo test ser1 = serial.Serial(port) @@ -170,6 +168,22 @@ def test_dfu_runtime(id): print('dfu_runtime test done') +def test_hid_boot_interface(id): + kbd = f'/dev/input/by-id/usb-TinyUSB_TinyUSB_Device_{id}-event-kbd' + mouse1 = f'/dev/input/by-id/usb-TinyUSB_TinyUSB_Device_{id}-if01-event-mouse' + mouse2 = f'/dev/input/by-id/usb-TinyUSB_TinyUSB_Device_{id}-if01-mouse' + # Wait device enum + timeout = 10 + while timeout: + if os.path.exists(kbd) and os.path.exists(mouse1) and os.path.exists(mouse2): + break + time.sleep(1) + timeout = timeout - 1 + + assert timeout, 'Device not available' + + print('hid_boot_interface test done') + def test_board_test(id): # Dummy test pass