diff mbox series

[ovs-dev,05/13] ofp-print: Avoid trailing white space in OpenFlow dumps.

Message ID 20171007004458.5788-6-blp@ovn.org
State Accepted
Headers show
Series clustering implementation, part 1 | expand

Commit Message

Ben Pfaff Oct. 7, 2017, 12:44 a.m. UTC
ofp_to_string() sometimes yields a trailing space in its output.  This is
annoying for the test infrastructure, since we have to specially mark the
trailing white space in Autotest with a "@&t@" marker at the end of the
line.  This commit gets rid of the trailing white space and the annoying
"@&t@" markers.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 lib/ofp-print.c    |  1 +
 tests/ofp-print.at | 16 ++++++++--------
 2 files changed, 9 insertions(+), 8 deletions(-)

Comments

Russell Bryant Oct. 7, 2017, 2:27 a.m. UTC | #1
On Fri, Oct 6, 2017 at 8:44 PM, Ben Pfaff <blp@ovn.org> wrote:
> ofp_to_string() sometimes yields a trailing space in its output.  This is
> annoying for the test infrastructure, since we have to specially mark the
> trailing white space in Autotest with a "@&t@" marker at the end of the
> line.  This commit gets rid of the trailing white space and the annoying
> "@&t@" markers.
>
> Signed-off-by: Ben Pfaff <blp@ovn.org>

Acked-by: Russell Bryant <russell@ovn.org>
Ben Pfaff Oct. 7, 2017, 4:02 a.m. UTC | #2
On Fri, Oct 06, 2017 at 10:27:34PM -0400, Russell Bryant wrote:
> On Fri, Oct 6, 2017 at 8:44 PM, Ben Pfaff <blp@ovn.org> wrote:
> > ofp_to_string() sometimes yields a trailing space in its output.  This is
> > annoying for the test infrastructure, since we have to specially mark the
> > trailing white space in Autotest with a "@&t@" marker at the end of the
> > line.  This commit gets rid of the trailing white space and the annoying
> > "@&t@" markers.
> >
> > Signed-off-by: Ben Pfaff <blp@ovn.org>
> 
> Acked-by: Russell Bryant <russell@ovn.org>

Thanks for the reviews.  I applied patches 1 through 5 to master.
diff mbox series

Patch

diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index f77b31baf0b4..151d618b59e8 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -3791,6 +3791,7 @@  ofp_to_string(const void *oh_, size_t len,
         error = ofpraw_decode(&raw, oh);
         if (!error) {
             ofp_to_string__(oh, port_map, raw, &string, verbosity);
+            ds_chomp(&string, ' ');
             if (verbosity >= 5) {
                 if (ds_last(&string) != '\n') {
                     ds_put_char(&string, '\n');
diff --git a/tests/ofp-print.at b/tests/ofp-print.at
index a00e3f3fe74b..50083a34d556 100644
--- a/tests/ofp-print.at
+++ b/tests/ofp-print.at
@@ -1355,7 +1355,7 @@  ff fe 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
 00 00 00 00 ff 00 ff ff \
 "], [0], [dnl
-OFPST_FLOW request (xid=0x4): @&t@
+OFPST_FLOW request (xid=0x4):
 ])
 AT_CLEANUP
 
@@ -1367,7 +1367,7 @@  ff 00 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 \
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
 00 01 00 04 00 00 00 00 \
 "], [0], [dnl
-OFPST_FLOW request (OF1.2) (xid=0x2): @&t@
+OFPST_FLOW request (OF1.2) (xid=0x2):
 ])
 AT_CLEANUP
 
@@ -1379,7 +1379,7 @@  ff 00 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 \
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
 00 01 00 04 00 00 00 00 \
 "], [0], [dnl
-OFPST_FLOW request (OF1.3) (xid=0x2): @&t@
+OFPST_FLOW request (OF1.3) (xid=0x2):
 ])
 AT_CLEANUP
 
@@ -1470,7 +1470,7 @@  ff fe 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
 00 00 00 00 ff 00 ff ff \
 "], [0], [dnl
-OFPST_AGGREGATE request (xid=0x4): @&t@
+OFPST_AGGREGATE request (xid=0x4):
 ])
 AT_CLEANUP
 
@@ -1482,7 +1482,7 @@  ff 00 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 \
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
 00 01 00 04 00 00 00 00 \
 "], [0], [dnl
-OFPST_AGGREGATE request (OF1.2) (xid=0x2): @&t@
+OFPST_AGGREGATE request (OF1.2) (xid=0x2):
 ])
 AT_CLEANUP
 
@@ -1494,7 +1494,7 @@  ff 00 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 \
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
 00 01 00 04 00 00 00 00 \
 "], [0], [dnl
-OFPST_AGGREGATE request (OF1.3) (xid=0x2): @&t@
+OFPST_AGGREGATE request (OF1.3) (xid=0x2):
 ])
 AT_CLEANUP
 
@@ -3256,7 +3256,7 @@  AT_CHECK([ovs-ofctl ofp-print "\
 01 10 00 20 00 00 00 04 ff ff 00 00 00 00 23 20 \
 00 00 00 00 00 00 00 00 ff ff 00 00 ff 00 00 00 \
 "], [0], [dnl
-NXST_FLOW request (xid=0x4): @&t@
+NXST_FLOW request (xid=0x4):
 ])
 AT_CLEANUP
 
@@ -3420,7 +3420,7 @@  AT_CHECK([ovs-ofctl ofp-print "\
 01 10 00 20 00 00 00 04 ff ff 00 00 00 00 23 20 \
 00 00 00 01 00 00 00 00 ff ff 00 00 ff 00 00 00 \
 "], [0], [dnl
-NXST_AGGREGATE request (xid=0x4): @&t@
+NXST_AGGREGATE request (xid=0x4):
 ])
 AT_CLEANUP