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 parser to parse wifi interface name which is not start with phy (BugFix) #1390

Merged
merged 10 commits into from
Sep 20, 2024

Conversation

rickwu666666
Copy link
Contributor

@rickwu666666 rickwu666666 commented Aug 6, 2024

Description

Add a parser to parse out the phy name as follows:

phy name start with phy.

root@ubuntu:/home/ubuntu# iw phy
Wiphy phy0
	wiphy index: 0
	max # scan SSIDs: 20
	max scan IEs length: 365 bytes

phy name start with other string.

root@ubuntu:/home/ubuntu# iw phy
Wiphy mwiphy1
	wiphy index: 1
	max # scan SSIDs: 10
	max scan IEs length: 256 bytes

Please refer to this PR for previous discussion.

Resolved issues

This change is trying to fix the issue

Documentation

Tests

Side load result of IoT Arm64 with 2 wlan interfaces on UC22

==============[ Running job 1 / 1. Estimated time left: 0:00:00 ]===============
----------[ Create resource info for supported wifi interface modes ]-----------
ID: com.canonical.certification::wifi_interface_mode
Category: com.canonical.certification::information_gathering
... 8< -------------------------------------------------------------------------
wlP1p1s0f1_managed: supported
wlP1p1s0f1_AP: supported
wlP1p1s0f1_P2P-client: supported
wlP1p1s0f1_P2P-GO: supported
wlP1p1s0f0_managed: supported
wlP1p1s0f0_AP: supported
wlP1p1s0f0_P2P-client: supported
wlP1p1s0f0_P2P-GO: supported
------------------------------------------------------------------------- >8 ---
Outcome: job passed

Side load result of IoT Arm64 with one wlan interface on UC20

----------[ Create resource info for supported wifi interface modes ]-----------
ID: com.canonical.certification::wifi_interface_mode
Category: com.canonical.certification::information_gathering
... 8< -------------------------------------------------------------------------
wlan0_IBSS: supported
wlan0_managed: supported
wlan0_AP: supported
wlan0_P2P-client: supported
wlan0_P2P-GO: supported
wlan0_P2P-device: supported
------------------------------------------------------------------------- >8 ---
Outcome: job passed

Side load result of Desktop AMD64 with one wlan interface on 24.04

----------[ Create resource info for supported wifi interface modes ]-----------
ID: com.canonical.certification::wifi_interface_mode
Category: com.canonical.certification::information_gathering
... 8< -------------------------------------------------------------------------
wlp130s0f0_IBSS: supported
wlp130s0f0_managed: supported
wlp130s0f0_AP: supported
wlp130s0f0_AP/VLAN: supported
wlp130s0f0_monitor: supported
wlp130s0f0_P2P-client: supported
wlp130s0f0_P2P-GO: supported
wlp130s0f0_P2P-device: supported
------------------------------------------------------------------------- >8 ---
Outcome: job passed

Side load result of Desktop AMD64 with one wlan interface on 22.04

----------[ Create resource info for supported wifi interface modes ]-----------
ID: com.canonical.certification::wifi_interface_mode
Category: com.canonical.certification::information_gathering
... 8< -------------------------------------------------------------------------
wlp0s20f3_IBSS: supported
wlp0s20f3_managed: supported
wlp0s20f3_AP: supported
wlp0s20f3_AP/VLAN: supported
wlp0s20f3_monitor: supported
wlp0s20f3_P2P-client: supported
wlp0s20f3_P2P-GO: supported
wlp0s20f3_P2P-device: supported
------------------------------------------------------------------------- >8 ---
Outcome: job passed

@rickwu666666 rickwu666666 changed the title Add parser to parse wifi interface name which is not start with phy(BugFix) Add parser to parse wifi interface name which is not start with phy (BugFix) Aug 6, 2024
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

Attention: Patch coverage is 91.89189% with 3 lines in your changes missing coverage. Please review.

Project coverage is 45.76%. Comparing base (b92edc5) to head (223e4ff).
Report is 28 commits behind head on main.

Files with missing lines Patch % Lines
providers/resource/bin/wifi_interface_mode.py 91.89% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1390      +/-   ##
==========================================
+ Coverage   45.72%   45.76%   +0.04%     
==========================================
  Files         367      368       +1     
  Lines       39134    39171      +37     
  Branches     6618     6625       +7     
==========================================
+ Hits        17894    17928      +34     
- Misses      20565    20567       +2     
- Partials      675      676       +1     
Flag Coverage Δ
provider-base 19.91% <ø> (ø)
provider-resource 34.29% <91.89%> (+2.28%) ⬆️

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.

@rickwu666666 rickwu666666 marked this pull request as draft August 7, 2024 07:13
@rickwu666666 rickwu666666 force-pushed the fix-issue-1048 branch 3 times, most recently from bc0f2d2 to e4fd5a8 Compare August 8, 2024 01:08
@rickwu666666 rickwu666666 marked this pull request as ready for review August 8, 2024 01:18
Copy link
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

This is a very weird resource. Why is the name of the interface a part of the resource attributes? How is this used? What happens if a mode is not supported?

Implementation feedback: you should use dicts for interface id mapping, so that you can go from one to the other without doing a full iteration over all interfaces!

Note: dont be scared by the huge diff of my suggestions, Github basically gives up at calculating a diff if you chanage indentation

providers/resource/bin/wifi_interface_mode.py Outdated Show resolved Hide resolved
providers/resource/bin/wifi_interface_mode.py Outdated Show resolved Hide resolved
providers/resource/bin/wifi_interface_mode.py Outdated Show resolved Hide resolved
@Hook25 Hook25 self-assigned this Aug 22, 2024
@Hook25 Hook25 added the waiting-for-changes The review has been completed but the PR is waiting for changes from the author label Aug 22, 2024
@rickwu666666 rickwu666666 marked this pull request as draft August 23, 2024 11:04
@rickwu666666 rickwu666666 force-pushed the fix-issue-1048 branch 2 times, most recently from ec1aff1 to da10daf Compare September 2, 2024 09:37
@rickwu666666 rickwu666666 marked this pull request as ready for review September 3, 2024 00:47
@rickwu666666
Copy link
Contributor Author

rickwu666666 commented Sep 3, 2024

@Hook25
I've revised the output of the resource job. Thanks for the review.
This is sideload result
https://certification.canonical.com/hardware/202401-33430/submission/390329/test-results/

@rickwu666666 rickwu666666 removed the waiting-for-changes The review has been completed but the PR is waiting for changes from the author label Sep 3, 2024
Copy link
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

This is great! Well done, +1

@Hook25 Hook25 merged commit 90ed9b0 into main Sep 20, 2024
45 checks passed
@Hook25 Hook25 deleted the fix-issue-1048 branch September 20, 2024 08:38
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