[ovs-dev] [PATCH] prevent test failures when there are non Ethernet devices on the system

Thadeu Lima de Souza Cascardo cascardo at redhat.com
Wed Nov 18 18:38:28 UTC 2015


When there are PtP TUN devices on the system or SIT devices, tests will fail
because of a warning that it was not possible to get their Ethernet addresses.
That call comes from the route code adding tunnel ports.

Make that warning an informational message and filter that out during tests.

Also, return EINVAL when trying to get those interface Ethernet addresses, which
will prevent them from being added to the tunnel ports pool and will properly
fail in other places as well.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at redhat.com>
---
 lib/netdev-linux.c      | 3 ++-
 tests/ofproto-macros.at | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 584e804..e047be5 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -5516,8 +5516,9 @@ get_etheraddr(const char *netdev_name, struct eth_addr *ea)
     }
     hwaddr_family = ifr.ifr_hwaddr.sa_family;
     if (hwaddr_family != AF_UNSPEC && hwaddr_family != ARPHRD_ETHER) {
-        VLOG_WARN("%s device has unknown hardware address family %d",
+        VLOG_INFO("%s device has unknown hardware address family %d",
                   netdev_name, hwaddr_family);
+        return EINVAL;
     }
     memcpy(ea, ifr.ifr_hwaddr.sa_data, ETH_ADDR_LEN);
     return 0;
diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at
index fcd36fb..e808258 100644
--- a/tests/ofproto-macros.at
+++ b/tests/ofproto-macros.at
@@ -268,6 +268,7 @@ m4_define([_OVS_VSWITCHD_START],
 /vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d
 /reconnect|INFO|/d
 /ofproto|INFO|using datapath ID/d
+/netdev_linux|INFO|.*device has unknown hardware address family/d
 /ofproto|INFO|datapath ID changed to fedcba9876543210/d']])
 ])
 
-- 
2.5.0




More information about the dev mailing list