Skip to content

Commit

Permalink
Merge pull request avocado-framework-tests#1520 from vaishnavibhat/ne…
Browse files Browse the repository at this point in the history
…twork_test_link_check

network_test.py : use is_interface_link_up from configure_network utility
  • Loading branch information
narasimhan-v authored Jan 23, 2020
2 parents 0ed0742 + dd5a273 commit 2d53c5f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions io/net/network_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from avocado.utils import genio
from avocado.utils.configure_network import PeerInfo
from avocado.utils import configure_network
from avocado.utils import wait


class NetworkTest(Test):
Expand Down Expand Up @@ -62,6 +63,9 @@ def setUp(self):
self.ipaddr = self.params.get("host_ip", default="")
self.netmask = self.params.get("netmask", default="")
configure_network.set_ip(self.ipaddr, self.netmask, self.iface)
if not wait.wait_for(configure_network.is_interface_link_up,
timeout=120, args=[self.iface]):
self.fail("Link up of interface is taking longer than 120 seconds")
self.peer = self.params.get("peer_ip")
if not self.peer:
self.cancel("No peer provided")
Expand All @@ -74,6 +78,9 @@ def setUp(self):
self.peer_interface = self.peerinfo.get_peer_interface(self.peer)
self.mtu = self.params.get("mtu", default=1500)
self.mtu_set()
if not wait.wait_for(configure_network.is_interface_link_up,
timeout=120, args=[self.iface]):
self.fail("Link up of interface is taking longer than 120 seconds")
if not configure_network.ping_check(self.iface, self.peer, "5"):
self.cancel("No connection to peer")

Expand Down

0 comments on commit 2d53c5f

Please sign in to comment.