canonical / checkbox

Checkbox
https://checkbox.readthedocs.io
GNU General Public License v3.0
31 stars 46 forks source link

AttributeError: 'NoneType' object has no attribute 'Get' in wwan_tests.py #1411

Open pieqq opened 1 month ago

pieqq commented 1 month ago

Bug Description

We recently hit a problem when running the job wwan/check-sim-present-.*-auto on a device in our Cert lab.

See below for output.

To Reproduce

  1. Launch Checkbox
  2. Select a test plan with the WWAN category
  3. Run the wwan/check-sim-present-.*-auto job

Environment

Relevant log output

Test fails with following output:

Traceback (most recent call last):
  File "/tmp/nest-pl2m78jk.c9755cd73888c12a9df9a44088be9f631e1b25d055103b2e15db38b5980a4870/wwan_tests.py", line 548, in <module>
    WWANTests().main()
  File "/tmp/nest-pl2m78jk.c9755cd73888c12a9df9a44088be9f631e1b25d055103b2e15db38b5980a4870/wwan_tests.py", line 544, in main
    sub_commands[args.subcommand]().invoked()
  File "/tmp/nest-pl2m78jk.c9755cd73888c12a9df9a44088be9f631e1b25d055103b2e15db38b5980a4870/wwan_tests.py", line 499, in invoked
    if not mm.sim_present(mm_id):
  File "/tmp/nest-pl2m78jk.c9755cd73888c12a9df9a44088be9f631e1b25d055103b2e15db38b5980a4870/wwan_tests.py", line 129, in sim_present
    if pi.Get(DBUS_MM1_IF_MODEM, "Sim") != "/":
AttributeError: 'NoneType' object has no attribute 'Get'


### Additional context

_No response_
syncronize-issues-to-jira[bot] commented 1 month ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CHECKBOX-1531.

This message was autogenerated

stanley31huang commented 1 month ago

The LTE modem is not enabled by default, so we have a bootstrapped job to bring it up in the beginning. So the wwan/check-sim-present-.*-auto job failed at first round due to no SIM card. And the reason why it failed at second round is there's a reboot job during the testing.

IMHO, the solution would be either we raise an Exception in the MMDbus.init function or we make sure the mm_id is valid.