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

Handle new IPv6 ping format; handle echoing tapbr0 interface #12

Open
wants to merge 2 commits into
base: pr/utils
Choose a base branch
from
Open
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: 5 additions & 6 deletions testutils/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,16 @@ def add_nib_route(self, iface, route, ip_addr):

def ping(self, count, dest_addr, payload_size, delay):
self.pexpect.sendline(
"ping6 {} {} {} {}".format(
count, dest_addr, payload_size, delay))
"ping6 -c {} -i {} -s {} {} ".format(
count, delay, payload_size, dest_addr))
packet_loss = None
for i in range(count+1):
while True:
exp = self.pexpect.expect(
["bytes from", "([\\d]+) packets transmitted, ([\\d]+) "
"received, ([\\d]+)% packet loss", "timeout",
["bytes from", "([\\d]+)% packet loss", "timeout",
pexpect.TIMEOUT], timeout=10)

if exp == 1:
packet_loss = int(self.pexpect.match.group(3))
packet_loss = int(self.pexpect.match.group(1))
break
if exp == 2:
print("x", end="", flush=True)
Expand Down