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

Dynamic Port Breakout system test cases using CLI command #1515

Merged
merged 11 commits into from
May 4, 2021

Conversation

vasant17
Copy link
Contributor

@vasant17 vasant17 commented Nov 20, 2020

Signed-off-by: Vasant [email protected]

What I did
Wrote test cases using CLI command to breakout port

Why I did it
Better test coverage of DPB modules

How I verified it
Ran VS test cases

Details if related

$ sudo pytest --pdb -s -v --dvsname=vs-vp test_port_dpb_system.py
================================================================================== test session starts ==================================================================================
platform linux -- Python 3.6.9, pytest-6.1.2, py-1.9.0, pluggy-0.13.1 -- /usr/bin/python
cachedir: .pytest_cache
rootdir: /home/vapatil/workspace/AZURE_VS/sonic-buildimage/src/sonic-swss/tests
collected 29 items

test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-2x50G0] remove extra link dummy
PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-4x25G[10G]0] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-2x50G1] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-2x25G(2)+1x50G(2)0] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-2x50G2] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-1x50G(2)+2x25G(2)0] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-2x50G3] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-1x100G[40G]0] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-4x25G[10G]1] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-2x25G(2)+1x50G(2)1] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-4x25G[10G]2] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-1x50G(2)+2x25G(2)1] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-4x25G[10G]3] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-1x100G[40G]1] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-2x25G(2)+1x50G(2)2] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-1x50G(2)+2x25G(2)2] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-2x25G(2)+1x50G(2)3] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-1x100G[40G]2] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-1x50G(2)+2x25G(2)3] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_simple[Ethernet0-1x100G[40G]3] PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_with_vlan PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_with_acl PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_cli_command_with_force_option SKIPPED
test_port_dpb_system.py::TestPortDPBSystem::test_cli_command_with_load_port_breakout_config_option SKIPPED
test_port_dpb_system.py::TestPortDPBSystem::test_cli_command_negative PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_dpb_arp_flush PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_dpb_arp_flush_vlan PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_dpb_arp_flush_on_port_oper_shut PASSED
test_port_dpb_system.py::TestPortDPBSystem::test_dpb_arp_flush_on_vlan_member_remove PASSED

======================================================================= 27 passed, 2 skipped in 261.99s (0:04:21) =======================================================================
$

Dependent PRs:

sonic-net/sonic-buildimage#6029
sonic-net/sonic-utilities#1268
#1506 - Merged
sonic-net/sonic-buildimage#6034 - Merged

@daall daall self-requested a review November 20, 2020 19:12
Copy link
Contributor

@daall daall left a comment

Choose a reason for hiding this comment

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

The tests should poll (either by using the existing methods in dvs_database or wait_for_result in dvs_common), otherwise they aren't going to be stable.

tests/port_dpb.py Outdated Show resolved Hide resolved
tests/port_dpb.py Show resolved Hide resolved
tests/test_port_dpb_system.py Outdated Show resolved Hide resolved
tests/test_port_dpb_system.py Outdated Show resolved Hide resolved
tests/test_port_dpb_system.py Outdated Show resolved Hide resolved
tests/test_port_dpb_system.py Outdated Show resolved Hide resolved
tests/test_port_dpb_system.py Outdated Show resolved Hide resolved
tests/test_port_dpb_system.py Outdated Show resolved Hide resolved
tests/test_port_dpb_system.py Outdated Show resolved Hide resolved
tests/test_port_dpb_system.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
Copy link
Contributor

@daall daall left a comment

Choose a reason for hiding this comment

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

Looking a lot better, just had a few more suggestions

tests/conftest.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
tests/port_dpb.py Outdated Show resolved Hide resolved
Comment on lines 1 to 2
from swsscommon import swsscommon
import redis
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think these are necessary w/ your latest round of changes

import time
import os
import pytest
from pytest import *
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is needed either - all the marks + whatnot should be covered by the import pytest.

tests/conftest.py Outdated Show resolved Hide resolved
daall
daall previously approved these changes Nov 24, 2020
@lguohan
Copy link
Contributor

lguohan commented Nov 26, 2020

retest this please

@vasant17
Copy link
Contributor Author

vasant17 commented Dec 4, 2020

@zhenggen-xu: It would be good if we can commit the dependent PRs soon.

@zhenggen-xu
Copy link
Collaborator

retest this please

@allas-nvidia
Copy link
Contributor

Can someone take a look, please?
Thanks.

@zhenggen-xu
Copy link
Collaborator

@vasant17 All dependent PRs are merged? Can you please rebase to solve the conflict?

@daall daall merged commit 960eacf into sonic-net:master May 4, 2021
raphaelt-nvidia pushed a commit to raphaelt-nvidia/sonic-swss that referenced this pull request Oct 5, 2021
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.

5 participants