Skip to content

Automate wake-on-LAN tests (New)#1686

Merged
eugene-yujinwu merged 10 commits into
mainfrom
automate_wake-on-lan
Mar 24, 2025
Merged

Automate wake-on-LAN tests (New)#1686
eugene-yujinwu merged 10 commits into
mainfrom
automate_wake-on-lan

Conversation

@eugene-yujinwu
Copy link
Copy Markdown
Contributor

Automate wake-on-LAN tests (New)

Description

We would like to automate the wake-on-LAN test instead of running manual tests for it.
Please refer to wake-on-LAN-automatic-tests.md in the commit for more details

Resolved issues

Make the Wake-on-LAN test from manual to automatic.

Documentation

wake-on-LAN-automatic-tests.md

Tests

"[wol_S3_auto] Both success": https://certification.canonical.com/submissions/status/300209

"[wol_S3_auto] Cannot connect to the WOL server" : https://certification.canonical.com/submissions/status/300211

"[wol_S3_auto] One of the WOL disabled" : https://certification.canonical.com/submissions/status/300210

"[wol_auto_test] One of NIC has wake-on-LAN issue" : https://certification.canonical.com/submissions/status/300212

"[wake-on-Lan] test for one NIC": https://certification.canonical.com/hardware/202406-34088/submission/408713/

@eugene-yujinwu eugene-yujinwu requested a review from pieqq January 21, 2025 02:52
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.87%. Comparing base (7817ae2) to head (f259115).
Report is 133 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1686      +/-   ##
==========================================
+ Coverage   49.63%   49.87%   +0.24%     
==========================================
  Files         377      379       +2     
  Lines       40630    40826     +196     
  Branches     6830     6854      +24     
==========================================
+ Hits        20168    20364     +196     
  Misses      19740    19740              
  Partials      722      722              
Flag Coverage Δ
provider-base ∅ <100.00%> (∅)
provider-certification-client ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread providers/base/units/ethernet/jobs.pxu Outdated
Comment thread providers/base/bin/wol_check.py Outdated
Comment thread providers/base/bin/wol_check.py Outdated
Comment thread providers/base/bin/wol_client.py Outdated
Comment thread providers/base/tests/test_wol_server.py Outdated
@eugene-yujinwu eugene-yujinwu marked this pull request as draft January 23, 2025 05:33
@eugene-yujinwu eugene-yujinwu marked this pull request as ready for review February 19, 2025 01:48
Comment thread providers/base/bin/wol_check.py Outdated
Comment thread providers/base/bin/wol_check.py Outdated
Comment thread providers/base/bin/wol_check.py Outdated
Comment thread providers/base/bin/wol_check.py Outdated
Comment thread providers/base/bin/wol_client.py Outdated
Comment thread providers/base/bin/wol_client.py Outdated
Comment thread providers/base/bin/wol_client.py Outdated
Comment thread providers/base/bin/wol_check.py
@eugene-yujinwu eugene-yujinwu force-pushed the automate_wake-on-lan branch 2 times, most recently from 5e3a584 to e9de79a Compare February 28, 2025 04:32
eugene-yujinwu and others added 6 commits March 7, 2025 13:44
please refer to wake-on-LAN-automatic-tests.md for more details

Co-authored-by: hanhsuan <32028620+hanhsuan@users.noreply.github.com>
… checkbox. This is because it's not directly called by checkbox and introduces an unnecessary dependency on FastAPI.
…ues on some older python versions.

Fix some issues per Stanley's review
Add the related unit tests after code changes
Move inline function out of get_ip_mac per Stanley's comments
eugene-yujinwu and others added 4 commits March 7, 2025 13:52
use more specific 4xx or 5xx status code from wol_server

Co-authored-by: stanley31huang <stanley.huang@canonical.com>
Check the return value when get the timestamp to prevent unexpected exception
Update related unit tests
Copy link
Copy Markdown
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.

LGTM

@eugene-yujinwu eugene-yujinwu merged commit 3dc0dc3 into main Mar 24, 2025
@eugene-yujinwu eugene-yujinwu deleted the automate_wake-on-lan branch March 24, 2025 09:18
@eugene-yujinwu
Copy link
Copy Markdown
Contributor Author

Thank you @stanley31huang for detailed and helpful reviews.

pieqq added a commit that referenced this pull request Mar 24, 2025
pieqq added a commit that referenced this pull request Mar 24, 2025
Revert "Automate wake-on-LAN tests (New) (#1686)"

