]>
git.ipfire.org Git - people/ms/network.git/blob - test/functions/ip/ip_detect_protocol
5 .
${testdir} / constants.sh
9 for address
in ${VALID_IPv4_ADDRESSES[@]} ; do
10 proto
= $
( ip_detect_protocol
${address} )
11 if [[ $?
== 0 ]] && [[ " ${proto} " == "ipv4" ]]; then
12 echo "OK: Detection of ip protocol for ${address} was successful [ ${proto} ]"
14 echo "ERROR: Detection of ip protocol for ${address} was not successful"
19 # Here we have to use a extra array because ::1 is an invalid IPv4 address but we can find a protocol for it [ipv6], so ip_detect_protocol is successful
20 INVALID_IPv4_ADDRESSES
=(
27 for address
in ${INVALID_IPv4_ADDRESSES[@]} ; do
28 proto
= $
( ip_detect_protocol
${address} )
29 if [[ $?
== 1 ]] && [[ " ${proto} " != "ipv4" ]]; then
30 echo "OK: Detection of ip protocol for ${address} was not successful"
32 echo "ERROR: Detection of ip protocol for ${address} was successful [ ${proto} ]"