Skip to content
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
5 changes: 3 additions & 2 deletions dsatest/bench/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ def del_address(self, address):
def flush_addresses(self):
self.machine.flush_addresses(self.name)

def ping(self, destination, count=None, deadline=None):
self.machine.ping(destination, from_if=self.name, count=count, deadline=deadline)
def ping(self, destination, count=None, deadline=None, size=None):
self.machine.ping(destination, from_if=self.name, count=count,
deadline=deadline, size=size)

def arp_get(self, address):
return self.machine.arp_get(address, self.name)
4 changes: 3 additions & 1 deletion dsatest/bench/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,16 @@ def del_bridge(self, bridge):
self.bridges.remove(bridge)
bridge.destroy()

def ping(self, destination, count=None, deadline=None, from_if=None):
def ping(self, destination, count=None, deadline=None, from_if=None, size=None):
cmd = "ping "
if count is not None:
cmd += " -c {} ".format(count)
if deadline is not None:
cmd += " -w {} ".format(deadline)
if from_if is not None:
cmd += " -I {} ".format(from_if)
if size is not None:
cmd += " -s {} ".format(size)
cmd += " {}".format(destination)
self.control.exec_and_check(cmd)

Expand Down
20 changes: 20 additions & 0 deletions dsatest/tests/port/ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,23 @@ def test_port_ping_all(self):
for i, link in enumerate(bench.links):
addr = self.get_address(i, "target")
link.host_if.ping(addr, count=1, deadline=10)

def test_port_ping_sizes(self):
for i, link in enumerate(bench.links):
addr = get_address(i, "target")
"""
This is a very small size, but the HW should be rounding up
to a 64 bytes packet on the wire. Depending on the host, this
may fail. If it does, you may need to patch your host driver
"""
link.host_if.ping(addr, count=1, deadline=10, size=1)
"""
This would round up the total Ethernet size sans FCS to 60 bytes
and should be the minumum acceptable size
"""
link.host_if.ping(addr, count=1, deadline=10, size=32)
"""
This would result in a total Ethernet size sans FCS of 1500 bytes
and should be accepted by the switch
"""
link.host_if.ping(addr, count=1, deadline=10, size=1472)