Skip to content

Added: ansible/roles/sonicv2#2

Merged
tombo315 merged 1 commit intosonic-net:masterfrom
johnarnold:sonicv2
Aug 29, 2016
Merged

Added: ansible/roles/sonicv2#2
tombo315 merged 1 commit intosonic-net:masterfrom
johnarnold:sonicv2

Conversation

@johnarnold
Copy link
Copy Markdown
Contributor

This is the initial commit for the sonicv2 role.

@tombo315 tombo315 merged commit 826ed2d into sonic-net:master Aug 29, 2016
engdorm added a commit to engdorm/sonic-mgmt that referenced this pull request Feb 21, 2017
oleksandrivantsiv added a commit to oleksandrivantsiv/sonic-mgmt that referenced this pull request Mar 1, 2017
Add implementation of testcase sonic-net#2-8.
marian-pritsak pushed a commit that referenced this pull request Mar 14, 2017
Add implementation of everflow config and login tests.
Everflow testbed test implementation.
Add implementation of testcase #1 Resolved route.
Everflow testbed test implementation.
Add implementation of testcase #2-8.
oleksandrivantsiv pushed a commit that referenced this pull request Mar 20, 2017
* decap test v1

* decap test added

* checkout on fib_test

* restoring ACL test

* fixes

* fix #2

* removed decap configuration in the test

* added tcp port fields to simple_tcp_packet

* removed some vars
lguohan pushed a commit that referenced this pull request Aug 3, 2017
Add implementation of everflow config and login tests.
Everflow testbed test implementation.
Add implementation of testcase #1 Resolved route.
Everflow testbed test implementation.
Add implementation of testcase #2-8.
lguohan pushed a commit that referenced this pull request Aug 3, 2017
* decap test v1

* decap test added

* checkout on fib_test

* restoring ACL test

* fixes

* fix #2

* removed decap configuration in the test

* added tcp port fields to simple_tcp_packet

