Skip to content

Adding scripts to test sflow#1348

Merged
lguohan merged 1 commit intosonic-net:masterfrom
chitra-raghavan:sflow
Feb 4, 2020
Merged

Adding scripts to test sflow#1348
lguohan merged 1 commit intosonic-net:masterfrom
chitra-raghavan:sflow

Conversation

@chitra-raghavan
Copy link
Contributor

Description of PR

Summary:
Adding scripts to test sflow

Type of change

  • [] Bug fix
  • [] Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

How did you do it?

  • The test will run on the t0 testbed. The script is validated in sonic-vs image with vms-kvm-t0 topology loaded.
  • 1 port from each port channel is used for sending traffic. Sflow is enabled on these 4 ports
  • 2 ports from Vlan1000 are removed and assigned with ip address and used to reach sflow collector in ptf docker .
  • Traffic is sent from ptf docker with different packet sizes to the port channel interfaces which are enabled with sflow .
  • Collection is implemented using the sflowtool. Counter sampling output and flow sampling output are directed to a text file. The test script parses the text file and validates the data according to the polling/sampling rate configured and the interfaces enabled.
  • For this test to run sflowtool to be installed in ptf docker Adding sflowtool to ptf docker to for sflow tests sonic-buildimage#4045

Test plan Document : sonic-net/SONiC#554

How did you verify/test it?

  • The test will run on the t0 testbed. The script is validated in sonic-vs image with vms-kvm-t0 topology loaded.

Any platform specific information?

Supported testbed topology if it's a new test case?

Runs in t0 topology.

Script run :

root@e9a663910a81:/var/johnar/sonic-mgmt/tests# py.test --inventory=../ansible/lab --host-pattern=vlab-01  --module-path ../ansible/library/ --testbed=vms-kvm-t0  --testbed_file=vtestbed.csv    test_sflow.py  -vvv  --disable_loganalyzer -rab     --duration=0 --show-capture=stdout
================================================================================================================================================= test session starts =================================================================================================================================================
platform linux2 -- Python 2.7.12, pytest-4.6.6, py-1.8.0, pluggy-0.13.0 -- /usr/bin/python
cachedir: .pytest_cache
ansible: 2.0.0.2
rootdir: /var/johnar/sonic-mgmt/tests, inifile: pytest.ini
plugins: ansible-2.0.2
collected 15 items

test_sflow.py::TestSflowCollector::test_sflow_config PASSED                                     [  6%]
test_sflow.py::TestSflowCollector::test_collector_del_add PASSED                                [ 13%]
test_sflow.py::TestSflowCollector::test_two_collectors PASSED                                   [ 20%]
test_sflow.py::TestSflowPolling::testPolling PASSED                                             [ 26%]
test_sflow.py::TestSflowPolling::testDisablePolling PASSED                                      [ 33%]
test_sflow.py::TestSflowPolling::testDifferntPollingInt PASSED                                  [ 40%]
test_sflow.py::TestSflowInterface::testIntfRemoval PASSED                                       [ 46%]
test_sflow.py::TestSflowInterface::testIntfSamplingRate PASSED                                  [ 53%]
test_sflow.py::TestSflowInterface::testIntfChangeSamplingRate PASSED                            [ 60%]
test_sflow.py::TestAgentId::testNonDefaultAgent PASSED                                          [ 66%]
test_sflow.py::TestAgentId::testDelAgent PASSED                                                 [ 73%]
test_sflow.py::TestAgentId::testAddAgent PASSED                                                 [ 80%]
test_sflow.py::TestReboot::testRebootSflowEnable PASSED                                         [ 86%]
test_sflow.py::TestReboot::testRebootSflowDisable PASSED                                        [ 93%]
test_sflow.py::TestReboot::testFastreboot PASSED                                                [100%]

