Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 010079ba authored by Petr Machata's avatar Petr Machata Committed by David S. Miller
Browse files

selftests: forwarding: lib: Split out setup_wait_dev()



Split out of setup_wait() a function setup_wait_dev() that waits for a
single device. This gives tests the opportunity to wait for a selected
device after they tinkered with its upness.

Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b330219c
Loading
Loading
Loading
Loading
+16 −9
Original line number Original line Diff line number Diff line
@@ -185,11 +185,12 @@ log_info()
	echo "INFO: $msg"
	echo "INFO: $msg"
}
}


setup_wait()
setup_wait_dev()
{
{
	for i in $(eval echo {1..$NUM_NETIFS}); do
	local dev=$1; shift

	while true; do
	while true; do
			ip link show dev ${NETIFS[p$i]} up \
		ip link show dev $dev up \
			| grep 'state UP' &> /dev/null
			| grep 'state UP' &> /dev/null
		if [[ $? -ne 0 ]]; then
		if [[ $? -ne 0 ]]; then
			sleep 1
			sleep 1
@@ -197,6 +198,12 @@ setup_wait()
			break
			break
		fi
		fi
	done
	done
}

setup_wait()
{
	for i in $(eval echo {1..$NUM_NETIFS}); do
		setup_wait_dev ${NETIFS[p$i]}
	done
	done


	# Make sure links are ready.
	# Make sure links are ready.