From 9a9808d7955b4cf50b6aac34101a68d76b173d63 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 24 Feb 2014 11:46:22 +0900 Subject: [PATCH] ofproto-dpif: Fix "sFlow packet sampling" tests on BSDs The name of loopback interface is "lo0" on BSDs. Signed-off-by: YAMAMOTO Takashi Signed-off-by: Ben Pfaff --- tests/atlocal.in | 10 ++++++++++ tests/ofproto-dpif.at | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/atlocal.in b/tests/atlocal.in index 5c0db2a78..06e738434 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -68,3 +68,13 @@ FreeBSD) esac export MALLOC_CONF esac + +# The name of loopback interface +case `uname` in +Linux) + LOOPBACK_INTERFACE=lo + ;; +FreeBSD|NetBSD) + LOOPBACK_INTERFACE=lo0 + ;; +esac diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index 97953d09e..8e21d11f7 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -2366,7 +2366,7 @@ m4_define([CHECK_SFLOW_SAMPLING_PACKET], set Interface p2 options:ifindex=1003 -- \ set Bridge br0 sflow=@sf -- \ --id=@sf create sflow targets=\"$1:$SFLOW_PORT\" \ - header=128 sampling=1 polling=1 agent=lo + header=128 sampling=1 polling=1 agent=$LOOPBACK_INTERFACE dnl open with ARP packets to seed the bridge-learning. The output dnl ifIndex numbers should be reported predictably after that. -- 2.47.0