Fix wifi nmcli backup/restore /delete on 24.04 Desktop (BugFix)#1324
Fix wifi nmcli backup/restore /delete on 24.04 Desktop (BugFix)#1324fernando79513 merged 15 commits intomainfrom
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 |
fernando79513
left a comment
There was a problem hiding this comment.
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~~ |
fernando79513
left a comment
There was a problem hiding this comment.
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/downto control which SSID we need to connect and disconnectModify part
wifi_nmcli_backup.py
save_connections*.nmconnectionfiles. Then, establish a respective full path directory within$PLAINBOX_SESSION_SHARE/stored-system-connections/and transfer the files into it.restore_connections*.nmconnectionfiles located in$PLAINBOX_SESSION_SHARE/stored-system-connections/*/**/back to their initial paths.wifi_nmcli_test.py
_get_nm_wireless_connectionsget_nm_activate_connectionturn_up_connectionnmcli upcommand to select the desired SSID for connection establishment.turn_down_nm_connectionscleanup_nm_connectionswithnmcli deleteto clear all connections. This method, while not foolproof, doesn't allow recovery of original connections after testing (even withwifi_nmcli_backup.py restore).nmcli downto deactivate all connections. NetworkManager can function without any active SSID, allowing access even when those APs are available.delete_test_ap_ssid_connectionlist_apsshow_apslist_aps; specifically printsaps_dict.wait_for_connectedopen_connectionand func:secured_connectionparser_argsmainResolved 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/