selftests: forwarding: lib.sh: Add wait for dev with timeout
authorAmit Cohen <amitc@mellanox.com>
Mon, 18 Nov 2019 07:50:01 +0000 (09:50 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Nov 2019 01:11:54 +0000 (17:11 -0800)
commit8f72a9cf369090c3b94101a11cc4546f13f94925
treecc992c90d9c6f5512e2da6ac709668121d4ea227
parent646cf7ed9abba7cc1a45f70243cd94808d4c8b6b
selftests: forwarding: lib.sh: Add wait for dev with timeout

Add a function that waits for device with maximum number of iterations.
It enables to limit the waiting and prevent infinite loop.

This will be used by the subsequent patch which will set two ports to
different speeds in order to make sure they cannot negotiate a link.

Waiting for all the setup is limited with 10 minutes for each device.

Signed-off-by: Amit Cohen <amitc@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/forwarding/lib.sh