ofproto-dpif: Fix "sFlow packet sampling" tests on BSDs
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Mon, 24 Feb 2014 02:46:22 +0000 (11:46 +0900)
committerBen Pfaff <blp@nicira.com>
Wed, 26 Feb 2014 16:17:40 +0000 (08:17 -0800)
The name of loopback interface is "lo0" on BSDs.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
tests/atlocal.in
tests/ofproto-dpif.at

index 5c0db2a..06e7384 100644 (file)
@@ -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
index 97953d0..8e21d11 100644 (file)
@@ -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.