tests: Handle different output formats for 'wc -l'.
[sliver-openvswitch.git] / tests / ovsdb-tool.at
index 4bc582c..87949bb 100644 (file)
@@ -101,7 +101,7 @@ AT_CHECK([[perl $srcdir/uuidfilt.pl db | grep -v ^OVSDB | sed 's/"_date":[0-9]*/
 {"_comment":"add back row for five 5","_date":0,"ordinals":{"<11>":{"name":"five","number":5}}}
 ]])
 dnl Dump out and check the actual database contents.
-AT_CHECK([[ovsdb-server --unixctl=$PWD/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
+AT_CHECK([[ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
   [0], [stdout], [ignore])
 AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
 ordinals table
@@ -121,10 +121,9 @@ dnl We can't fully re-check the contents of the database log, because the
 dnl order of the records is not predictable, but there should only be 4 lines
 dnl in it now.
 AT_CAPTURE_FILE([db])
-AT_CHECK([wc -l < db], [0], [4
-])
+AT_CHECK([test `wc -l < db` -eq 4])
 dnl And check that the dumped data is the same too:
-AT_CHECK([[ovsdb-server --unixctl=$PWD/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
+AT_CHECK([[ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
   [0], [stdout], [ignore])
 AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
 ordinals table
@@ -165,7 +164,7 @@ AT_CHECK(
     done]],
   [0], [stdout], [ignore])
 dnl Dump out and check the actual database contents.
-AT_CHECK([[ovsdb-server --unixctl=$PWD/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
+AT_CHECK([[ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
   [0], [stdout], [ignore])
 AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
 ordinals table
@@ -185,10 +184,9 @@ dnl We can't fully re-check the contents of the database log, because the
 dnl order of the records is not predictable, but there should only be 4 lines
 dnl in it now.
 AT_CAPTURE_FILE([db])
-AT_CHECK([wc -l < db], [0], [4
-])
+AT_CHECK([test `wc -l < db` -eq 4])
 dnl And check that the dumped data is the same except for the removed column:
-AT_CHECK([[ovsdb-server --unixctl=$PWD/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
+AT_CHECK([[ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
   [0], [stdout], [ignore])
 AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
 ordinals table
@@ -228,7 +226,7 @@ AT_CHECK(
     done]],
   [0], [stdout], [ignore])
 dnl Dump out and check the actual database contents.
-AT_CHECK([[ovsdb-server --unixctl=$PWD/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
+AT_CHECK([[ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
   [0], [stdout], [ignore])
 AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
 ordinals table
@@ -248,10 +246,9 @@ dnl We can't fully re-check the contents of the database log, because the
 dnl order of the records is not predictable, but there should only be 4 lines
 dnl in it now.
 AT_CAPTURE_FILE([db])
-AT_CHECK([wc -l < db], [0], [4
-])
+AT_CHECK([test `wc -l < db` -eq 4])
 dnl And check that the dumped data is the same except for the added column:
-AT_CHECK([[ovsdb-server --unixctl=$PWD/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
+AT_CHECK([[ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
   [0], [stdout], [ignore])
 AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
 ordinals table