This reverts commit 3dc0dc3.
stanley31huang added a commit that referenced this pull request Mar 28, 2025
* Automated the wake-on-LAN tests (New)

please refer to wake-on-LAN-automatic-tests.md for more details

Co-authored-by: hanhsuan <32028620+hanhsuan@users.noreply.github.com>

* Fix the unit test issue

* Remove wol_server.py and place it in a separate repository outside of checkbox. This is because it's not directly called by checkbox and introduces an unnecessary dependency on FastAPI.

* remove f-string syntax not be supported in Python 3.5

* Use socket and urllib to replace netifaces and urllib3 since some issues on some older python versions.
Fix some issues per Stanley's review
Add the related unit tests after code changes

* Add a has_wake_on_lan_server manifest per Stanley's comments
Move inline function out of get_ip_mac per Stanley's comments

* fix some of the new reviews from Stanley

* remove unused parameters in wol_check.py
use more specific 4xx or 5xx status code from wol_server

Co-authored-by: stanley31huang <stanley.huang@canonical.com>

* Use the /proc/stat to get the system boot time
Check the return value when get the timestamp to prevent unexpected exception
Update related unit tests

* fix some errors in the Readme

---------

Co-authored-by: hanhsuan <32028620+hanhsuan@users.noreply.github.com>
Co-authored-by: stanley31huang <stanley.huang@canonical.com>
stanley31huang pushed a commit that referenced this pull request Mar 28, 2025
Revert "Automate wake-on-LAN tests (New) (#1686)"

This reverts commit 3dc0dc3.
mreed8855 pushed a commit that referenced this pull request Jul 30, 2025
* Automated the wake-on-LAN tests (New)

please refer to wake-on-LAN-automatic-tests.md for more details

Co-authored-by: hanhsuan <32028620+hanhsuan@users.noreply.github.com>

* Fix the unit test issue

* Remove wol_server.py and place it in a separate repository outside of checkbox. This is because it's not directly called by checkbox and introduces an unnecessary dependency on FastAPI.

* remove f-string syntax not be supported in Python 3.5

* Use socket and urllib to replace netifaces and urllib3 since some issues on some older python versions.
Fix some issues per Stanley's review
Add the related unit tests after code changes

* Add a has_wake_on_lan_server manifest per Stanley's comments
Move inline function out of get_ip_mac per Stanley's comments

* fix some of the new reviews from Stanley

* remove unused parameters in wol_check.py
use more specific 4xx or 5xx status code from wol_server

Co-authored-by: stanley31huang <stanley.huang@canonical.com>

* Use the /proc/stat to get the system boot time
Check the return value when get the timestamp to prevent unexpected exception
Update related unit tests

* fix some errors in the Readme

---------

Co-authored-by: hanhsuan <32028620+hanhsuan@users.noreply.github.com>
Co-authored-by: stanley31huang <stanley.huang@canonical.com>
mreed8855 pushed a commit that referenced this pull request Jul 30, 2025
Revert "Automate wake-on-LAN tests (New) (#1686)"

This reverts commit 3dc0dc3.
mreed8855 pushed a commit that referenced this pull request Jul 31, 2025
* Automated the wake-on-LAN tests (New)

please refer to wake-on-LAN-automatic-tests.md for more details

Co-authored-by: hanhsuan <32028620+hanhsuan@users.noreply.github.com>

* Fix the unit test issue

* Remove wol_server.py and place it in a separate repository outside of checkbox. This is because it's not directly called by checkbox and introduces an unnecessary dependency on FastAPI.

* remove f-string syntax not be supported in Python 3.5

* Use socket and urllib to replace netifaces and urllib3 since some issues on some older python versions.
Fix some issues per Stanley's review
Add the related unit tests after code changes

* Add a has_wake_on_lan_server manifest per Stanley's comments
Move inline function out of get_ip_mac per Stanley's comments

* fix some of the new reviews from Stanley

* remove unused parameters in wol_check.py
use more specific 4xx or 5xx status code from wol_server

Co-authored-by: stanley31huang <stanley.huang@canonical.com>

* Use the /proc/stat to get the system boot time
Check the return value when get the timestamp to prevent unexpected exception
Update related unit tests

* fix some errors in the Readme

---------

Co-authored-by: hanhsuan <32028620+hanhsuan@users.noreply.github.com>
Co-authored-by: stanley31huang <stanley.huang@canonical.com>
mreed8855 pushed a commit that referenced this pull request Jul 31, 2025
Revert "Automate wake-on-LAN tests (New) (#1686)"

This reverts commit 3dc0dc3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants