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

Feat(eos_validate_state): Added the validation for STUN client configurations #3898

Merged
merged 12 commits into from
Jun 7, 2024

Conversation

MaheshGSLAB
Copy link
Contributor

Change Summary

Added the validation for STUN client configuration.

Related Issue(s)

Fixes #3889

Component(s) name

arista.avd.eos_validate_state

Proposed changes

We have the ANTA testcase ready for validate the STUN client configuration hence added the support in AVD. Right now it will collect the all the local interfaces from path group where stun server profiles are attached. Source port is 4500(default) for now.

anta.tests.stun:
- VerifyStunClient:
    result_overwrite:
      custom_field: 'source address: 172.18.3.2 source port: 4500'
    stun_clients:
    - source_address: 172.18.3.2
      source_port: 4500
- VerifyStunClient:
    result_overwrite:
      custom_field: 'source address: 100.64.3.2 source port: 4500'
    stun_clients:
    - source_address: 100.64.3.2
      source_port: 4500

How to test

Run the molecule or test it on lab with eos_validate_state in playbook.
Note: Need ANTA==0.14.0 to test this.

Checklist

User Checklist

  • N/A

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

@github-actions github-actions bot added role: eos_validate_state state: CI Updated CI scenario have been updated in the PR labels Apr 24, 2024
@github-actions github-actions bot added the state: conflict PR with conflict label Apr 24, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@MaheshGSLAB MaheshGSLAB marked this pull request as ready for review April 25, 2024 07:23
@MaheshGSLAB MaheshGSLAB requested review from a team as code owners April 25, 2024 07:23
Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

Comment on lines 38 to 43
stun_interfaces = [
local_interfaces.get("name")
for path_group in path_groups
for local_interfaces in path_group.get("local_interfaces")
if get(local_interfaces, "stun.server_profiles") is not None
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be helpful to take a look at the mixin classes under plugin_utils/eos_validate_state_utils. There are validations methods you can use to make sure the data is present and logs accordingly.

LOGGER.info("No local interface found with STUN configuration. %s is skipped.", self.__class__.__name__)
return None

# Generate the ANTA tests for each interface with STUN configuration
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Generate the ANTA tests for each interface with STUN configuration
# Generate the ANTA tests for each identified local interface.

@MaheshGSLAB MaheshGSLAB requested a review from gmuloc May 16, 2024 11:27
@MaheshGSLAB MaheshGSLAB requested a review from gmuloc May 27, 2024 09:15
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

1 similar comment
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the state: conflict PR with conflict label May 31, 2024
@github-actions github-actions bot removed the state: conflict PR with conflict label Jun 3, 2024
Copy link

github-actions bot commented Jun 3, 2024

Conflicts have been resolved. A maintainer will review the pull request shortly.

Copy link

sonarcloud bot commented Jun 5, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@gmuloc gmuloc added one approval This PR has one approval and is only missing one more. EPIC - eos_validate_state ANTA labels Jun 5, 2024
Copy link
Contributor

@carl-baillargeon carl-baillargeon left a comment

Choose a reason for hiding this comment

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

LGTM

@gmuloc gmuloc merged commit 7b19bd6 into aristanetworks:devel Jun 7, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat(eos_validate_state): Add validation for STUN client
3 participants