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_timeout param #1946

Merged
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: 6 additions & 5 deletions io/net/tcpdump.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def setUp(self):
self.peer_password = self.params.get("peer_password", '*',
default="None")
self.mtu = self.params.get("mtu", default=1500)
self.mtu_timeout = self.params.get("mtu_timeout", default=30)
self.remotehost = RemoteHost(self.peer_ip, self.peer_user,
password=self.peer_password)
self.peer_interface = self.remotehost.get_interface_by_ipaddr(self.peer_ip).name
Expand All @@ -78,9 +79,9 @@ def setUp(self):
password=self.peer_password)
self.peer_public_networkinterface = NetworkInterface(self.peer_interface,
self.remotehost_public)
if self.peer_networkinterface.set_mtu(self.mtu) is not None:
if self.peer_networkinterface.set_mtu(self.mtu, timeout=self.mtu_timeout) is not None:
self.cancel("Failed to set mtu in peer")
if self.networkinterface.set_mtu(self.mtu) is not None:
if self.networkinterface.set_mtu(self.mtu, timeout=self.mtu_timeout) is not None:
self.cancel("Failed to set mtu in host")

# Install needed packages
Expand Down Expand Up @@ -151,12 +152,12 @@ def tearDown(self):
'''
unset ip for host interface
'''
if self.networkinterface.set_mtu('1500') is not None:
if self.networkinterface.set_mtu('1500', timeout=self.mtu_timeout) is not None:
self.cancel("Failed to set mtu in host")
try:
self.peer_networkinterface.set_mtu('1500')
self.peer_networkinterface.set_mtu('1500', timeout=self.mtu_timeout)
except Exception:
self.peer_public_networkinterface.set_mtu('1500')
self.peer_public_networkinterface.set_mtu('1500', timeout=self.mtu_timeout)
self.networkinterface.remove_ipaddr(self.ipaddr, self.netmask)
try:
self.networkinterface.restore_from_backup()
Expand Down
1 change: 1 addition & 0 deletions io/net/tcpdump.py.data/tcpdump-virt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ count: 100
# interface packet drop accepted in percentage (eg 10 for 10%)
drop_accepted: 10
nmap_download: "https://nmap.org/dist/nmap-7.80.tar.bz2"
mtu_timeout:
options: !mux
generic:
option: ''
Expand Down
1 change: 1 addition & 0 deletions io/net/tcpdump.py.data/tcpdump.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ count: 100
# interface packet drop accepted in percentage (eg 10 for 10%)
drop_accepted: 10
nmap_download: "https://nmap.org/dist/nmap-7.80.tar.bz2"
mtu_timeout:
options: !mux
generic:
option: ''
Expand Down
1 change: 1 addition & 0 deletions io/net/tcpdump.py.data/tcpdump_extended.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ count: 100
# interface packet drop accepted in percentage (eg 10 for 10%)
drop_accepted: 10
nmap_download: "https://nmap.org/dist/nmap-7.80.tar.bz2"
mtu_timeout:
options: !mux
PrintAllPacket:
option: '-A'
Expand Down
1 change: 1 addition & 0 deletions io/net/tcpdump.py.data/tcpdump_extended_virt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ count: 100
# interface packet drop accepted in percentage (eg 10 for 10%)
drop_accepted: 10
nmap_download: "https://nmap.org/dist/nmap-7.80.tar.bz2"
mtu_timeout:
options: !mux
PrintAllPacket:
option: '-A'
Expand Down