Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

pieqq
Copy link
Collaborator

@pieqq pieqq commented Sep 24, 2024

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'",

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@           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 Coverage Δ
provider-base 24.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pieqq pieqq changed the title Add a manifest entry to check if a SIM card is inserted Add a manifest entry to check if a SIM card is inserted (New) Sep 24, 2024
@pieqq
Copy link
Collaborator Author

pieqq commented Sep 24, 2024

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:

  • wwan/3gpp-scan-manufacturer-model-hw_id-auto
  • wwan/check-sim-present-manufacturer-model-hw_id-auto
  • wwan/gsm-connection-manufacturer-model-hw_id-auto)

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
Copy link
Contributor

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

@hanhsuan
Copy link
Contributor

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

with sim
without sim

@pieqq
Copy link
Collaborator Author

pieqq commented Sep 27, 2024

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
Copy link
Collaborator Author

pieqq commented Oct 1, 2024

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.

@fernando79513 fernando79513 self-assigned this Oct 1, 2024
Copy link
Collaborator

@fernando79513 fernando79513 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gj identifying all the related issues.
LGTM +1!

@fernando79513 fernando79513 merged commit ba4bbb7 into main Oct 1, 2024
46 of 49 checks passed
@fernando79513 fernando79513 deleted the 1493-sim-card-manifest branch October 1, 2024 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants