Skip to content
Merged
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
9 changes: 7 additions & 2 deletions ansible/roles/test/files/ptftests/fdb_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def setUp(self):
self.vlan_ip = ip_address(unicode(self.test_params['vlan_ip']))

self.setUpFdb()
self.setUpArpResponder()

self.log("Start arp_responder")
self.shell(["supervisorctl", "start", "arp_responder"])
Expand All @@ -55,6 +54,12 @@ def setUpFdb(self):
for member in vlan_table[vlan]:
mac = self.dataplane.get_mac(0, member)
self.fdb.insert(mac, member)

# Send a packet to switch to populate the layer 2 table
pkt = simple_eth_packet(eth_dst=self.test_params['router_mac'],
eth_src=mac,
eth_type=0x1234)
send(self, member, pkt)
#--------------------------------------------------------------------------

def setUpArpResponder(self):
Expand All @@ -79,7 +84,7 @@ def check_route(self, src_mac, dst_mac, src_port, dst_port):
eth_type=0x1234)
self.log("Send packet " + str(src_mac) + "->" + str(dst_mac) + " from " + str(src_port) + " to " + str(dst_port) + "...")
send(self, src_port, pkt)
verify_packet(self, pkt, dst_port)
verify_packet_any_port(self, pkt, [dst_port])
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curios, what is the difference here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The function name doesn't not reflecting all it does. With the new function, we verify that the packet is received on the expected port and NOT received from any other ports.

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

def runTest(self):
Expand Down