-
Notifications
You must be signed in to change notification settings - Fork 52
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 wifi nmcli backup/restore /delete on 24.04 Desktop (BugFix) #1324
Conversation
1b512d1
to
5f4de7d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1324 +/- ##
==========================================
+ Coverage 45.72% 46.77% +1.04%
==========================================
Files 367 367
Lines 39134 39317 +183
Branches 6618 6648 +30
==========================================
+ Hits 17894 18390 +496
+ Misses 20565 20236 -329
- Partials 675 691 +16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
1f7061a
to
718d9a7
Compare
6950fed
to
17fef73
Compare
Rebase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GJ! The functionality seems fine to me.
I added some comments to make the code more simple and clear and pointed some issues with the tests.
Also, as in the other PR, it would be great if you could add some of the information that's on the PR description (very nice, BTW) as comments on the code.
Simplify the unit test Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com>
Fix typo Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com>
Simplify the unit test Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com>
Simplify the unit test Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com>
Only catch the sp.CalledProcessError Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com>
@fernando79513 please review these changes~~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the changes. I just added some small issues and a couple of comments.
dfdeccf
to
ccb417e
Compare
ccb417e
to
2753641
Compare
@fernando79513, please review the changes ~~ |
Description
NetworkManager behavior in 24.04 is a little different with former.
It will using the netplan to dispatch the networking backend daemon, and the NetworkManager config file (
*.nmconnection
) is not a permanent file (will not under the/etc/NetworkManager/system-connections
), but the temporary file (under/run/Networkmanger/system-connections
).The permanent file will only exist in netplan (
/etc/netplan
).Based on the these reason, there are some part need to modify:
nmcli delete
(will call the dbus api), it will also delete the netplan config file, and it will make the networking can't recover anymorenmcli np/down
to control which SSID we need to connect and disconnectModify part
wifi_nmcli_backup.py
save_connections
*.nmconnection
files. Then, establish a respective full path directory within$PLAINBOX_SESSION_SHARE/stored-system-connections/
and transfer the files into it.restore_connections
*.nmconnection
files located in$PLAINBOX_SESSION_SHARE/stored-system-connections/*/**/
back to their initial paths.wifi_nmcli_test.py
_get_nm_wireless_connections
get_nm_activate_connection
turn_up_connection
nmcli up
command to select the desired SSID for connection establishment.turn_down_nm_connections
cleanup_nm_connections
withnmcli delete
to clear all connections. This method, while not foolproof, doesn't allow recovery of original connections after testing (even withwifi_nmcli_backup.py restore
).nmcli down
to deactivate all connections. NetworkManager can function without any active SSID, allowing access even when those APs are available.delete_test_ap_ssid_connection
list_aps
show_aps
list_aps
; specifically printsaps_dict
.wait_for_connected
open_connection
and func:secured_connection
parser_args
main
Resolved issues
OEMQA-4582 NetworkManager test case impact in 24.04 Desktop
Documentation
Tests
202211-30784 Test on 22.04: https://certification.canonical.com/hardware/202211-30784/submission/379839/
202001-27667 Test on 24.04: https://certification.canonical.com/hardware/202001-27667/submission/379975/