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

[ce-oem] Add wifi AP mode test (New) #1606

Open rickwu666666 opened 5 days ago

rickwu666666 commented 5 days ago

The wifi ap mode test are intend to test if DUT is able to create wifi AP and allow a HOST to connect with. And also the HOST will perform ping test to make sure the connection works fine.

Description

This test require a HOST machine to connect to DUT's AP. And support only if wireless interface managed by Network-Manager for both DUT and HOST, since networkd does not support handle wireless interface working in AP mode[1]. Also, even the Network-Manager is able to handle wireless interface working in AP mode but it support only on band a and bg[2].

[ref 1] https://netplan.readthedocs.io/en/stable/netplan-yaml/#properties-for-device-type-wifis [ref 2] https://networkmanager.dev/docs/api/latest/settings-802-11-wireless.html

Resolved issues

Documentation

Tests

Passed result:

ceqa@ubuntu:~$ sudo checkbox-baytown.checkbox-cli 
Using sideloaded provider: checkbox-provider-ce-oem, version 0.1 from /var/tmp/checkbox-providers/checkbox-provider-ce-oem
Preparing...
WARNING:plainbox.secure.providers.v1:Skipped file: /var/tmp/checkbox-providers/checkbox-provider-ce-oem/bin/__pycache__/check_gpio.cpython-310.pyc
WARNING:plainbox.secure.providers.v1:Skipped file: /var/tmp/checkbox-providers/checkbox-provider-ce-oem/bin/gst_utils.py
WARNING:plainbox.secure.providers.v1:Skipped file: /snap/checkbox-baytown/x1/providers/plainbox-provider-checkbox/units/stress/suspend_cycles_reboot.md
============[ Bootstrap com.canonical.certification::device (1/4) ]=============
======[ Bootstrap com.canonical.certification::wifi_interface_mode (2/4) ]======
=======[ Bootstrap com.canonical.certification::net_if_management (3/4) ]=======
=========[ Bootstrap com.canonical.contrib::ce_oem_wifi_ap_mode (4/4) ]=========
Reports will be saved to: /root/snap/checkbox-baytown/x1/.local/share/checkbox-ng
==============[ Running job 1 / 2. Estimated time left: 0:04:00 ]===============
------[ Create open 802.11bg Wi-Fi AP on wlP1p1s0f0 and check connection ]------
ID: com.canonical.contrib::ce-oem-wireless/ap_open_bg_ch5_none_wlP1p1s0f0_automated
Category: com.canonical.certification::wifi_ap
... 8< -------------------------------------------------------------------------
2024-11-19 03:17:47,116 - INFO - Initializing connection
2024-11-19 03:17:53,865 - INFO - Initialized connection successful!
2024-11-19 03:17:54,275 - INFO - IP address is 10.42.0.1
2024-11-19 03:17:54,277 - INFO - Ping target Host first ...
2024-11-19 03:17:57,311 - INFO - Ping target Host 10.102.89.253 successful...
2024-11-19 03:17:57,316 - INFO - Attempting to connect DUT AP qa-test-ssid...
2024-11-19 03:17:57,317 - INFO - Attempting to connect DUT AP qa-test-ssid 1 time...
2024-11-19 03:17:57,858 - ERROR - Command failed: Error: No network with SSID 'qa-test-ssid' found.

2024-11-19 03:17:57,859 - WARNING - Not able to found SSID qa-test-ssid
2024-11-19 03:18:07,869 - INFO - Attempting to connect DUT AP qa-test-ssid 2 time...
2024-11-19 03:18:10,308 - INFO - Connect successful!
2024-11-19 03:18:10,309 - INFO - Attempting to ping DUT...
2024-11-19 03:18:14,174 - INFO - Packet loss: 0 %
2024-11-19 03:18:14,175 - INFO - Ping DUT pass
2024-11-19 03:18:14,684 - INFO - Deleted host connection successfully.
2024-11-19 03:18:14,686 - INFO - Exiting context and cleaning up connection

------------------------------------------------------------------------- >8 ---
Outcome: job passed

==============[ Running job 1 / 1. Estimated time left: 0:02:00 ]===============
-------[ Create wpa 802.11a Wi-Fi AP on wlP1p1s0f0 and check connection ]-------
ID: com.canonical.contrib::ce-oem-wireless/ap_wpa_wpa-psk_a_ch44_ccmp_wlP1p1s0f0_automated
Category: com.canonical.certification::wifi_ap
... 8< -------------------------------------------------------------------------
2024-11-19 03:19:48,719 - INFO - Initializing connection
2024-11-19 03:19:55,530 - INFO - Initialized connection successful!
2024-11-19 03:19:55,955 - INFO - IP address is 10.42.0.1
2024-11-19 03:19:55,955 - INFO - Ping target Host first ...
2024-11-19 03:19:59,006 - INFO - Ping target Host 10.102.89.253 successful...
2024-11-19 03:19:59,009 - INFO - Attempting to connect DUT AP qa-test-ssid...
2024-11-19 03:19:59,011 - INFO - Attempting to connect DUT AP qa-test-ssid 1 time...
2024-11-19 03:20:05,883 - INFO - Connect successful!
2024-11-19 03:20:05,883 - INFO - Attempting to ping DUT...
2024-11-19 03:20:09,759 - INFO - Packet loss: 0 %
2024-11-19 03:20:09,760 - INFO - Ping DUT pass
2024-11-19 03:20:10,255 - INFO - Deleted host connection successfully.
2024-11-19 03:20:10,255 - INFO - Exiting context and cleaning up connection

------------------------------------------------------------------------- >8 ---
Outcome: job passed

Failed result:

==============[ Running job 2 / 2. Estimated time left: 0:02:00 ]===============
-------[ Create wpa 802.11a Wi-Fi AP on wlP1p1s0f0 and check connection ]-------
ID: com.canonical.contrib::ce-oem-wireless/ap_wpa_wpa-psk_a_ch44_ccmp_wlP1p1s0f0_automated
Category: com.canonical.certification::wifi_ap
... 8< -------------------------------------------------------------------------
2024-11-19 03:18:16,983 - INFO - Initializing connection
2024-11-19 03:18:22,581 - INFO - Initialized connection successful!
2024-11-19 03:18:23,018 - INFO - IP address is 10.42.0.1
2024-11-19 03:18:23,019 - INFO - Ping target Host first ...
2024-11-19 03:18:26,079 - INFO - Ping target Host 10.102.89.253 successful...
2024-11-19 03:18:26,081 - INFO - Attempting to connect DUT AP qa-test-ssid...
2024-11-19 03:18:26,082 - INFO - Attempting to connect DUT AP qa-test-ssid 1 time...
2024-11-19 03:18:51,948 - INFO - Connect successful!
2024-11-19 03:18:51,948 - INFO - Attempting to ping DUT...
2024-11-19 03:19:05,899 - ERROR - Command failed: PING 10.42.0.1 (10.42.0.1) 56(84) bytes of data.

--- 10.42.0.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3091ms

2024-11-19 03:19:05,899 - ERROR - An error occurred during ping_test: Command 'sshpass -p Rick@canonical ssh -o StrictHostKeyChecking=no rickwu@10.102.89.253 ping 10.42.0.1 -c 4' returned non-zero exit status 1.
2024-11-19 03:19:06,428 - INFO - Deleted host connection successfully.
2024-11-19 03:19:06,429 - INFO - Exiting context and cleaning up connection
------------------------------------------------------------------------- >8 ---
Outcome: job failed