Extend the already existing ofctl_strip() to also ignore n_packets, n_bytes, cookie. Use some helper functions from tests/system-userspace-packet-type-aware.at, which will be removed by a future commit.
Signed-off-by: Dumitru Ceara <dce...@redhat.com> Signed-off-by: Numan Siddique <num...@ovn.org> (cherry picked from commit 0879a0aa9f332bdc689769a1bc2f156f1c3149a5) Signed-off-by: Frode Nordahl <frode.nord...@canonical.com> --- tests/ofproto-macros.at | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at index 6c4ff60e7..22999c1ca 100644 --- a/tests/ofproto-macros.at +++ b/tests/ofproto-macros.at @@ -1,12 +1,27 @@ m4_divert_push([PREPARE_TESTS]) [ +# Strips 'n_packets=...' from ovs-ofctl output. +strip_n_packets () { + sed 's/ n_packets=[0-9]*,//' +} + +# Strips 'n_bytes=...' from ovs-ofctl output. +strip_n_bytes () { + sed 's/ n_bytes=[0-9]*,//' +} + +# Strips 'cookie=...' from ovs-ofctl output. +strip_cookie () { + sed 's/ cookie=0x[0-9a-fA-F]*,//' +} + # Strips out uninteresting parts of ovs-ofctl output, as well as parts # that vary from one run to another. ofctl_strip () { sed ' s/ (xid=0x[0-9a-fA-F]*)// s/ duration=[0-9.]*s,// -s/ cookie=0x0,// +s/ cookie=0,// s/ table=0,// s/ n_packets=0,// s/ n_bytes=0,// @@ -19,6 +34,12 @@ s/dir\/[0-9]*\/br0.mgmt/dir\/XXXX\/br0.mgmt/ ' } +# Strips out uninteresting parts of ovs-ofctl output, including n_packets=.. +# n_bytes=.. +ofctl_strip_all () { + ofctl_strip | strip_n_packets | strip_n_bytes | strip_cookie +} + # Filter (multiline) vconn debug messages from ovs-vswitchd.log. # Use with vconn_sub() and ofctl_strip() print_vconn_debug () { awk -F\| < ovs-vswitchd.log ' -- 2.30.0 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev