diff options
author | mboelen <michael@cisofy.com> | 2015-10-27 15:33:16 +0300 |
---|---|---|
committer | mboelen <michael@cisofy.com> | 2015-10-27 15:33:16 +0300 |
commit | 510de19ce947d257aa404bb0de67382784738896 (patch) | |
tree | b2ad7dd37615c9396b3b6f7f3f915eae61c50e9c /include/tests_networking | |
parent | 7b3299fcb9706b1edb58b3caae7378a60b413e65 (diff) |
NETW-3004 now collects interfaces from most common operating systems
Diffstat (limited to 'include/tests_networking')
-rw-r--r-- | include/tests_networking | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/include/tests_networking b/include/tests_networking index 76dad30c..45bbbf3f 100644 --- a/include/tests_networking +++ b/include/tests_networking @@ -127,16 +127,42 @@ # # Test : NETW-3004 # Description : Find available network interfaces on FreeBSD and others - if [ "${OS}" = "DragonFly" -o "${OS}" = "FreeBSD" -o "${OS}" = "NetBSD" ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi - Register --test-no NETW-3004 --preqs-met ${PREQS_MET} --weight L --network NO --description "Search available network interfaces on FreeBSD and others" + Register --test-no NETW-3004 --weight L --network NO --description "Search available network interfaces on FreeBSD and others" if [ ${SKIPTEST} -eq 0 ]; then - FIND=`${IFCONFIGBINARY} -l` + FIND="" N=0 - for I in ${FIND}; do - logtext "Found network interface: ${I}" - N=`expr ${N} + 1` - report "network_interface[]=${I}" - done + case ${OS} in + AIX) + FIND=`${IFCONFIGBINARY} -a | ${GREPBINARY} "flags=" | ${AWKBINARY} -F ":" '{ print $1 }'` + ;; + Linux) + if [ ! "${IPBINARY}" = "" ]; then + FIND=`${IPBINARY} link show | ${GREPBINARY} "^[0-9]" | ${AWKBINARY} '{ print $2 }' | sed 's/://g'` + elif [ ! "${IFCONFIGBINARY}" = "" ]; then + FIND=`${IFCONFIGBINARY} -a | ${AWKBINARY} '{ if ( $2 == "Link" ) { print $1 }}'` + fi + ;; + DragonFly|FreeBSD|NetBSD) + FIND=`${IFCONFIGBINARY} -l` + ;; + Solaris) + FIND=`${IFCONFIGBINARY} -a | ${GREPBINARY} "flags=" | ${AWKBINARY} -F ": " '{ print $1 }'` + ;; + *) + # Having a system currently unsupported? Share your details to determine network interfaces + ReportException "${TEST_NO}:1" "No support for this OS (${OS}) to find available network interfaces" + ;; + esac + if [ ! "${FIND}" = "" ]; then + for I in ${FIND}; do + NETWORK_INTERFACES="${NETWORK_INTERFACES}|${I}" + logtext "Found network interface: ${I}" + N=`expr ${N} + 1` + report "network_interface[]=${I}" + done + else + ReportException "${TEST_NO}:1" "No interfaces found on this system (OS=${OS})" + fi fi # ################################################################################# |