canonical / checkbox

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

Usb tests change base script (BugFix) #1291

Open fernando79513 opened 2 weeks ago

fernando79513 commented 2 weeks ago

Description

The insert/remove/storage tests were failing on devices without udisks2 since that was the main tool we used for these tests (removable_storage_watcher.py). Since the addition of core devices, we have a secondary script for this kind of tests (run_watcher.py) that just looks at journalctl messages instead of requiring udisks2 to asses the insertion/removal of a USB device.

The main requirement for this PR was to use run_watcher.py only for devices without udisks2, but I extended the usage of this script for all the devices, but only for the jobs that were already using run_watcher.py on ubuntu core.

We did the same for the "usb_read_write.py" script.

I've also modified both of the scripts to fix some bugs and increase the clarity.

The removable_storage_test.py is still used for some automated tests, this PR focuses on removing the udisks2 from tests that were already run on ubuntu_core.

I also removed the usb/disk_detect job, since it seemed to be a copy of usb/detect and it was not included in any other test-plan

Resolved issues

https://warthogs.atlassian.net/browse/CER-2624 https://github.com/canonical/checkbox/issues/1029

Documentation

Tests

A selection of the tests have been tested on core and on classic. The thunderbolt tests have not been tested, since I don't have access to a thunderbolt drive. To run the modified tests:

checkbox-cli run com.canonical.certification::usb/insert
checkbox-cli run com.canonical.certification::usb/remove
checkbox-cli run com.canonical.certification::usb/storage-automated

Also available for:

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 65.71429% with 12 lines in your changes missing coverage. Please review.

Project coverage is 44.35%. Comparing base (397306c) to head (4589cea). Report is 13 commits behind head on main.

Files Patch % Lines
...support/checkbox_support/scripts/usb_read_write.py 0.00% 8 Missing :warning:
...ox-support/checkbox_support/scripts/run_watcher.py 85.18% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1291 +/- ## ========================================== + Coverage 44.10% 44.35% +0.25% ========================================== Files 358 358 Lines 38765 38659 -106 Branches 6571 6540 -31 ========================================== + Hits 17096 17149 +53 + Misses 21006 20846 -160 - Partials 663 664 +1 ``` | [Flag](https://app.codecov.io/gh/canonical/checkbox/pull/1291/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/1291/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical) | `18.56% <ø> (ø)` | | 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.