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

PY Test script for EVPN L3 VxLAN #1330

Merged
merged 4 commits into from
Dec 28, 2020

Conversation

tapashdas
Copy link
Contributor

What I did

Added PY Test script for EVPN L3 VxLAN.

Added following test cases.

  1. Testing Create and Delete SIP Tunnel and VRF VNI Map entries

  2. Testing Create and Delete DIP Tunnel on adding and removing prefix route

  3. Testing IPv4 Route and Overlay Nexthop Add and Delete

  4. Testing IPv4 Route and Overlay Nexthop Update

  5. Test VRF IPv4 Route with ECMP Tunnel Nexthop Add and Delete

  6. Test VRF IPv4 Route with Tunnel Nexthop update from non-ECMP to ECMP

  7. Test VRF IPv4 Route with Tunnel Nexthop update from ECMP to non-ECMP

  8. Testing IPv6 Route and Overlay Nexthop Add and Delete

  9. Testing IPv6 Route and Overlay Nexthop Update

  10. Test VRF IPv6 Route with ECMP Tunnel Nexthop Add and delete

  11. Test VRF IPv6 Route with Tunnel Nexthop update from non-ECMP to ECMP

  12. Test VRF IPv6 Route with Tunnel Nexthop update from ECMP to non-ECMP

  13. Test DIP and SIP Tunnel Deletion

Why I did it

For code changes in PR 1267 (#1267).
And corresponding HLD PR 437 (sonic-net/SONiC#437)

How I verified it

Merge all EVPN PRs are execute the PY Test Script.

Details if related

self.setup_db(dvs)
tunnel_name = 'tunnel_2'
map_name = 'map_1000_100'
vrf_map_name = 'evpn_map_1000_Vrf-RED'

Choose a reason for hiding this comment

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

Do we have a test case for default VRF for L3VPN or is this Test only for Type5 routes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test case is only for Type5 routes (non default VRF).

create_vxlan_vrf_tunnel_map(dvs, 'Vrf-RED', '1000')
print "\tPass"

#vlanlist = ['100', '101', '102']

Choose a reason for hiding this comment

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

If not required please remove the unwanted code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok. Will do.

print "\tPass"

print "\tTesting Tunnel VRF VNI Map Entry"
vxlan_obj.check_vxlan_tunnel_vrf_map_entry(dvs, tunnel_name, 'Vrf-RED', '1000')

Choose a reason for hiding this comment

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

Please have the VRF Name defined in a variable and use it everywhere. So that, it might not needed to be changed, in lot of places, if we use a different VRF other than Vrf-RED.
And the same goes with VLAN as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok. Will do.

create_vrf_routes_ecmp(dvs, "80.80.1.0/24", 'Vrf-RED', ecmp_nexthop_attr)

nh_count = 2
ecmp_nhid_list = vxlan_obj.check_vrf_routes_ecmp(dvs, "80.80.1.0/24", 'Vrf-RED', tunnel_name, nh_count)

Choose a reason for hiding this comment

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

This is an ECMP case for the overlay routes right? Is there a way to check both underlay and overlay ecmp paths?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this is Overlay route with ECMP Tunnel nexthop test case.
Routes can have either all overlay nexthop or all underlay nexthops.
Mix of both overlay and underlay nexthop is currently not supported.

vxlan_obj.check_vrf_routes(dvs, "80.80.1.0/24", 'Vrf-RED', '7.7.7.7', tunnel_name, "00:11:11:11:11:11", '1000')
print "\tPass"

ecmp_nexthop_attr = [

Choose a reason for hiding this comment

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

It has been defined earlier at line 1378. Why are we redefining it again here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok. Will update the test case.

check_deleted_object(self.adb, vxlan_obj.ASIC_NEXT_HOP, ecmp_nhid_list[0])
check_deleted_object(self.adb, vxlan_obj.ASIC_NEXT_HOP, ecmp_nhid_list[1])

vxlan_obj.check_vrf_routes_ecmp_nexthop_grp_del(dvs, 2)

Choose a reason for hiding this comment

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

Where is the ecmp group created first?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Line 1386. As part of create_vrf_routes_ecmp()

("nexthop", "7.7.7.7,8.8.8.8"),
("ifname", "Vlan100,Vlan100"),
("vni_label", "1000,1000"),
("router_mac", "00:11:11:11:11:11,00:22:22:22:22:22"),

Choose a reason for hiding this comment

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

How do we verify the local router_mac? ie., local routes getting advertised with local router_mac? Can we test with local static routes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not get the query. Please elaborate.

This is EVPN route over tunnel test case. Static route with tunnel nexthop is currently not supported.

print "\tPass"

print "\tTest VRF IPv4 Route with ECMP Tunnel Nexthop [7.7.7.7 , 8.8.8.8] Udpate"
ecmp_nexthop_attr = [

Choose a reason for hiding this comment

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

If we can reuse the earlier declaration of "ecmp_nexthop_attr " . Please use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok. Will do.

vxlan_obj.remove_vrf(dvs, "Vrf-RED")
remove_vlan_member(dvs, "100", "Ethernet24")
remove_vlan(dvs, "100")
print "\tPass\n"

Choose a reason for hiding this comment

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

Please add cases for local static route prefixes for both ipv4 & ipv6, if they are supported.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Static route with Tunnel nexthop is currently not supported. And out of scope of this PR.

@prsunny
Copy link
Collaborator

prsunny commented Oct 23, 2020

retest vs please

@lguohan lguohan added the evpn label Nov 4, 2020
@srj102
Copy link
Contributor

srj102 commented Dec 20, 2020

retest this please

@prsunny
Copy link
Collaborator

prsunny commented Dec 23, 2020

retest this please

@prsunny
Copy link
Collaborator

prsunny commented Dec 24, 2020

@tapashdas , could you please take a look at the evpn test failures. Please confirm if any fix is required in code

@prsunny prsunny merged commit 7fc3888 into sonic-net:master Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants