SFLOW-1: packet count calculation fix for CISCO
Summary of Changes
Hello @suredhar, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request refines the sFlow test suite by introducing vendor-specific handling for packet sampling rates, particularly for Cisco devices. The changes ensure that the calculation of expected sFlow samples is accurate based on the device's vendor, thereby improving the reliability of sFlow test validations and addressing potential discrepancies in packet count reporting.
Highlights
-
New Constant for Cisco Sampling Rate: A new constant,
ciscominSamplingRate, has been introduced with a value of 262144, specifically for Cisco devices. -
DUT Object Propagation: The
dut(Device Under Test) object is now passed as an argument throughtestFlowFixedtoprocessCaptureand subsequently tovalidatePacketsfunctions. -
Vendor-Specific Sampling Rate Logic: The
validatePacketsfunction now includes conditional logic to applyciscominSamplingRatefor Cisco devices when calculating the expected number of sFlow samples, ensuring accurate packet count validation.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
[^1]: Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.
Pull Request Functional Test Report for #4777 / 9ac601517d7925402f57184df233831c585d2c2b
Virtual Devices
| Device | Test | Test Documentation | Job | Raw Log |
|---|---|---|---|---|
| Arista cEOS | SFLOW-1: sFlow Configuration and Sampling |
774aab4a | Log | |
| Cisco 8000E | SFLOW-1: sFlow Configuration and Sampling |
b12b73ef | Log | |
| Cisco XRd | SFLOW-1: sFlow Configuration and Sampling |
90c4f2bb | Log | |
| Juniper ncPTX | SFLOW-1: sFlow Configuration and Sampling |
fbb68c15 | Log | |
| Nokia SR Linux | SFLOW-1: sFlow Configuration and Sampling |
1099a2bc | Log | |
| Openconfig Lemming | SFLOW-1: sFlow Configuration and Sampling |
e6cef280 | Log |
Hardware Devices
| Device | Test | Test Documentation | Raw Log |
|---|---|---|---|
| Arista 7808 | SFLOW-1: sFlow Configuration and Sampling |
||
| Cisco 8808 | SFLOW-1: sFlow Configuration and Sampling |
||
| Juniper PTX10008 | SFLOW-1: sFlow Configuration and Sampling |
||
| Nokia 7250 IXR-10e | SFLOW-1: sFlow Configuration and Sampling |
Pull Request Test Coverage Report for Build 19295560773
Warning: This coverage report may be inaccurate.
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
- For more information on this, see Tracking coverage changes with pull request builds.
- To avoid this issue with future PRs, see these Recommended CI Configurations.
- For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
Details
- 0 of 0 changed or added relevant lines in 0 files are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage remained the same at 10.413%
| Totals | |
|---|---|
| Change from base Build 19289044154: | 0.0% |
| Covered Lines: | 2224 |
| Relevant Lines: | 21358 |
💛 - Coveralls
/fptest virtual
Please address comments and run gofmt on the code to fix the static analysis check
Also, do you expect this to pass on Cisco 8000e or xRD (container images running on KNE topology)? This PR shows it is failing.