============================================== slowest test durations ==============================================
513.19s call     test_sflow.py::TestSflowCollector::test_two_collectors
419.81s call     test_sflow.py::TestReboot::testRebootSflowEnable
389.54s call     test_sflow.py::TestReboot::testRebootSflowDisable
356.24s call     test_sflow.py::TestReboot::testFastreboot
297.33s call     test_sflow.py::TestSflowCollector::test_collector_del_add
164.32s call     test_sflow.py::TestSflowCollector::test_sflow_config
133.97s call     test_sflow.py::TestSflowInterface::testIntfSamplingRate
132.87s call     test_sflow.py::TestSflowInterface::testIntfChangeSamplingRate
132.08s call     test_sflow.py::TestSflowInterface::testIntfRemoval
73.84s call     test_sflow.py::TestSflowPolling::testDifferntPollingInt
39.27s call     test_sflow.py::TestAgentId::testDelAgent
35.03s call     test_sflow.py::TestAgentId::testNonDefaultAgent
34.16s call     test_sflow.py::TestSflowPolling::testPolling
34.04s call     test_sflow.py::TestAgentId::testAddAgent
33.81s call     test_sflow.py::TestSflowPolling::testDisablePolling
22.66s setup    test_sflow.py::TestSflowInterface::testIntfRemoval
22.15s setup    test_sflow.py::TestSflowCollector::test_sflow_config
21.86s setup    test_sflow.py::TestReboot::testRebootSflowEnable
21.71s setup    test_sflow.py::TestSflowPolling::testPolling
20.90s setup    test_sflow.py::TestAgentId::testNonDefaultAgent
20.82s setup    test_sflow.py::TestSflowCollector::test_two_collectors
5.98s teardown test_sflow.py::TestReboot::testFastreboot
1.43s teardown test_sflow.py::TestReboot::testRebootSflowDisable
1.36s teardown test_sflow.py::TestSflowCollector::test_sflow_config
1.32s teardown test_sflow.py::TestReboot::testRebootSflowEnable
1.26s teardown test_sflow.py::TestSflowInterface::testIntfChangeSamplingRate
1.25s teardown test_sflow.py::TestSflowInterface::testIntfRemoval
1.24s teardown test_sflow.py::TestSflowCollector::test_collector_del_add
1.16s teardown test_sflow.py::TestSflowInterface::testIntfSamplingRate
1.15s setup    test_sflow.py::TestReboot::testFastreboot
1.08s setup    test_sflow.py::TestReboot::testRebootSflowDisable
1.02s teardown test_sflow.py::TestSflowCollector::test_two_collectors
1.01s teardown test_sflow.py::TestAgentId::testAddAgent
0.99s teardown test_sflow.py::TestSflowPolling::testPolling
0.99s setup    test_sflow.py::TestAgentId::testDelAgent
0.99s teardown test_sflow.py::TestAgentId::testDelAgent
0.96s teardown test_sflow.py::TestAgentId::testNonDefaultAgent
0.93s setup    test_sflow.py::TestSflowInterface::testIntfChangeSamplingRate
0.93s setup    test_sflow.py::TestSflowPolling::testDisablePolling
0.92s setup    test_sflow.py::TestSflowPolling::testDifferntPollingInt
0.92s teardown test_sflow.py::TestSflowPolling::testDisablePolling
0.90s teardown test_sflow.py::TestSflowPolling::testDifferntPollingInt
0.88s setup    test_sflow.py::TestSflowCollector::test_collector_del_add
0.81s setup    test_sflow.py::TestSflowInterface::testIntfSamplingRate
0.80s setup    test_sflow.py::TestAgentId::testAddAgent
============================================== 15 passed in 2950.05 seconds ===========================================
root@e9a663910a81:/var/johnar/sonic-mgmt/tests#

Known issue:
sonic-net/sonic-buildimage#3991 will be seen until sonic-net/sonic-linux-kernel#120 is merged in buildimage

@lguohan lguohan merged commit b5a5011 into sonic-net:master Feb 4, 2020
@chitra-raghavan chitra-raghavan deleted the sflow branch February 22, 2021 08:41
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
- swss:
* 459d09b 2021-02-22 | [acl] Enable VLAN ID qualifier for ACL rules (sonic-net#1648) (HEAD -> 202012) [Danny Allen]
* 60859b1 2021-02-08 | [buffermgr] Support maximum port headroom checking (sonic-net#1607) [Stephen Sun]
* 3161cbb 2021-02-17 | Add SAI_INGRESS_PRIORITY_GROUP_STAT_DROPPED_PACKETS counter, create new FlexCounter group (sonic-net#1600) [Andriy Yurkiv]
* 256ed9c 2021-02-08 | Support shared headroom pool on top of dynamic buffer calculation (sonic-net#1581) [Stephen Sun]

- utilities:
* 30d7069 2021-02-16 | [decode-syseeprom] Refactor to utilize sonic-platform package (sonic-net#1435) (HEAD -> 202012, tag: foo) [Joe LeVeque]
* 891fef4 2021-02-16 | [psuutil] Refactor to utilize sonic-platform package (sonic-net#1434) [Joe LeVeque]
* 8c5e505 2021-02-17 | [sfputil] Refactor to utilize sonic-platform package (sonic-net#1421) [Joe LeVeque]
* ca5dd2c 2021-02-17 | [sfpshow] Cleanup (sonic-net#1405) [Joe LeVeque]
* bf489ea 2021-02-17 | Add new cli for SAI_INGRESS_PRIORITY_GROUP_STAT_DROPPED_PACKETS counter in counterpoll utility (sonic-net#1355) [Andriy Yurkiv]
* 25feed3 2021-02-08 | Support shared headroom pool on top of dynamic buffer calculation (sonic-net#1348) [Stephen Sun]
* aaa323a 2021-02-02 | [vrf]: Fix freezing during interface binding (sonic-net#1325) [maksymbelei95]
* cc0bb6e 2021-01-27 | [show] fix "show interfaces breakout" command (sonic-net#1198) [Dmytro Shevchuk]

Signed-off-by: Ying Xie <[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