diff mbox

[ovs-dev,1/6] tests: Strip more variable output from conntrack output.

Message ID 1446088078-32610-1-git-send-email-jrajahalme@nicira.com
State Accepted
Headers show

Commit Message

Jarno Rajahalme Oct. 29, 2015, 3:07 a.m. UTC
'conntrack' output format varies depending on the system
configuration, i.e., conntrack accounting or timestamping is enabled.
Modify the FORMAT_CT() macro to hide these differences.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
---
 tests/system-common-macros.at | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Joe Stringer Nov. 4, 2015, 7 p.m. UTC | #1
On 28 October 2015 at 20:07, Jarno Rajahalme <jrajahalme@nicira.com> wrote:
> 'conntrack' output format varies depending on the system
> configuration, i.e., conntrack accounting or timestamping is enabled.
> Modify the FORMAT_CT() macro to hide these differences.
>
> Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>

Acked-by: Joe Stringer <joestringer@nicira.com>
Jarno Rajahalme Nov. 7, 2015, 2:56 a.m. UTC | #2
Pushed to master, thanks for the review!

  Jarno

> On Nov 4, 2015, at 11:00 AM, Joe Stringer <joestringer@nicira.com> wrote:
> 
> On 28 October 2015 at 20:07, Jarno Rajahalme <jrajahalme@nicira.com> wrote:
>> 'conntrack' output format varies depending on the system
>> configuration, i.e., conntrack accounting or timestamping is enabled.
>> Modify the FORMAT_CT() macro to hide these differences.
>> 
>> Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
> 
> Acked-by: Joe Stringer <joestringer@nicira.com>
diff mbox

Patch

diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at
index f0da589..7836f65 100644
--- a/tests/system-common-macros.at
+++ b/tests/system-common-macros.at
@@ -122,10 +122,16 @@  m4_define([FORMAT_PING], [grep "transmitted" | sed 's/time.*ms$/time 0ms/'])
 # FORMAT_CT()
 #
 # Strip content from the piped input which would differ from test to test.
-#
+# Strip also content that depends on the system setup (accounting,
+# timestamping)
 m4_define([FORMAT_CT],
     [[grep "dst=$1" | sed -e 's/port=[0-9]*/port=<cleared>/g' -e 's/  */ /g' \
                           -e 's/secctx[^ ]* //' \
+                          -e 's/packets=[^ ]* //' \
+                          -e 's/bytes=[^ ]* //' \
+                          -e 's/packets=[^ ]* //' \
+                          -e 's/bytes=[^ ]* //' \
+                          -e 's/delta-time=[^ ]* //' \
                           -e 's/id=[0-9]*/id=<cleared>/g' \
                     | cut -d' ' -f4- | sort | uniq]])