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

Fix error with usb3gen2x1 #1476

Closed fernando79513 closed 2 months ago

fernando79513 commented 2 months ago

Description

Taking a look at https://github.com/canonical/checkbox/issues/1456 I saw that there is an error in the "insertion" condition. Explanation The line:

python Copy code if "USB Mass Storage device detected" or "uas" in line_str: does not work as intended because of the way Python evaluates conditional expressions. Here's what's happening step by step:

Expression Evaluation Order:

Python evaluates "USB Mass Storage device detected" first. Since non-empty strings are considered True in a boolean context, "USB Mass Storage device detected" evaluates to True. Therefore, the entire expression before the or operator is True.

Resolved issues

N/A

Documentation

N/A

Tests

Run Storage tests (22.04 laptop) checkbox-cli run com.canonical.certification::usb3-cert-manual

codecov[bot] commented 2 months ago

Codecov Report

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

Project coverage is 47.11%. Comparing base (21efaa7) to head (e5da674). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1476 +/- ## ========================================== + Coverage 46.61% 47.11% +0.50% ========================================== Files 368 368 Lines 39299 39442 +143 Branches 6647 6667 +20 ========================================== + Hits 18319 18583 +264 + Misses 20276 20155 -121 Partials 704 704 ``` | [Flag](https://app.codecov.io/gh/canonical/checkbox/pull/1476/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/1476/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical) | `23.04% <ø> (+1.43%)` | :arrow_up: | | [provider-certification-client](https://app.codecov.io/gh/canonical/checkbox/pull/1476/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical) | `57.14% <ø> (ø)` | | 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.