[ovs-dev] [PATCH] ofproto-dpif.at: Make sFlow sampling tests invariant to IP version.

Ilya Maximets i.maximets at samsung.com
Thu Dec 20 17:23:12 UTC 2018


sflow.log reports the first ip address of the 'loopback' interface.
It could be different on different systems. For example, on FreeBSD
IPv6 [::1] address goes first despite of IPv4 127.0.0.1 on Linux.

Let's just replace it to IPv4 always to make tests work.

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
---
 tests/ofproto-dpif.at | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index ff87d903b..836852b90 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -6071,7 +6071,7 @@ m4_define([CHECK_SFLOW_SAMPLING_PACKET],
   OVS_APP_EXIT_AND_WAIT([test-sflow])
 
   AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
-        /g']], [0], [dnl
+        /g' | sed 's/\(.*\)ds=\[::1\]\(.*\)/\1ds=127.0.0.1\2/g' ]], [0], [dnl
 HEADER
         dgramSeqNo=1
         ds=127.0.0.1>2:1000
@@ -6175,7 +6175,7 @@ HEADER
 ])
 
   AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'ETHCOUNTERS|IFCOUNTERS|ERROR|PORTNAME|OPENFLOWPORT' | head -24 | sed 's/ /\
-        /g']], [0], [dnl
+        /g' | sed 's/\(.*\)ds=\[::1\]\(.*\)/\1ds=127.0.0.1\2/g' ]], [0], [dnl
 ETHCOUNTERS
         dot3StatsAlignmentErrors=4294967295
         dot3StatsFCSErrors=4294967295
-- 
2.17.1



More information about the dev mailing list