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

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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Conversation

rickwu666666
Copy link
Contributor

@rickwu666666 rickwu666666 commented Nov 19, 2024

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 [email protected] 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

@rickwu666666 rickwu666666 added the ce-oem The PR only contains to the ce-oem provider under the contrib area label Nov 19, 2024
@rickwu666666 rickwu666666 changed the title Add wifi AP mode test (New) [ce-oem] Add wifi AP mode test (New) Nov 19, 2024
Copy link
Collaborator

@stanley31huang stanley31huang left a comment

Choose a reason for hiding this comment

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

I left several inline comments, please take a look.

rickwu666666 and others added 6 commits December 11, 2024 08:41
Make subprocess check the status instead of capture the exception
Since we add debug log about the running command. Therefore, we don't need --set-ap-only anymore. Since it originally design for debug purpose
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.85%. Comparing base (e2b812d) to head (c6f4b96).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1606   +/-   ##
=======================================
  Coverage   48.85%   48.85%           
=======================================
  Files         370      370           
  Lines       40234    40234           
  Branches     6794     6794           
=======================================
  Hits        19657    19657           
  Misses      19857    19857           
  Partials      720      720           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rickwu666666 rickwu666666 marked this pull request as draft December 12, 2024 02:06
This default set will be get the first available wireless interface
@rickwu666666 rickwu666666 marked this pull request as ready for review December 12, 2024 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ce-oem The PR only contains to the ce-oem provider under the contrib area
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants