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 wifi netplan gateway parser (Bugfix) #1536

Closed seankingyang closed 1 month ago

seankingyang commented 1 month ago

Description

Correct the gateway parser.

In UC20, the systemd version is 245, and the formate is difference with the newer systemd version:

ubuntu@ubuntu:~$ networkctl --version
systemd 245 (245.4-4ubuntu3.23)

ubuntu@ubuntu:~$ networkctl status --no-pager --no-legend wlp1s0 
● 3: wlp1s0                                                              
             Link File: /usr/lib/systemd/network/99-default.link         
          Network File: /run/systemd/network/10-netplan-wlp1s0.network   
                  Type: wlan                                             
                 State: routable (configured)  
                  Path: pci-0000:01:00.0                                 
                Driver: iwlwifi                                          
                Vendor: Intel Corporation                                
                 Model: Wireless 8265 / 8275 (Dual Band Wireless-AC 8265)
            HW Address: b4:6b:fc:33:40:e6 (Intel Corporate)              
                   MTU: 1500 (min: 256, max: 2304)                       
     WiFi access point: cert-ac-open-tel-l3-01 (ae:84:c6:62:8d:12)       
  Queue Length (Tx/Rx): 1/1                                              
               Address: 192.168.153.146 (DHCP4)                          
                        fe80::b66b:fcff:fe33:40e6                        
               Gateway: 192.168.144.1 (TP-LINK TECHNOLOGIES CO.,LTD.)    
                   DNS: 192.168.144.1                                    
     Activation Policy: up                                               
   Required For Online: yes       

In UC22, the systemd version is 249:

ceqa@ubuntu:~$ networkctl --version
systemd 249 (249.11-0ubuntu3.12)

ceqa@ubuntu:~$ networkctl status --no-pager --no-legend wlp1s0 
● 3: wlp1s0                                                                    
                     Link File: /usr/lib/systemd/network/99-default.link
                  Network File: /run/systemd/network/10-netplan-wlp1s0.network
                          Type: wlan
                         State: routable (configured)
                  Online state: online                                         
                          Path: platform-112f0000.pcie-pci-0000:01:00.0
                        Driver: mt7921e
                        Vendor: MEDIATEK Corp.
                    HW Address: 2c:3b:70:3f:d2:f3
                           MTU: 1500 (min: 256, max: 2304)
                         QDisc: noqueue
  IPv6 Address Generation Mode: eui64
             WiFi access point: cert-ac-open-tel-l3-01 (ae:84:c6:62:8d:12)
          Queue Length (Tx/Rx): 1/1
                       Address: 192.168.156.224 (DHCP4 via 192.168.144.1)
                                fe80::2e3b:70ff:fe3f:d2f3
                       Gateway: 192.168.144.1
                           DNS: 192.168.144.1
             Activation Policy: up
           Required For Online: yes
               DHCP4 Client ID: IAID:0xff4d6f5/DUID
             DHCP6 Client DUID: DUID-EN/Vendor:0000ab11719fc417932a6a1c0000

Resolved issues

Incorrect ping parameter on wirless open ac connection test #1533

Documentation

Tests

codecov[bot] commented 1 month ago

Codecov Report

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

Project coverage is 47.73%. Comparing base (cd772da) to head (b691e52). Report is 7 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1536 +/- ## ========================================== + Coverage 47.72% 47.73% +0.01% ========================================== Files 370 370 Lines 39739 39750 +11 Branches 6719 6720 +1 ========================================== + Hits 18965 18976 +11 Misses 20059 20059 Partials 715 715 ``` | [Flag](https://app.codecov.io/gh/canonical/checkbox/pull/1536/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/1536/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical) | `24.71% <100.00%> (+0.05%)` | :arrow_up: | 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.