7 ping -${1} -q -c 1 -W 1 ${2%%/*} >/dev
/null
2>&1
13 echo -n "Wait for testing IPv4/IPv6 to become available "
14 for _i
in $
(seq ${MAX_PING_TRIES}); do
16 if ping_once
4 ${TEST_IPv4} && ping_once
6 ${TEST_IPv6}; then
21 echo 1>&2 "ERROR: Timeout waiting for test IP to become available."
27 # Create testing interfaces not to interfere with current environment.
28 ip link add dev
${TEST_IF} type veth peer name
${TEST_IF_PEER}
29 ip link
set ${TEST_IF} up
30 ip link
set ${TEST_IF_PEER} up
32 ip
-4 addr add
${TEST_IPv4} dev
${TEST_IF}
33 ip
-6 addr add
${TEST_IPv6} dev
${TEST_IF}
39 ip link del
${TEST_IF} 2>/dev
/null ||
:
40 ip link del
${TEST_IF_PEER} 2>/dev
/null ||
:
45 trap cleanup EXIT
2 3 6 15
47 .
/test_sock_addr setup_done
50 BASENAME
=$
(basename $0 .sh
)
51 TEST_IF
="${BASENAME}1"
52 TEST_IF_PEER
="${BASENAME}2"
53 TEST_IPv4
="127.0.0.4/8"