project-chip / certification-tool

A test harness and tooling designed to simplify development, testing, and certification for devices, guided by the Connectivity Standards Alliance.
https://csa-iot.org/
Apache License 2.0
42 stars 24 forks source link

[Bug] UI-Python script failures. #342

Closed yinyihu-silabs closed 3 months ago

yinyihu-silabs commented 3 months ago

Describe the bug

When running UI-Python scripts, getting error message:

Executing Test Case: TC-IDM-10.2
Test Setup
User prompt: "Make sure the DUT is in Commissioning Mode"
User chose prompt option DONE
User prompt: "Should the DUT be commissioned to run this test case?"
User chose prompt option YES
Commission DUT
Sending command to SDK container: python3 /root/python_testing/scripts/sdk/test_harness_client.py commission --trace-to json:log --commissioning-method ble-thread --discriminator 1234 --passcode 20202021 --timeout 10000 --thread-dataset-hex 000300001902085b35dead5b35beef051000112233445566778899aabbccddeeff01025b35 --int-arg use_pase_only:0
/usr/bin/python3: can't find '__main__' module in '/root/python_testing/scripts/sdk/test_harness_client.py'
Test Case Error: Error occurred during setup of test case TC_IDM_10_2. Failed to commission DUT

in the docker container, it shows that test_harness_client.py does not come up as a python file, but a directory.

pi@matter14:~/certification-tool$ docker exec -it th-sdk /bin/bash
root@matter14:~# ll python_testing/scripts/sdk/test_harness_client.py
total 8
drwxr-xr-x 2 root root 4096 Aug  9 19:59 ./
drwxr-xr-x 3 root root 4096 Aug  8 21:37 ../

Steps to reproduce the behavior

  1. Start a UI-Python script.
  2. Pause at user prompt.
  3. Enter docker container
  4. Run ll python_testing/scripts/sdk/test_harness_client.py, "file" appears to be a directory.
    pi@matter14:~/certification-tool$ docker exec -it th-sdk /bin/bash
    root@matter14:~# ll python_testing/scripts/sdk/test_harness_client.py
    total 8
    drwxr-xr-x 2 root root 4096 Aug  9 19:59 ./
    drwxr-xr-x 3 root root 4096 Aug  8 21:37 ../

TH version: v2.11-beta2+fall2024

hiltonlima commented 3 months ago

@yinyihu-silabs, Thanks for the feedback.

I was unable to reproduce it in the environment here by installing from scratch (formatting the SD card).

Could you tell me what steps you used to perform the installation?

andy31415 commented 3 months ago

I had a similar issue (same really?) and it seemed to be because I customized the user for my ubuntu install. Instead of ubuntu I had something else.

What is the username you use on the raspberry pi?

andy31415 commented 3 months ago

pi@matter14 seems to indicate you use the username pi. That seems to not work... @yinyihu-silabs

yinyihu-silabs commented 3 months ago

yes changing the user name to ubuntu fixes the issue for me

hiltonlima commented 3 months ago

@yinyihu-silabs Thank you for your feedback.

The user name must be UBUNTU for the system to work correctly.

With this in mind, we will make the installation instructions clearer so that they are not changed.