From 49c1bf8d55fef9e0c5057c9b134edbc39da13017 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Thu, 3 Aug 2017 20:28:38 +0200 Subject: [PATCH] [NETW-3006] Updated detection of MAC addresses on Linux --- include/tests_networking | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/tests_networking b/include/tests_networking index ddb846d2..49b5b45d 100644 --- a/include/tests_networking +++ b/include/tests_networking @@ -266,6 +266,10 @@ Linux) if [ ! -z "${IFCONFIGBINARY}" ]; then FIND=$(${IFCONFIGBINARY} -a 2> /dev/null | ${GREPBINARY} "HWaddr" | ${AWKBINARY} '{ if ($4=="HWaddr") print $5 }' | ${SORTBINARY} -u) + # CentOS 7.x and others may return nothing. Let's retry with 'ether' field. + if [ -z "${FIND}" ]; then + FIND=$(${IFCONFIGBINARY} -a 2> /dev/null | ${AWKBINARY} '{ if ($1=="ether") print $2 }' | ${SORTBINARY} -u) + fi else if [ ! -z "${IPBINARY}" ]; then LogText "Test: Using ip binary to gather hardware addresses"