Makefile.am: Clean flake8-check too.
[cascardo/ovs.git] / tests / ovsdb-tool.at
index e4f4a29..3c2e628 100644 (file)
@@ -23,7 +23,7 @@ m4_define([OVSDB_CHECK_EXECUTION],
      [AT_CHECK([ovsdb-tool transact db 'txn'], [0], [stdout], [ignore])
 cat stdout >> output
 ])
-   AT_CHECK([perl $srcdir/uuidfilt.pl output], [0], [$4])
+   AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [$4])
    AT_CLEANUP])
 
 EXECUTION_EXAMPLES
@@ -40,7 +40,7 @@ AT_CHECK([[ovsdb-tool transact db '
       "row": {"name": "five", "number": 5}},
      {"op": "comment",
       "comment": "add row for 5"}]']], [0], [stdout], [ignore])
-AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0],
+AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0],
  [[[{"uuid":["uuid","<0>"]},{}]
 ]])
 AT_CHECK([grep "add row for 5" db], [0], [ignore])
@@ -89,7 +89,7 @@ AT_CHECK(
     done]],
   [0], [stdout], [ignore])
 dnl Check that all the crap is in fact in the database log.
-AT_CHECK([[perl $srcdir/uuidfilt.pl db | grep -v ^OVSDB | sed 's/"_date":[0-9]*/"_date":0/' | test-json --multiple -]], [0],
+AT_CHECK([[${PERL} $srcdir/uuidfilt.pl db | grep -v ^OVSDB | sed 's/"_date":[0-9]*/"_date":0/' | ovstest test-json --multiple -]], [0],
   [[{"cksum":"12345678 9","name":"ordinals","tables":{"ordinals":{"columns":{"name":{"type":"string"},"number":{"type":"integer"}},"indexes":[["number"]]}},"version":"5.1.3"}
 {"_comment":"add row for zero 0","_date":0,"ordinals":{"<0>":{"name":"zero"}}}
 {"_comment":"delete row for 0","_date":0,"ordinals":{"<0>":null}}
@@ -113,7 +113,7 @@ AT_CHECK([[perl $srcdir/uuidfilt.pl db | grep -v ^OVSDB | sed 's/"_date":[0-9]*/
 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]],
   [0], [stdout], [ignore])
-AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
+AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
 ordinals table
 _uuid                                name  number
 ------------------------------------ ----- ------
@@ -140,7 +140,7 @@ 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]],
   [0], [stdout], [ignore])
-AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
+AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
 ordinals table
 _uuid                                name  number
 ------------------------------------ ----- ------
@@ -179,9 +179,10 @@ 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]],
-  [0], [stdout], [ignore])
-AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
+AT_CHECK([[ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db]],
+  [0])
+AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore])
+AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
 ordinals table
 _uuid                                name  number
 ------------------------------------ ----- ------
@@ -192,6 +193,7 @@ _uuid                                name  number
 <4> two   2     @&t@
 <5> zero  0     @&t@
 ])
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 dnl Now convert the database in-place.
 touch .db.tmp.~lock~
 AT_CHECK([[ovsdb-tool convert db new-schema]], [0], [], [ignore])
@@ -201,9 +203,10 @@ dnl in it now.
 AT_CAPTURE_FILE([db])
 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]],
-  [0], [stdout], [ignore])
-AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
+AT_CHECK([[ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db]],
+  [0])
+AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore])
+AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
 ordinals table
 _uuid                                number
 ------------------------------------ ------
@@ -214,6 +217,7 @@ _uuid                                number
 <4> 4     @&t@
 <5> 5     @&t@
 ])
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 AT_CLEANUP
 
 AT_SETUP([ovsdb-tool convert -- adding a column])
@@ -241,9 +245,10 @@ 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]],
-  [0], [stdout], [ignore])
-AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
+AT_CHECK([[ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db]],
+  [0])
+AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore])
+AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
 ordinals table
 _uuid                                number
 ------------------------------------ ------
@@ -254,6 +259,7 @@ _uuid                                number
 <4> 4     @&t@
 <5> 5     @&t@
 ])
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 dnl Now convert the database in-place.
 touch .db.tmp.~lock~
 AT_CHECK([[ovsdb-tool convert db new-schema]], [0], [], [ignore])
@@ -263,9 +269,10 @@ dnl in it now.
 AT_CAPTURE_FILE([db])
 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]],
-  [0], [stdout], [ignore])
-AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
+AT_CHECK([[ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db]],
+  [0])
+AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore])
+AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
 ordinals table
 _uuid                                name number
 ------------------------------------ ---- ------
@@ -276,6 +283,7 @@ _uuid                                name number
 <4> ""   4     @&t@
 <5> ""   5     @&t@
 ])
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 AT_CLEANUP
 
 AT_SETUP([ovsdb-tool schema-version])