* removed some vars
lguohan pushed a commit that referenced this pull request Feb 15, 2018
stepanblyschak referenced this pull request in stepanblyschak/sonic-mgmt Jun 14, 2019
Signed-off-by: Roman Kachur <[email protected]>
praveen-li pushed a commit to praveen-li/sonic-mgmt that referenced this pull request Jun 20, 2019
* msft_github/master: (111 commits)
  add disconnect/connect vm to testbed-cli.sh (sonic-net#566)
  [dhcp_relay] Increase sleep duration to allow LAG and BGP to come up (sonic-net#565)
  [pfcwd]: support t0-116 and clean up the code (sonic-net#563)
  [fanout]: remove vrf management in arista fanout deploy templates (sonic-net#562)
  [fanout-switch-deploy] Support multiple speeds and port breakout (sonic-net#561)
  [extract_log] Improve extract_log script (sonic-net#559)
  Disable upgrade_sonic retry (sonic-net#560)
  Support for Sonic fanout (sonic-net#555)
  [Fanout deploy template] enable root user on fanout switches (sonic-net#557)
  [link state] match exact dut name in the link list (sonic-net#556)
  [pfcwd]: cache the ansible facts (sonic-net#554)
  Fix kernel version check (sonic-net#553)
  [pfcwd]: increase the pause waiting time and ingore snmp errors (sonic-net#551)
  fix typo (sonic-net#552)
  [dir_bcast] enable dir_bcast test on t0-116 topology (sonic-net#550)
  use command to gather host distribution, kernel version facts (sonic-net#549)
  [minigraph templte] use consistent VLAN subnet (sonic-net#546)
  [VM config] skip podset 0 tor 0 routing entry (sonic-net#545)
  Remove job minigraph_facts from boot_onie (sonic-net#548)
  [fast-reboot] pass VM IP in as ASCII strings (sonic-net#547)
  [fast-reboot test] fix syslog reading issue (sonic-net#543)
  add dataacl to minigraph template (sonic-net#544)
  [service_acl] Make test reliable when testing Arista service ACL solution (sonic-net#542)
  [pfcwd]: Iterate functional test over all ports (sonic-net#490)
  [service_acl] Detect expected output message even if it is followed by other text (sonic-net#541)
  [testbed]: Remove connection local for port_alias module (sonic-net#540)
  Revert "[minigraph-gen] fix AclInterface entries in minigraph (sonic-net#538)" (sonic-net#539)
  [minigraph-gen] fix AclInterface entries in minigraph (sonic-net#538)
  add retries in onie installation (sonic-net#537)
  Use connection plugin to install sonic image in ONIE. (sonic-net#536)
  [dhcp_relay]: Add --relax flag to ptf command (sonic-net#535)
  [minigraph_facts] use minigraph on DUT (sonic-net#534)
  Fix minigraph_facts: mkdir recursively (sonic-net#533)
  [minigraph_facts] use mingraph on DUT to test (sonic-net#532)
  generate minigraph based on topology file (sonic-net#531)
  Need to double-escape when using 'args' syntax (sonic-net#529)
  Fix improper 'local_action' syntax (sonic-net#528)
  Unify style of 'wait_for' actions across playbooks (sonic-net#527)
  [minigraph_facts] retrieving dhcp server list from vlan configuration instead of DhcpResources (sonic-net#526)
  [snmp_facts] increase get command timeout to fix cpu test failure (sonic-net#525)
  [everflow_test]: Add copy ptftests folder to use the remote.py file (sonic-net#522)
  Fix snmp_facts on PSU oid (sonic-net#520)
  Fix snmp queue test (sonic-net#519)
  [lag_test]: Remove the unnecessary testbed_type check (sonic-net#518)
  [ip_decap_test]: Support t0-64 topology (sonic-net#517)
  [acl_test]: Copy ptftests folder for the remote.py file (sonic-net#516)
  Add test case for PSU (sonic-net#514)
  [mtu]: Add t1-64-lag topology support for MTU test (sonic-net#513)
  [ip_decap]: Add t1-64-lag support in the script for the list of source port (sonic-net#512)
  [everflow]: Add missing spaces in ptf command (sonic-net#511)
  [acl_test]: Add ptf_platform_dir: ptftests to use customized platform code to support 64 ports (sonic-net#510)
  [crm]: Implement test for CRM (sonic-net#473)
  [everflow]: Add support for t1-64-lag topology (sonic-net#502)
  Fix sonic_image_version: get from sonic_version.yml, no dependency on grub (sonic-net#508)
  [topology]: Update t1-64-lag topology template to add AclInterfaces piece (sonic-net#505)
  Pull syncd-rpc with sonic version tag (sonic-net#507)
  Remove leading and trailing whitespaces when reading veos file (sonic-net#506)
  [lag_2] remove hard coded interval_count so it can be set by test (sonic-net#503)
  ptf_runner: Add one line comment for ptf_platform_dir (sonic-net#501)
  [testbed]: add port speed and fec configuration in sonic fanout (sonic-net#498)
  [typo]: Replace string t1-lag-64 with t1-64-lag (sonic-net#499)
  Adding sensor data for S6100 (sonic-net#496)
  [fib_test]: Add t1-64-lag src_ports in FIB test (sonic-net#497)
  Fix typo in acl test case name (sonic-net#494)
  Add one more Mellanox SKU string in everflow_tb_test script (sonic-net#495)
  Adding sensor data for Z9100 (sonic-net#492)
  [service_acl] Make test more robust and efficient (sonic-net#489)
  [dhcp relay test] adding more test scenarios (sonic-net#440)
  fix sanity check failed to recover (sonic-net#488)
  Fix PFC_WD test (sonic-net#479)
  add sonic fanout support (sonic-net#485)
  Update README.test.md
  Update README.test.md
  Fix table caption in testbed.csv and documentation (sonic-net#482)
  [test case] Add test: restart swss service (sonic-net#483)
  Add test case port toggle (sonic-net#484)
  [test infrastructure] allow overriding recover system actioin (sonic-net#480)
  [SNMP]add new SNMP counters tests to snmp.yml (sonic-net#477)
  add t0-52 topology (sonic-net#476)
  add command line option for creategraph.py (sonic-net#475)
  Add support for additional timestamp format (sonic-net#474)
  Ignore ansible output in extract_log (sonic-net#472)
  Add extract_logs action to concatenate logs after log rotate (sonic-net#471)
  Add ACL ICMP test (sonic-net#2) (sonic-net#465)
  [pfcwd]:add docker exec to avoid tty error (sonic-net#470)
  [test_tag]remove pfc_wd test tag from test by tag main yaml (sonic-net#469)
  [ansible]gather fact by default (sonic-net#468)
  [sensors]fix Dell S6000 sensors test fail (sonic-net#462)
  [vlan]improve test to wait a bit longer for config reload (sonic-net#463)
  one more place for hwsku of new Mellanox 2700 (sonic-net#464)
  [sensors]sensors test add new hwsku for Mellanox 2700 (sonic-net#461)
  [PFCWD]: test enhancement (sonic-net#456)
  [sensors] remove redundant sensor data definitin for sku MSN2100 (sonic-net#460)
  when call testcase by name, fetch all vms management info from testbed_facts (sonic-net#457)
  [acl test] error in ACL rule json file for destination ip (sonic-net#434)
  [sensor data] add sensor data for Mellanox MSN2410 and MSN2100 (sonic-net#449)
  Fix sku-sensors-data for 7050-QX32 (sonic-net#454)
  [deploy minigraph]add default enable BGP to deploy minigraph step (sonic-net#455)
  [upgrade]save bgp UP state after they are brough up (sonic-net#453)
  [reboot test] call sudo reboot to reboot dut (sonic-net#452)
  ...
mudsut4ke pushed a commit to mudsut4ke/sonic-mgmt that referenced this pull request Jun 14, 2021
@prgeor prgeor mentioned this pull request Sep 1, 2021
4 tasks
lolyu referenced this pull request in lolyu/sonic-mgmt Oct 19, 2022
Onboard - Nokia chassis #2, with 100G links with t2 min topology.
lolyu referenced this pull request in lolyu/sonic-mgmt Oct 19, 2022
- Add device and connection info to inventory/graph files
- Create testbed and allocate VMs and PTF IPs
- Modify 'available_vmset_finder' script to account for more topology types

Note: Actual topology file has been created in public repo
mssonicbld referenced this pull request in mssonicbld/sonic-mgmt May 18, 2023
mssonicbld referenced this pull request in mssonicbld/sonic-mgmt May 18, 2023
mssonicbld referenced this pull request in mssonicbld/sonic-mgmt May 18, 2023
@harsgoll harsgoll mentioned this pull request Aug 21, 2023
6 tasks
@wenyiz2021 wenyiz2021 mentioned this pull request Oct 2, 2023
6 tasks
yejianquan added a commit to yejianquan/sonic-mgmt that referenced this pull request Jan 17, 2025
[Snappi] Infra changes for new PFC-ECN testcases. (sonic-net#13864)

Description of PR
67989d1312b1778681d6575b12b66aa42fdf05a7

Please review the commit-ID given above.

Original PR13655 was raised to add the new testcases. However, manage the changes efficiently, it was decided to split the original into three PRs for ease in review process.

This PR tracks are the infrastructure related changes required for the execution of the testcases.

Note - PR sonic-net#13848 needs to be merged in first before this PR is merged.

Summary: Fixes # (issue) sonic-net#13655 sonic-net#13215

Approach
What is the motivation for this PR?
This PR tracks only the infrastructure related changes needed for addition of the new testcases.

How did you do it?
Important changes are listed below:

Change directory - tests/common/snappi_tests/

Additional member variable 'base_flow_config_list' is added as list to class 'SnappiTestParams' in snappi_test_params.py file to accommodate for multiple base-flow-configs.
Existing functions - generate_test_flows, generate_background_flows, generate_pause_flows are modified to check if the base_flow_config_list exists. If it does, then base_flow_config is assigned snappi_extra_params.base_flow_config_list[flow_index]. Else existing code is used.
Existing function - 'verify_egress_queue_frame_count' is modified to check if base_flow_config_list exists. If yes, base_flow_config_list[0] is assigned to dut_port_config, else existing code is used.
The testcases calls 'run_traffic_and_collect_stats' function in traffic_generation file to run and gather IXIA+DUT statistics. Statistics are summarized in test_stats dictionary in return.
A function has been created to access the IXIA rest_py framework. This will in turn can be used to integrate MACSEC related changes in future. Currently, rest_py is used to generate the imix custom profile if the flag is set in the test_def dictionary (defined and passed by the test).
Depending upon the test_duration and test_interval defined in test_def of the test, the test-case will be executed.
At every test_interval, the statistics from IXIA and DUT are pulled in form of dictionary, where date-timestamp is primary key.
Important parameters from IXIA like Tx and Rx throughput, number of packets, latency etc are captured with each interval.

From DUT side, the Rx and Tx packets, loss packets (combination of failures, drops and errors), PFC count, queue counts are captured. Additional functions like - get_pfc_count, get_ingerface_stats etc are defined in the common/snappi_test helper files to assist with the same. The support for the above is added as part of the different pull-request.

At the end of the test, a CSV is created as raw data for the test-case execution. Summary of the test-case is generated in form of text file with same name. The run_sys_test also returns a dictionary test_stats with all the important parameters to be used for the verification of the test.
How did you verify/test it?
Test was executed on the local clone.

Any platform specific information?
These testcases are specifically meant for Broadcom-DNX multi-ASIC based platforms.

co-authorized by: [email protected]
XuChen-MSFT added a commit to XuChen-MSFT/sonic-mgmt that referenced this pull request Feb 7, 2025
sonic-net#1 Deprecated dynamic subclass instantiation based on attributes implement in find_subclass().
Switched to static lookup table to avoid syntax errors in one platform affecting others.

Signed-off-by: Xu Chen <[email protected]>
sonic-net#2 remove QosHelper() class, since not observe benefit for this abstraction
vkjammala-arista added a commit to vkjammala-arista/sonic-mgmt that referenced this pull request Jan 30, 2026
…kets not received on collector interface

Issue sonic-net#1:
In some cases (like sflow config enabled for first time, device reboot),
hsflowd daemon is taking little over 3 mins to be fully initialized and
process collector config. During this window, hsflowd service won't send
sflow packets ('CounterSample', 'FlowSample' etc) to collector interface
and thus test can fail with i) "Packets are not received in active
collector, collector\d+" and ii) "Expected Number of samples are not
collected from Interface Ethernet\d+ in collector collector\d+ , Received \d+"

hsflowd service is writing to "/etc/hsflowd.auto" once it's processed
collector configuration. Thus waiting for collector info to be present in
"/etc/hsflowd.auto" seems to be safe option before proceeding with
sflow traffic verfication.

Issue sonic-net#2:
If the test expects flow samples/packets on the collector interface but they aren't
seen for some reason, then we are hitting "KeyError: 'flow_port_count'". Due to
counter samples seen on collector interface, "data['total_samples']" will not be
zero but "data['total_flow_count']" will be 0 and lead to KeyError when tried to
access "data['flow_port_count']". Fix is to have assert on "total_flow_count" and
"total_counter_count" before calling corresponding sample analyze functions.

Signed-off-by: Vinod <[email protected]>
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…onic-net#11684)

The follwing commit is added in sonic-utilities
b034f0c (HEAD -> 202012, origin/202012) [config][muxcable] add support
to enable/disable ycable telemetry (sonic-net#2… (sonic-net#2304)

The follwing commit is added in sonic-platform-daemons
978667c (HEAD -> 202012, origin/202012) [ycabled] add capability to
enable/disable telemetry (sonic-net#279) (sonic-net#280

Signed-off-by: vaibhav-dahiya <[email protected]>

Signed-off-by: vaibhav-dahiya <[email protected]>
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
- Includes the following commits:
    - [bcmshell.py] Match extra whitespace before prompt in regex (sonic-net#3)
    - add support for qsfp28 eeprom (sonic-net#2)
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…et#21405)

<!--
 Please make sure you've read and understood our contributing guidelines:
 https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

 failure_prs.log skip_prs.log Make sure all your commits include a signature generated with `git commit -s` **

 If this is a bug fix, make sure your description includes "fixes #xxxx", or
 "closes #xxxx" or "resolves #xxxx"

 Please provide the following information:
-->

#### Why I did it

Adding the below fix from FRR FRRouting/frr#17297

This is to fix the following crash which is a statistical issue

```
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M dplane_fpm_nl -M snmp'.
Program terminated with signal SIGABRT, Aborted.
#0 0x00007fccd7351e2c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
[Current thread is 1 (Thread 0x7fccd6faf7c0 (LWP 36))]
(gdb) bt
#0 0x00007fccd7351e2c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
sonic-net#1 0x00007fccd7302fb2 in raise () from /lib/x86_64-linux-gnu/libc.so.6
sonic-net#2 0x00007fccd72ed472 in abort () from /lib/x86_64-linux-gnu/libc.so.6
sonic-net#3 0x00007fccd75bb3a9 in _zlog_assert_failed (xref=xref@entry=0x7fccd7652380 <_xref.16>, extra=extra@entry=0x0) at ../lib/zlog.c:678
sonic-net#4 0x00007fccd759b2fe in route_node_delete (node=<optimized out>) at ../lib/table.c:352
sonic-net#5 0x00007fccd759b445 in route_unlock_node (node=0x0) at ../lib/table.h:258
sonic-net#6 route_next (node=<optimized out>) at ../lib/table.c:436
sonic-net#7 route_next (node=node@entry=0x56029d89e560) at ../lib/table.c:410
sonic-net#8 0x000056029b6b6b7a in if_lookup_by_name_per_ns (ns=ns@entry=0x56029d873d90, ifname=ifname@entry=0x7fccc0029340 "PortChannel1020")
 at ../zebra/interface.c:312
sonic-net#9 0x000056029b6b8b36 in zebra_if_dplane_ifp_handling (ctx=0x7fccc0029310) at ../zebra/interface.c:1867
sonic-net#10 zebra_if_dplane_result (ctx=0x7fccc0029310) at ../zebra/interface.c:2221
sonic-net#11 0x000056029b7137a9 in rib_process_dplane_results (thread=<optimized out>) at ../zebra/zebra_rib.c:4810
sonic-net#12 0x00007fccd75a0e0d in thread_call (thread=thread@entry=0x7ffe8e553cc0) at ../lib/thread.c:1990
sonic-net#13 0x00007fccd7559368 in frr_run (master=0x56029d65a040) at ../lib/libfrr.c:1198
sonic-net#14 0x000056029b6ac317 in main (argc=9, argv=0x7ffe8e5540d8) at ../zebra/main.c:478
```

##### Work item tracking
- Microsoft ADO **(number only)**:

#### How I did it
Added patch.

#### How to verify it
Running BGP tests.

<!--
If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012.
-->

#### Which release branch to backport (provide reason below if selected)

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205
- [ ] 202211
- [ ] 202305

#### Tested branch (Please provide the tested image version)

<!--
- Please provide tested image version
- e.g.
- [x] 20201231.100
-->

- [ ] <!-- image version 1 -->
- [ ] <!-- image version 2 -->

#### Description for the changelog
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->

<!--
 Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
-->

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->

#### A picture of a cute animal (not mandatory but encouraged)
vkjammala-arista added a commit to vkjammala-arista/sonic-mgmt that referenced this pull request Mar 5, 2026
…kets not received on collector interface

Issue sonic-net#1:
In some cases (like sflow config enabled for first time, device reboot),
hsflowd daemon is taking little over 3 mins to be fully initialized and
process collector config. During this window, hsflowd service won't send
sflow packets ('CounterSample', 'FlowSample' etc) to collector interface
and thus test can fail with i) "Packets are not received in active
collector, collector\d+" and ii) "Expected Number of samples are not
collected from Interface Ethernet\d+ in collector collector\d+ , Received \d+"

hsflowd service is writing to "/etc/hsflowd.auto" once it's processed
collector configuration. Thus waiting for collector info to be present in
"/etc/hsflowd.auto" seems to be safe option before proceeding with
sflow traffic verfication.

Issue sonic-net#2:
If the test expects flow samples/packets on the collector interface but they aren't
seen for some reason, then we are hitting "KeyError: 'flow_port_count'". Due to
counter samples seen on collector interface, "data['total_samples']" will not be
zero but "data['total_flow_count']" will be 0 and lead to KeyError when tried to
access "data['flow_port_count']". Fix is to have assert on "total_flow_count" and
"total_counter_count" before calling corresponding sample analyze functions.

Signed-off-by: Vinod <[email protected]>
wangxin added a commit to wangxin/sonic-mgmt that referenced this pull request Mar 9, 2026
Fix three issues raised in code review:

Issue sonic-net#2 - ceos_effective_image undefined in ceos_ensure_reachable.yml:
Add a defensive set_fact at the top of ceos_ensure_reachable.yml that
sets ceos_effective_image to ceos_image as a fallback, guarded by
'when: ceos_effective_image is not defined'. In the normal flow the
variable is already set by the caller (ceos.yml in the eos role) so
this task is a no-op. It prevents an undefined variable error if the
file is ever invoked independently.

Issue sonic-net#3 - ceos_image_found stored as string instead of boolean:
The set_fact used a >- block scalar which causes Jinja2 to produce the
string 'True'/'False'. In Ansible the string 'False' is truthy, so
'when: not ceos_image_found' would never enter the prepare block when
the image is absent. Fixed by collapsing to a single quoted expression
and appending '| bool' to ensure Python boolean storage.

Issue sonic-net#5 - registry pull failure silently ignored:
Added a debug task immediately after the pull task that emits a WARNING
message when ceos_registry_pull_result is failed. Users can now see in
the Ansible output why the fallback to download-and-build was triggered.

Signed-off-by: Xin Wang <[email protected]>
Co-authored-by: Copilot <[email protected]>
vkjammala-arista added a commit to vkjammala-arista/sonic-mgmt that referenced this pull request Mar 20, 2026
…kets not received on collector interface

Issue sonic-net#1:
In some cases (like sflow config enabled for first time, device reboot),
hsflowd daemon is taking little over 3 mins to be fully initialized and
process collector config. During this window, hsflowd service won't send
sflow packets ('CounterSample', 'FlowSample' etc) to collector interface
and thus test can fail with i) "Packets are not received in active
collector, collector\d+" and ii) "Expected Number of samples are not
collected from Interface Ethernet\d+ in collector collector\d+ , Received \d+"

hsflowd service is writing to "/etc/hsflowd.auto" once it's processed
collector configuration. Thus waiting for collector info to be present in
"/etc/hsflowd.auto" seems to be safe option before proceeding with
sflow traffic verfication.

Issue sonic-net#2:
If the test expects flow samples/packets on the collector interface but they aren't
seen for some reason, then we are hitting "KeyError: 'flow_port_count'". Due to
counter samples seen on collector interface, "data['total_samples']" will not be
zero but "data['total_flow_count']" will be 0 and lead to KeyError when tried to
access "data['flow_port_count']". Fix is to have assert on "total_flow_count" and
"total_counter_count" before calling corresponding sample analyze functions.

Signed-off-by: Vinod <[email protected]>
vkjammala-arista added a commit to vkjammala-arista/sonic-mgmt that referenced this pull request Mar 20, 2026
…kets not received on collector interface

Issue sonic-net#1:
In some cases (like sflow config enabled for first time, device reboot),
hsflowd daemon is taking little over 3 mins to be fully initialized and
process collector config. During this window, hsflowd service won't send
sflow packets ('CounterSample', 'FlowSample' etc) to collector interface
and thus test can fail with i) "Packets are not received in active
collector, collector\d+" and ii) "Expected Number of samples are not
collected from Interface Ethernet\d+ in collector collector\d+ , Received \d+"

hsflowd service is writing to "/etc/hsflowd.auto" once it's processed
collector configuration. Thus waiting for collector info to be present in
"/etc/hsflowd.auto" seems to be safe option before proceeding with
sflow traffic verfication.

Issue sonic-net#2:
If the test expects flow samples/packets on the collector interface but they aren't
seen for some reason, then we are hitting "KeyError: 'flow_port_count'". Due to
counter samples seen on collector interface, "data['total_samples']" will not be
zero but "data['total_flow_count']" will be 0 and lead to KeyError when tried to
access "data['flow_port_count']". Fix is to have assert on "total_flow_count" and
"total_counter_count" before calling corresponding sample analyze functions.

Signed-off-by: Vinod <[email protected]>
StormLiangMS pushed a commit that referenced this pull request Mar 26, 2026
…kets not received on collector interface (#22186)

* [sonic-mgmt] Fix sflow/test_sflow.py failures with expected sflow packets not received on collector interface

Issue #1:
In some cases (like sflow config enabled for first time, device reboot),
hsflowd daemon is taking little over 3 mins to be fully initialized and
process collector config. During this window, hsflowd service won't send
sflow packets ('CounterSample', 'FlowSample' etc) to collector interface
and thus test can fail with i) "Packets are not received in active
collector, collector\d+" and ii) "Expected Number of samples are not
collected from Interface Ethernet\d+ in collector collector\d+ , Received \d+"

hsflowd service is writing to "/etc/hsflowd.auto" once it's processed
collector configuration. Thus waiting for collector info to be present in
"/etc/hsflowd.auto" seems to be safe option before proceeding with
sflow traffic verfication.

Issue #2:
If the test expects flow samples/packets on the collector interface but they aren't
seen for some reason, then we are hitting "KeyError: 'flow_port_count'". Due to
counter samples seen on collector interface, "data['total_samples']" will not be
zero but "data['total_flow_count']" will be 0 and lead to KeyError when tried to
access "data['flow_port_count']". Fix is to have assert on "total_flow_count" and
"total_counter_count" before calling corresponding sample analyze functions.

Signed-off-by: Vinod <[email protected]>

* Addressing review comments

1) Enhanced "wait_until_hsflowd_ready" to make it wait for all the
   collector IPs (instead of calling it sequentially for each IP)
2) Add docstring for "wait_until_hsflowd_ready" function
3) Updated "ast.literal_eval" usage to handle the case where
   "active_collectors" is passed as empty string ("" instead of "[]")

Signed-off-by: Vinod <[email protected]>

* Fix pre-commit check failures

Signed-off-by: Vinod <[email protected]>

* Revert PR#21674 partially to enable "sflow/test_sflow.py" test

Signed-off-by: Vinod <[email protected]>

---------

Signed-off-by: Vinod <[email protected]>
mssonicbld added a commit that referenced this pull request Mar 26, 2026
…kets not received on collector interface (#22186) (#23335)

* [sonic-mgmt] Fix sflow/test_sflow.py failures with expected sflow packets not received on collector interface

Issue #1:
In some cases (like sflow config enabled for first time, device reboot),
hsflowd daemon is taking little over 3 mins to be fully initialized and
process collector config. During this window, hsflowd service won't send
sflow packets ('CounterSample', 'FlowSample' etc) to collector interface
and thus test can fail with i) "Packets are not received in active
collector, collector\d+" and ii) "Expected Number of samples are not
collected from Interface Ethernet\d+ in collector collector\d+ , Received \d+"

hsflowd service is writing to "/etc/hsflowd.auto" once it's processed
collector configuration. Thus waiting for collector info to be present in
"/etc/hsflowd.auto" seems to be safe option before proceeding with
sflow traffic verfication.

Issue #2:
If the test expects flow samples/packets on the collector interface but they aren't
seen for some reason, then we are hitting "KeyError: 'flow_port_count'". Due to
counter samples seen on collector interface, "data['total_samples']" will not be
zero but "data['total_flow_count']" will be 0 and lead to KeyError when tried to
access "data['flow_port_count']". Fix is to have assert on "total_flow_count" and
"total_counter_count" before calling corresponding sample analyze functions.



* Addressing review comments

1) Enhanced "wait_until_hsflowd_ready" to make it wait for all the
   collector IPs (instead of calling it sequentially for each IP)
2) Add docstring for "wait_until_hsflowd_ready" function
3) Updated "ast.literal_eval" usage to handle the case where
   "active_collectors" is passed as empty string ("" instead of "[]")



* Fix pre-commit check failures



* Revert PR#21674 partially to enable "sflow/test_sflow.py" test



---------

Signed-off-by: Vinod <[email protected]>
Signed-off-by: mssonicbld <[email protected]>
Co-authored-by: vkjammala-arista <[email protected]>
venu-nexthop pushed a commit to nexthop-ai/sonic-mgmt that referenced this pull request Mar 30, 2026
…kets not received on collector interface (sonic-net#22186) (sonic-net#23335)

* [sonic-mgmt] Fix sflow/test_sflow.py failures with expected sflow packets not received on collector interface

Issue #1:
In some cases (like sflow config enabled for first time, device reboot),
hsflowd daemon is taking little over 3 mins to be fully initialized and
process collector config. During this window, hsflowd service won't send
sflow packets ('CounterSample', 'FlowSample' etc) to collector interface
and thus test can fail with i) "Packets are not received in active
collector, collector\d+" and ii) "Expected Number of samples are not
collected from Interface Ethernet\d+ in collector collector\d+ , Received \d+"

hsflowd service is writing to "/etc/hsflowd.auto" once it's processed
collector configuration. Thus waiting for collector info to be present in
"/etc/hsflowd.auto" seems to be safe option before proceeding with
sflow traffic verfication.

Issue sonic-net#2:
If the test expects flow samples/packets on the collector interface but they aren't
seen for some reason, then we are hitting "KeyError: 'flow_port_count'". Due to
counter samples seen on collector interface, "data['total_samples']" will not be
zero but "data['total_flow_count']" will be 0 and lead to KeyError when tried to
access "data['flow_port_count']". Fix is to have assert on "total_flow_count" and
"total_counter_count" before calling corresponding sample analyze functions.



* Addressing review comments

1) Enhanced "wait_until_hsflowd_ready" to make it wait for all the
   collector IPs (instead of calling it sequentially for each IP)
2) Add docstring for "wait_until_hsflowd_ready" function
3) Updated "ast.literal_eval" usage to handle the case where
   "active_collectors" is passed as empty string ("" instead of "[]")



* Fix pre-commit check failures



* Revert PR#21674 partially to enable "sflow/test_sflow.py" test



---------

Signed-off-by: Vinod <[email protected]>
Signed-off-by: mssonicbld <[email protected]>
Co-authored-by: vkjammala-arista <[email protected]>
venu-nexthop pushed a commit to nexthop-ai/sonic-mgmt that referenced this pull request Mar 30, 2026
…kets not received on collector interface (sonic-net#22186) (sonic-net#23335)

* [sonic-mgmt] Fix sflow/test_sflow.py failures with expected sflow packets not received on collector interface

Issue #1:
In some cases (like sflow config enabled for first time, device reboot),
hsflowd daemon is taking little over 3 mins to be fully initialized and
process collector config. During this window, hsflowd service won't send
sflow packets ('CounterSample', 'FlowSample' etc) to collector interface
and thus test can fail with i) "Packets are not received in active
collector, collector\d+" and ii) "Expected Number of samples are not
collected from Interface Ethernet\d+ in collector collector\d+ , Received \d+"

hsflowd service is writing to "/etc/hsflowd.auto" once it's processed
collector configuration. Thus waiting for collector info to be present in
"/etc/hsflowd.auto" seems to be safe option before proceeding with
sflow traffic verfication.

Issue sonic-net#2:
If the test expects flow samples/packets on the collector interface but they aren't
seen for some reason, then we are hitting "KeyError: 'flow_port_count'". Due to
counter samples seen on collector interface, "data['total_samples']" will not be
zero but "data['total_flow_count']" will be 0 and lead to KeyError when tried to
access "data['flow_port_count']". Fix is to have assert on "total_flow_count" and
"total_counter_count" before calling corresponding sample analyze functions.



* Addressing review comments

1) Enhanced "wait_until_hsflowd_ready" to make it wait for all the
   collector IPs (instead of calling it sequentially for each IP)
2) Add docstring for "wait_until_hsflowd_ready" function
3) Updated "ast.literal_eval" usage to handle the case where
   "active_collectors" is passed as empty string ("" instead of "[]")



* Fix pre-commit check failures



* Revert PR#21674 partially to enable "sflow/test_sflow.py" test



---------

Signed-off-by: Vinod <[email protected]>
Signed-off-by: mssonicbld <[email protected]>
Co-authored-by: vkjammala-arista <[email protected]>
albertovillarreal-keys pushed a commit to albertovillarreal-keys/sonic-mgmt that referenced this pull request Apr 3, 2026
…kets not received on collector interface (sonic-net#22186)

* [sonic-mgmt] Fix sflow/test_sflow.py failures with expected sflow packets not received on collector interface

Issue #1:
In some cases (like sflow config enabled for first time, device reboot),
hsflowd daemon is taking little over 3 mins to be fully initialized and
process collector config. During this window, hsflowd service won't send
sflow packets ('CounterSample', 'FlowSample' etc) to collector interface
and thus test can fail with i) "Packets are not received in active
collector, collector\d+" and ii) "Expected Number of samples are not
collected from Interface Ethernet\d+ in collector collector\d+ , Received \d+"

hsflowd service is writing to "/etc/hsflowd.auto" once it's processed
collector configuration. Thus waiting for collector info to be present in
"/etc/hsflowd.auto" seems to be safe option before proceeding with
sflow traffic verfication.

Issue sonic-net#2:
If the test expects flow samples/packets on the collector interface but they aren't
seen for some reason, then we are hitting "KeyError: 'flow_port_count'". Due to
counter samples seen on collector interface, "data['total_samples']" will not be
zero but "data['total_flow_count']" will be 0 and lead to KeyError when tried to
access "data['flow_port_count']". Fix is to have assert on "total_flow_count" and
"total_counter_count" before calling corresponding sample analyze functions.

Signed-off-by: Vinod <[email protected]>

* Addressing review comments

1) Enhanced "wait_until_hsflowd_ready" to make it wait for all the
   collector IPs (instead of calling it sequentially for each IP)
2) Add docstring for "wait_until_hsflowd_ready" function
3) Updated "ast.literal_eval" usage to handle the case where
   "active_collectors" is passed as empty string ("" instead of "[]")

Signed-off-by: Vinod <[email protected]>

* Fix pre-commit check failures

Signed-off-by: Vinod <[email protected]>

* Revert PR#21674 partially to enable "sflow/test_sflow.py" test

Signed-off-by: Vinod <[email protected]>

---------

Signed-off-by: Vinod <[email protected]>
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