Commit dae9dd5f authored by Jiri Pirko's avatar Jiri Pirko Committed by Paolo Abeni

selftests: forwarding: add wait_for_dev() helper

The existing setup_wait*() helper family check the status of the
interface to be up. Introduce wait_for_dev() to wait for the netdevice
to appear, for example after test script does manual device bind.
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Reviewed-by: default avatarBenjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 617198cb
...@@ -738,6 +738,19 @@ setup_wait() ...@@ -738,6 +738,19 @@ setup_wait()
sleep $WAIT_TIME sleep $WAIT_TIME
} }
wait_for_dev()
{
local dev=$1; shift
local timeout=${1:-$WAIT_TIMEOUT}; shift
slowwait $timeout ip link show dev $dev &> /dev/null
if (( $? )); then
check_err 1
log_test wait_for_dev "Interface $dev did not appear."
exit $EXIT_STATUS
fi
}
cmd_jq() cmd_jq()
{ {
local cmd=$1 local cmd=$1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment