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

Add router interface reference on Port to track port dependency on ro… #18

Open
wants to merge 1 commit into
base: master-DPB
Choose a base branch
from

Conversation

li-pingmao
Copy link
Collaborator

…uter interface (neighbor, next hop, route)

What I did

Add router interface reference count on portorch to track neighbor/nexthop/route dependency on Port

Why I did it

Make sure no neighbors/nexthop/routes on the port when deleting the port for Dynamic port breakout

How I verified it

vs tests:

  • Add neighbors in Config DB, shutdown the port and breakout and breakin the port
  • Add IP and route on the. interface, ping it from server, shutdown the port and breakout and breakin the port to verify the dependencies
  • Add route and nexthop on the interface, shutdown the port and breakout and breakin the port to verify the dependencies
  • Add route on the interface, ping it from server, shutdown the port and breakout and breakin the port
  • add vlan and neighbor, verify port breakout success with no dependency.

sudo pytest -v --dvsname=vs-pm test_port_dpb_neigh.py
======================================================================= test session starts =======================================================================
platform linux2 -- Python 2.7.15+, pytest-3.3.0, py-1.8.0, pluggy-0.6.0 -- /usr/bin/python
cachedir: .cache
rootdir: /home/pmao/sonic1/sonic-buildimage/src/sonic-swss/tests, inifile:
collected 5 items

test_port_dpb_neigh.py::TestPortDPBNeigh::test_set_neighbor_DPB PASSED [ 20%]
test_port_dpb_neigh.py::TestPortDPBNeigh::test_arp_neigh_DPB PASSED [ 40%]
test_port_dpb_neigh.py::TestPortDPBNeigh::test_nexthop_DPB PASSED [ 60%]
test_port_dpb_neigh.py::TestPortDPBNeigh::test_route_DPB PASSED [ 80%]
test_port_dpb_neigh.py::TestPortDPBNeigh::test_vlan_DPB PASSED [100%]

=================================================================== 5 passed in 262.56 seconds ====================================================================

Details if related


# check application database
# check that the FDB entries were inserted into State DB for Ethernet64, Ethernet68 with Vlan6
ok, extra = dvs.is_table_entry_exists(dvs.pdb, "NEIGH_TABLE",
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we have to pass dvs.pdb?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This test case, neighbor is added to config db, Check Neighbor is in NEIGH_TABLE in app db, later check the neighbor is deleted after interface is deleted and port can be deleted with no dependency.

@zhenggen-xu
Copy link
Owner

zhenggen-xu commented Mar 7, 2020

@li-pingmao
Can we remove the C++ code changes since we have the new tracking (#23) and try to see if all the test cases passing?

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