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

DPB VLAN system test case and pulled in VLAN related DVSLIB code #46

Merged
merged 2 commits into from
Jun 9, 2020

Conversation

vasant17
Copy link
Collaborator

@vasant17 vasant17 commented Jun 5, 2020

What I did
Pulled in VLAN related DVSLIB files from an upstream PR in to this
Wrote VLAN DPB system test case using the CLI
Why I did it
To test VLAN dependency on DPB via CLI
How I verified it
By running the VS test case
Details if related

vapatil@server09:~/workspace/DPB/sonic-buildimage/src/sonic-swss/tests$ sudo pytest -s -v --pdb --dvsname=vs-jk test_port_dpb_system.py -k test_port_breakout_with_vlan
================================================================================== test session starts ==================================================================================
platform linux2 -- Python 2.7.17, pytest-3.3.0, py-1.8.0, pluggy-0.6.0 -- /usr/bin/python
cachedir: .cache
rootdir: /home/vapatil/workspace/DPB/sonic-buildimage/src/sonic-swss/tests, inifile:
collected 7 items                                                                                                                                                                       

test_port_dpb_system.py::TestPortDPBSystem::test_port_breakout_with_vlan remove extra link dummy
remove extra link Vlan100@Bridge
PASSED                                                                                                   [100%]

================================================================================== 6 tests deselected ===================================================================================
======================================================================= 1 passed, 6 deselected in 100.85 seconds ========================================================================

@zhenggen-xu zhenggen-xu requested review from praveen-li and samaity June 5, 2020 18:43
tests/dvslib/dvs_vlan.py Outdated Show resolved Hide resolved
dvs.setup_db()
portName = "Ethernet0"
vlanID = "100"
breakoutMode1 = "1x100G[40G]"
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can use before(bfrBreakOutMode) and after(afrBreakOutMode) too . Also, what about having one more test, where Say Ethernet4 is also part of same VLAN and an additional check is that if Ethernet4 not removed from VLAN.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, we can make all different combinations and have lot more test cases. Some of them especially the one that you are describing is covered in test_port_dpb_vlan.py. Here all that I am covering is very basic VLAN dependency test case using CLI command. More will be covered while exercising other options of CLI comamnd.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

BTW, I did think about before and after breakout modes. But they do NOT make sense as I am also doing vice-versa.

member = "PortChannel{}|{}".format(lag_id, interface)
self.config_db.delete_entry("PORTCHANNEL_MEMBER", member)

def check_app_db_vlan_fields(self, fvs, admin_status="up", mtu="9100"):
Copy link
Collaborator

Choose a reason for hiding this comment

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

any reason why this way of having many functions, is chosen instead of one function:

check_vlan_field(self, fvs, f, v):
assert fvs.get(f) == v

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As mentioned, these are the methods copied from several test_.py to here. To create one dvs_vlan.py, which uses dvslib_common functions.I will keep them as it for now.

Copy link
Collaborator

@praveen-li praveen-li left a comment

Choose a reason for hiding this comment

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

LGTM, btw, plz click resolve conversation if making change\no change.

@vasant17 vasant17 merged commit f0686b9 into zhenggen-xu:sonic-cfg-mgmt Jun 9, 2020
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.

3 participants