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

Snc 39010 interface enhancement port group speed error handling #487

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

Conversation

awhaley-dell
Copy link
Collaborator

SUMMARY

Adding port-group validation before configuring speeds to better report incorrect configurations and communicate the features limitations.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

interfaces

OUTPUT
Passed positive and negative tests scenarios:
- Allowed a valid speed to be set for a default port-group speed (no change in speed)
- Allowed all valid speed options to be set for a non-default port-group speed (10G and 1G in the non-default 10G port-group setting)
- Correctly failed and reported error when a playbook attempted to set invalid speeds for a default port-group (any speed except the port-group speed)
- Correctly failed and reported error when a playbook attempted to set invalid speeds for a non-default port-group (any speed outside of 10G or 1G in the non-default 10G port-group setting)

interface_invalid_speed_change_default_port-group.log
interface_invalid_speed_change_non-default_port-group.log
interface_valid_speed_change_default_port-group.log
interface_valid_speed_change_non-default_port-group.log

Unit test controller with Python 3.12
============================= test session starts ==============================
platform linux -- Python 3.12.2, pytest-8.1.1, pluggy-1.4.0
rootdir: /root/ansible_collections/dellemc/enterprise_sonic
configfile: ../../../ansible/test/lib/ansible_test/_data/pytest/config/default.ini
plugins: xdist-3.5.0, mock-3.14.0
created: 4/4 workers
4 workers [424 items]

........................................................................ [ 16%]
........................................................................ [ 33%]
........................................................................ [ 50%]
........................................................................ [ 67%]
........................................................................ [ 84%]
................................................................         [100%]
- generated xml file: /root/ansible_collections/dellemc/enterprise_sonic/tests/output/junit/python3.12-controller-units.xml -
============================= 424 passed in 52.27s =============================
ADDITIONAL INFORMATION

Added helper functions in interfaces_util to pre-check valid speeds and enhance error reporting for a given interface.
Valid speed configurations are allowed and invalid speed configurations throw errors detailing port-group rules and showing valid speeds vs what was given.

**Configure interface parameter with an invalid speed on a default port-group**
    "msg": "If the port-group is in the default speed you will be unable to set a member interface to a non-default speed. Please use the port-group module to change the port-group of the member interface's speed before changing the interface's port speed. Valid speeds for Eth1/5 are currently [25000]"

Note: Final error message may change slightly for clarity from review feedback.

Checklist:
  • I have performed a self-review of my own code to ensure there are no formatting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have maintained backward compatibility or have provided any relevant "breaking_changes" descriptions in a "fragment" file in the "changelogs/fragments" directory of this repository.
  • I have provided a summary for this PR in valid "fragment" file format in the "changelogs/fragments" directory of this repository branch. Reference : Ansible Change Log Document
How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Test valid configuration of a member of a port-group in a default state

  • Test invalid configuration of a member of a port-group in a default state

  • Test valid configuration of a member of a port-group in a non-default state

  • Test invalid configuration of a member of a port-group in a non-default state

Austin Whaley added 3 commits November 26, 2024 19:06
…rface in a port-group fails to have its speed configured correctly
… tables, and adding a valid speed check helper function
@awhaley-dell awhaley-dell added the enhancement New feature or request label Nov 27, 2024
@awhaley-dell awhaley-dell added this to the v3.1.0 milestone Nov 27, 2024
@awhaley-dell awhaley-dell self-assigned this Nov 27, 2024
@awhaley-dell awhaley-dell marked this pull request as draft November 27, 2024 00:18
@awhaley-dell awhaley-dell marked this pull request as ready for review December 2, 2024 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants