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

Fix error with usb3gen2x1 #1476

Closed
wants to merge 0 commits into from
Closed

Conversation

fernando79513
Copy link
Collaborator

Description

Taking a look at #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

Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@            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 Coverage Δ
provider-base 23.04% <ø> (+1.43%) ⬆️
provider-certification-client 57.14% <ø> (ø)

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.

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.

2 participants