diff mbox

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

Message ID 1447871908-24370-1-git-send-email-cascardo@redhat.com
State Accepted
Headers show

Commit Message

Thadeu Lima de Souza Cascardo Nov. 18, 2015, 6:38 p.m. UTC
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@redhat.com>
---
 lib/netdev-linux.c      | 3 ++-
 tests/ofproto-macros.at | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Ben Pfaff Nov. 23, 2015, 6:20 p.m. UTC | #1
On Wed, Nov 18, 2015 at 04:38:28PM -0200, Thadeu Lima de Souza Cascardo wrote:
> 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@redhat.com>

Thanks, applied to master.
diff mbox

Patch

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']])
 ])