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

[dash-flow] Test cases for DASH flow using PTF #621

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ dash-pipeline/bmv2/dash_pipeline.bmv2/
dash-pipeline/dpdk-pna/dash_pipeline.dpdk
dash-pipeline/SAI/lib/
dash-pipeline/SAI/rpc/
dash-pipeline/dpapp/build
55 changes: 55 additions & 0 deletions test/test-cases/functional/ptf/saidashdpapp_sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,66 @@ def trafficTcpTest(self):

print(f"{self.__class__.__name__} trafficTcpTest OK\n")

def ageoutTcpTest(self):

src_vm_ip = "10.1.1.11"
outer_smac = "00:00:05:06:06:07"
tcp_src_port = 0x1234
tcp_dst_port = 0x50

# customer packet: tcp SYN
inner_pkt = simple_tcp_packet(eth_dst="02:02:02:02:02:02",
eth_src=self.eni_mac,
ip_dst=self.dst_ca_ip,
ip_src=src_vm_ip,
tcp_sport=tcp_src_port,
tcp_dport=tcp_dst_port,
tcp_flags="S")
vxlan_pkt = simple_vxlan_packet(eth_dst=self.our_mac,
eth_src=outer_smac,
ip_dst=self.vip,
ip_src=self.src_vm_pa_ip,
udp_sport=11638,
with_udp_chksum=False,
vxlan_vni=self.outbound_vni,
inner_frame=inner_pkt)

inner_exp_pkt = simple_tcp_packet(eth_dst=self.dst_ca_mac,
eth_src=self.eni_mac,
ip_dst=self.dst_ca_ip,
ip_src=src_vm_ip,
tcp_sport=tcp_src_port,
tcp_dport=tcp_dst_port,
tcp_flags="S")
vxlan_exp_pkt = simple_vxlan_packet(eth_dst="00:00:00:00:00:00",
eth_src="00:00:00:00:00:00",
ip_dst=self.dst_pa_ip,
ip_src=self.vip,
udp_sport=0, # TODO: Fix sport in pipeline
with_udp_chksum=False,
vxlan_vni=self.vnet_vni,
inner_frame=inner_exp_pkt)

self.pkt_exp = vxlan_exp_pkt
print("\tSending outbound packet TCP SYN ...")
send_packet(self, 0, vxlan_pkt)
print("\tVerifying packet...")
verify_packet(self, self.pkt_exp, 0)
print("\tVerifying flow created...")
verify_flow(self.eni_mac, self.vnet & 0xffff, inner_pkt)
time.sleep(35)
print("\tVerifying flow aged out...")
verify_no_flow(self.eni_mac, self.vnet & 0xffff, inner_pkt)


print(f"{self.__class__.__name__} ageoutTcpTest OK\n")

def runTest(self):

self.configureVnet()
self.trafficUdpTest()
self.trafficTcpTest()
self.ageoutTcpTest()

def tearDown(self):

Expand Down
Loading
Loading