Skip to content

SRIOV tests and unit tests (New) #1761

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

Merged
merged 31 commits into from
Aug 1, 2025
Merged

SRIOV tests and unit tests (New) #1761

merged 31 commits into from
Aug 1, 2025

Conversation

mreed8855
Copy link
Collaborator

@mreed8855 mreed8855 commented Feb 28, 2025

sriov checkbox files

Description

  • Creates and SRIOV device in either a virtual machine or container
  • Verify's that the NIC is working.
  • Added a cleanup script that removes virtual interfaces after running tests for each interface
  • Added unit tests for cleanup_sriov

Resolved issues

This is a replacment for PR #1293
Resolves CHECKBOX-1164

Documentation

Tests

sriov checkbox files
@pedro-avalos
Copy link
Collaborator

@mreed8855 you seem to have forgotten to commit and push your bin/sriov.py file

Copy link

codecov bot commented Mar 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.70%. Comparing base (dfbf93e) to head (f6ff3b4).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1761      +/-   ##
==========================================
+ Coverage   51.13%   51.70%   +0.56%     
==========================================
  Files         386      387       +1     
  Lines       41603    41526      -77     
  Branches     7730     7706      -24     
==========================================
+ Hits        21272    21469     +197     
+ Misses      19569    19295     -274     
  Partials      762      762              
Flag Coverage Δ
provider-base 27.49% <100.00%> (+1.37%) ⬆️
provider-certification-server 57.14% <ø> (ø)

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.

@pedro-avalos pedro-avalos changed the title SRIOV tests and unit tests SRIOV tests and unit tests (New) Mar 3, 2025
@pedro-avalos pedro-avalos self-requested a review March 17, 2025 18:40
@pedro-avalos pedro-avalos self-assigned this Mar 17, 2025
Copy link
Collaborator

@pedro-avalos pedro-avalos left a comment

Choose a reason for hiding this comment

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

I have a few issues with some of the functions, but overall the test looks good.

After making these changes and updating the tests, you should run and submit a test run with a local clone of checkbox; then link the submission in the tests section of this PR, so we can review if the test runs successfully.

@mreed8855 mreed8855 requested review from a team as code owners July 30, 2025 21:35
mreed8855 added a commit that referenced this pull request Jul 30, 2025
Creates and SRIOV device in either a virtual machine or container

- Adding a cleanup sriov script to remove virtual adapters after
a test is run

- Add has_sriov manifest entry to enable SR-IOV testing
- Add info/sriov-check_{interface} template test that checks /sys/class/net/{interface}/device/sriov_numvfs
- Update SR-IOV LXD tests to depend on interface-specific SR-IOV capability check
- Only SR-IOV enabled interfaces will run the functional tests
- Only SR-IOV enabled interfaces will run the functional tests
- Add info/sriov-check_{interface} template test that check
  if SR-IOV is enabled for an interface
- Update SR-IOV LXD and LXD_VM tests to depend on
  interface-specific SR-IOV capability check
mreed8855 added a commit that referenced this pull request Jul 31, 2025
-Removed this file as it was mistakely placed here
-Updated for PR changes
-Removed try except block
-Remove unnecessary else statment
-Remove try except block from check_interface_vendor
-Updates to unit tests
-Removed sys.exit from main
-Adding a cleanup sriov script to remove virtual adapters after
a test is run
-Fix black and flake8 formating

- Add has_sriov manifest entry to enable SR-IOV testing
- Only SR-IOV enabled interfaces will run the functional tests
- Add info/sriov-check_{interface} template test that check
  if SR-IOV is enabled for an interface
- Update SR-IOV LXD and LXD_VM tests to depend on
  interface-specific SR-IOV capability check
@mreed8855 mreed8855 removed request for a team July 31, 2025 02:39
@mreed8855
Copy link
Collaborator Author

mreed8855 commented Jul 31, 2025

Passing Results (Garmond)
https://certification.canonical.com/hardware/202211-30884/submission/441222/

Test Skipped for an interface that does not have SR-IOV enabled.
https://certification.canonical.com/hardware/202404-33931/submission/441223/

Test Skipped as SR-IOV is set to false in the manifest entry
https://certification.canonical.com/hardware/202404-33931/submission/441224/

Copy link
Collaborator

@pedro-avalos pedro-avalos left a comment

Choose a reason for hiding this comment

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

Based on the successful tests and the changes made to the script, I think this is good, and can be merged, especially since this PR has been open for a long time now.

@pedro-avalos pedro-avalos merged commit e240d04 into main Aug 1, 2025
57 checks passed
@pedro-avalos pedro-avalos deleted the sriov_update4 branch August 1, 2025 13:53
stanley31huang pushed a commit that referenced this pull request Aug 14, 2025
* SRIOV tests and unit tests

sriov checkbox files

* Updates made to sriov.py and unit tests to increase the coverage

* Updated for black format c heck

* Updates made to address the PR comments

* Updated unit tests
Moved the checkbox jobs to networking

* Moved job file to networking

* Fixed black formatting

* Fix black formatting

* Fixed additional fomatting issues

* Removed this file as it was mistakely placed here

* Fixed black formatting again!

* Updated for PR changes

* removed try except block

* Fix flake8 issue
Remove unnecessary else statment

* Black formatting issue

* flake8 issue

* flake 8 issue

* Remove try except block from check_interface_vendor

* Updates to unit tests

* black formating fix

* Removed line for python 3.5

* Changes made to comply with Python 3.5

* pythong 3.5 issue

* python 3.5 issue

* Removed sys.exit from main

* Adding a cleanup sriov script to remove virtual adapters after
a test is run

* Fix black and flake8 formating

* Fix black formatting

* - Add has_sriov manifest entry to enable SR-IOV testing
- Only SR-IOV enabled interfaces will run the functional tests
- Add info/sriov-check_{interface} template test that check
  if SR-IOV is enabled for an interface
- Update SR-IOV LXD and LXD_VM tests to depend on
  interface-specific SR-IOV capability check
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.

2 participants