canonical / checkbox

Checkbox is a testing framework used to validate device compatibility with Ubuntu Linux. It’s the testing tool developed for the purposes of the Ubuntu Certification program.
https://checkbox.readthedocs.io
GNU General Public License v3.0
33 stars 50 forks source link

Add a manifest entry to check if a SIM card is inserted (New) #1500

Closed pieqq closed 1 month ago

pieqq commented 1 month ago

Description

By creating a has_sim_card manifest entry and using it as a requirement on WWAN jobs that need a SIM card, this PR ensure these jobs will not fail if a WWAN is found, but has no working SIM card inserted.

Resolved issues

1493

https://warthogs.atlassian.net/browse/CHECKBOX-1578

Documentation

Tests

As I don't have a device with a WWAN module, nor a SIM card I could use, I just checked the status of the 24.04 test plan before and after applying this patch by calling checkbox-cli expand "com.canonical.certification::client-cert-desktop-24-04" --format json | jq on main and on this branch, and comparing the results (we can see the requirement on manifest.has_sim_card shows up):

5453c5453
<     "requires": " manifest.has_wwan_module == 'True'\n snap.name == 'modem-manager' or package.name == 'modemmanager'",
---
>     "requires": " manifest.has_wwan_module == 'True'\n manifest.has_sim_card == 'True'\n snap.name == 'modem-manager' or package.name == 'modemmanager'",
5472c5472
<     "requires": " manifest.has_wwan_module == 'True'\n snap.name == 'modem-manager' or package.name == 'modemmanager'",
---
>     "requires": " manifest.has_wwan_module == 'True'\n manifest.has_sim_card == 'True'\n snap.name == 'modem-manager' or package.name == 'modemmanager'",
5507c5507
<     "requires": " manifest.has_wwan_module == 'True'\n snap.name == 'modem-manager' or package.name == 'modemmanager'",
---
>     "requires": " manifest.has_wwan_module == 'True'\n manifest.has_sim_card == 'True'\n snap.name == 'modem-manager' or package.name == 'modemmanager'",
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 47.50%. Comparing base (7182b16) to head (427f80d).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1500 +/- ## ======================================= Coverage 47.50% 47.50% ======================================= Files 369 369 Lines 39549 39549 Branches 6678 6678 ======================================= Hits 18788 18788 Misses 20050 20050 Partials 711 711 ``` | [Flag](https://app.codecov.io/gh/canonical/checkbox/pull/1500/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical) | Coverage Δ | | |---|---|---| | [provider-base](https://app.codecov.io/gh/canonical/checkbox/pull/1500/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical) | `24.02% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

pieqq commented 1 month ago

The following test is required on a device with a working WWAN module and a working SIM card:

  1. Run the client-cert-desktop-22-04 test plan
  2. Make sure the WWAN category is selected (and make note of the jobs selected) and start the test
  3. Make sure a new "A Working SIM Card Inserted" is shown in the "Does this machine have this piece of hardware?" section of the Manifest Screen, and is selected (along with "WWAN Module")
  4. Run the tests

→ the WWAN jobs should run succesfully. These should be:

Repeat the same steps, but this time selecting "No" for "A Working SIM Card Inserted".

→ This time, the 3 jobs mentioned above should be skipped.

hanhsuan commented 1 month ago

@pieqq Hi, there is no A working SIM card inserted manifest could be selected. image

hanhsuan commented 1 month ago

The manifest is shown, but only one job you mentioned is shown and tested. image

with sim without sim

pieqq commented 1 month ago

Thanks! It's weird that the other jobs don't show up.

Could you run the following on that device and report the output?

$ checkbox-cli list-bootstrapped com.canonical.certification::client-cert-desktop-22-04

and

$ checkbox-cli expand com.canonical.certification::client-cert-desktop-22-04
pieqq commented 1 month ago

Following some testing by @hanhsuan from QA team, we found the following:

This PR is good to land as is, and we need to work on the 3 aforementioned issues to prevent problems with WWAN testing.