2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-21 14:49:41 +00:00

table: Avoid trailing white space in tables.

Commands that use the table library, such as ovs-vsctl and  "ovsdb-client
dump", print trailing white space in tabular output, to fill out the entire
width of their tabular columns.  This is annoying whenever we use these
commands in 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>
This commit is contained in:
Ben Pfaff
2017-09-14 15:31:48 -07:00
parent 44074babd0
commit e51d0a1d5a
4 changed files with 64 additions and 61 deletions

View File

@@ -214,6 +214,9 @@ table_add_cell(struct table *table)
static void
table_print_table_line__(struct ds *line)
{
while (ds_last(line) == ' ') {
line->length--;
}
puts(ds_cstr(line));
ds_clear(line);
}

View File

@@ -41,7 +41,7 @@ OVSDB_CHECK_REPLICATION([insert monitored table, insert excluded table],
[[8,10c8,9
< _uuid name number
< ------------------------------------ ---- ------
< <0> one 1 @&t@
< <0> one 1
---
> _uuid name number
> ----- ---- ------]]
@@ -69,7 +69,7 @@ OVSDB_CHECK_REPLICATION([insert monitored table, update excluded table],
[[8,10c8,9
< _uuid name number
< ------------------------------------ ---- ------
< <0> two 2 @&t@
< <0> two 2
---
> _uuid name number
> ----- ---- ------]]
@@ -93,7 +93,7 @@ OVSDB_CHECK_REPLICATION([update monitored table, insert excluded table],
[[7,9c7,8
< _uuid name number
< ------------------------------------ ---- ------
< <0> two 2 @&t@
< <0> two 2
---
> _uuid name number
> ----- ---- ------]]
@@ -122,7 +122,7 @@ OVSDB_CHECK_REPLICATION([update monitored table, update excluded table],
[[7,9c7,8
< _uuid name number
< ------------------------------------ ----- ------
< <0> three 3 @&t@
< <0> three 3
---
> _uuid name number
> ----- ---- ------]]
@@ -149,7 +149,7 @@ OVSDB_CHECK_REPLICATION([delete monitored table, insert excluded table],
[[7,9c7,8
< _uuid name number
< ------------------------------------ ---- ------
< <0> one 1 @&t@
< <0> one 1
---
> _uuid name number
> ----- ---- ------]]
@@ -181,7 +181,7 @@ OVSDB_CHECK_REPLICATION([delete monitored table, update excluded table],
[[7,9c7,8
< _uuid name number
< ------------------------------------ ---- ------
< <0> two 2 @&t@
< <0> two 2
---
> _uuid name number
> ----- ---- ------]]

View File

@@ -689,12 +689,12 @@ AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
ordinals table
_uuid name number
------------------------------------ ----- ------
<0> five 5 @&t@
<1> four 4 @&t@
<2> one 1 @&t@
<3> three 3 @&t@
<4> two 2 @&t@
<5> zero 0 @&t@
<0> five 5
<1> four 4
<2> one 1
<3> three 3
<4> two 2
<5> zero 0
], [], [test ! -e pid || kill `cat pid`])
dnl Now compact the database in-place.
AT_CHECK([[ovs-appctl -t ovsdb-server ovsdb-server/compact]],
@@ -720,12 +720,12 @@ AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
ordinals table
_uuid name number
------------------------------------ ----- ------
<0> five 5 @&t@
<1> four 4 @&t@
<2> one 1 @&t@
<3> three 3 @&t@
<4> two 2 @&t@
<5> zero 0 @&t@
<0> five 5
<1> four 4
<2> one 1
<3> three 3
<4> two 2
<5> zero 0
], [], [test ! -e pid || kill `cat pid`])
dnl Now do some more transactions.
AT_CHECK(
@@ -750,9 +750,9 @@ AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
ordinals table
_uuid name number
------------------------------------ ----- ------
<0> five 5 @&t@
<1> four 4 @&t@
<2> three 3 @&t@
<0> five 5
<1> four 4
<2> three 3
], [], [test ! -e pid || kill `cat pid`])
OVSDB_SERVER_SHUTDOWN
AT_CLEANUP
@@ -1223,7 +1223,7 @@ cat stdout > output
AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [7,9c7,8
< _uuid name number
< ------------------------------------ ---- ------
< <0> one 1 @&t@
< <0> one 1
---
> _uuid name number
> ----- ---- ------
@@ -1325,7 +1325,7 @@ cat stdout > output
AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [7,9c7,8
< _uuid name number
< ------------------------------------ ---- ------
< <0> one 1 @&t@
< <0> one 1
---
> _uuid name number
> ----- ---- ------
@@ -1344,12 +1344,12 @@ cat stdout > output
AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [a table
_uuid name number
------------------------------------ ---- ------
<0> zero 0 @&t@
<0> zero 0
b table
_uuid name number
------------------------------------ ---- ------
<1> one 1 @&t@
<1> one 1
])
OVSDB_SERVER_SHUTDOWN

View File

@@ -127,12 +127,12 @@ AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
ordinals table
_uuid name number
------------------------------------ ----- ------
<0> five 5 @&t@
<1> four 4 @&t@
<2> one 1 @&t@
<3> three 3 @&t@
<4> two 2 @&t@
<5> zero 0 @&t@
<0> five 5
<1> four 4
<2> one 1
<3> three 3
<4> two 2
<5> zero 0
])
dnl Now compact the database in-place.
touch .db.tmp.~lock~
@@ -160,12 +160,12 @@ AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
ordinals table
_uuid name number
------------------------------------ ----- ------
<0> five 5 @&t@
<1> four 4 @&t@
<2> one 1 @&t@
<3> three 3 @&t@
<4> two 2 @&t@
<5> zero 0 @&t@
<0> five 5
<1> four 4
<2> one 1
<3> three 3
<4> two 2
<5> zero 0
])
AT_CLEANUP
@@ -202,12 +202,12 @@ AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
ordinals table
_uuid name number
------------------------------------ ----- ------
<0> five 5 @&t@
<1> four 4 @&t@
<2> one 1 @&t@
<3> three 3 @&t@
<4> two 2 @&t@
<5> zero 0 @&t@
<0> five 5
<1> four 4
<2> one 1
<3> three 3
<4> two 2
<5> zero 0
])
OVS_APP_EXIT_AND_WAIT([ovsdb-server])
dnl Now convert the database in-place.
@@ -226,12 +226,12 @@ AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
ordinals table
_uuid number
------------------------------------ ------
<0> 0 @&t@
<1> 1 @&t@
<2> 2 @&t@
<3> 3 @&t@
<4> 4 @&t@
<5> 5 @&t@
<0> 0
<1> 1
<2> 2
<3> 3
<4> 4
<5> 5
])
OVS_APP_EXIT_AND_WAIT([ovsdb-server])
AT_CLEANUP
@@ -268,12 +268,12 @@ AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
ordinals table
_uuid number
------------------------------------ ------
<0> 0 @&t@
<1> 1 @&t@
<2> 2 @&t@
<3> 3 @&t@
<4> 4 @&t@
<5> 5 @&t@
<0> 0
<1> 1
<2> 2
<3> 3
<4> 4
<5> 5
])
OVS_APP_EXIT_AND_WAIT([ovsdb-server])
dnl Now convert the database in-place.
@@ -292,12 +292,12 @@ AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
ordinals table
_uuid name number
------------------------------------ ---- ------
<0> "" 0 @&t@
<1> "" 1 @&t@
<2> "" 2 @&t@
<3> "" 3 @&t@
<4> "" 4 @&t@
<5> "" 5 @&t@
<0> "" 0
<1> "" 1
<2> "" 2
<3> "" 3
<4> "" 4
<5> "" 5
])
OVS_APP_EXIT_AND_WAIT([ovsdb-server])
AT_CLEANUP