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

[mtu]: Add t1-64-lag topology support for MTU test #513

Merged
merged 1 commit into from
Mar 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions ansible/roles/test/files/ptftests/mtu_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'''
Description: This file contains the MTU test for SONIC

Usage: Examples of how to use log analyzer
ptf --test-dir ptftests mtu_test.MtuTest --platform remote -t "testbed_type='t1-lag';" --relax --debug info --log-file /tmp/mtu_test.log --disable-vxlan --disable-geneve --disable-erspan --disable-mpls --disable-nvgre --socket-recv-size 16384
Usage: Examples of how to start this script
ptf --test-dir ptftests mtu_test.MtuTest --platform-dir ptftests --platform remote -t "router_mac='11:22:33:44:55';testbed_type='t1-64-lag'" --relax --debug info --log-file /tmp/mtu_test.log --disable-vxlan --disable-geneve --disable-erspan --disable-mpls --disable-nvgre --socket-recv-size 16384

'''

Expand Down Expand Up @@ -49,6 +49,7 @@ def __init__(self):
def setUp(self):
self.dataplane = ptf.dataplane_instance
self.router_mac = self.test_params['router_mac']
self.testbed_type = self.test_params['testbed_type']

#---------------------------------------------------------------------

Expand Down Expand Up @@ -125,7 +126,11 @@ def check_ip_mtu(self):
src_port = 0
send_packet(self, src_port, pkt)
logging.info("Sending packet from port " + str(src_port) + " to " + ip_dst)
dst_port_list = [31]
dst_port_list = []
if self.testbed_type == 't1' or self.testbed_type == 't1-lag':
dst_port_list = [31]
elif self.testbed_type == 't1-64-lag':
dst_port_list = [58]

(matched_index, received) = verify_packet_any_port(self, masked_exp_pkt, dst_port_list)

Expand Down
5 changes: 2 additions & 3 deletions ansible/roles/test/tasks/mtu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@
when: testbed_type is not defined

- fail: msg="testbed_type {{testbed_type}} is invalid."
when: testbed_type not in ['t1-lag', 't1']
when: testbed_type not in ['t1-lag', 't1', 't1-64-lag']

- include_vars: "vars/topo_{{testbed_type}}.yml"

- name: Expand properties into props
set_fact: props="{{configuration_properties['spine']}}"
when: testbed_type in ['t1', 't1-lag']

- name: Expand ToR properties into props
set_fact: props_tor="{{configuration_properties['tor']}}"
when: testbed_type in ['t1', 't1-lag']

- name: Gathering minigraph facts about the device
minigraph_facts: host={{ inventory_hostname }}
Expand All @@ -35,6 +33,7 @@
ptf_test_name: MTU test
ptf_test_dir: ptftests
ptf_test_path: mtu_test.MtuTest
ptf_platform_dir: ptftests
ptf_platform: remote
ptf_test_params:
- testbed_type='{{testbed_type}}'
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/test/vars/testcases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ testcases:

mtu:
filename: mtu.yml
topologies: [t1, t1-lag]
topologies: [t1, t1-lag, t1-64-lag]
required_vars:
ptf_host:
testbed_type:
Expand Down