[ovs-dev] [PATCH] tests: offline compacting on Windows
Ben Pfaff
blp at ovn.org
Tue Nov 1 22:36:53 UTC 2016
On Thu, Oct 27, 2016 at 08:33:35PM +0000, Alin Serdean wrote:
> This patch adds the offline compacting (ovsdb-tool compact) to be run on
> Windows.
>
> On Windows we are missing "--run" so in return we start ovsdb-server,
> run the ovsdb-client dump command and after issue a command to the
> ovsdb-server to close.
>
> Also on Windows we do not check for symlinks, so skip the tests for it.
>
> Signed-off-by: Alin Gabriel Serdean <aserdean at cloudbasesolutions.com>
Thanks for the patch.
I think it's better for tests to be as similar as they can on different
OSes, so I made the elimination of --run be universal instead of just on
Windows. Other tests do use --run so it still has some test coverage.
I folded in the following and applied this to master.
--8<--------------------------cut here-------------------------->8--
diff --git a/tests/ovsdb-tool.at b/tests/ovsdb-tool.at
index 8b397c2..2d0f2aa 100644
--- a/tests/ovsdb-tool.at
+++ b/tests/ovsdb-tool.at
@@ -114,18 +114,15 @@ AT_CHECK([[${PERL} $srcdir/uuidfilt.pl db | grep -v ^OVSDB | sed 's/"_date":[0-9
{"_comment":"delete row for 5","_date":0,"ordinals":{"<10>":null}}
{"_comment":"add back row for five 5","_date":0,"ordinals":{"<11>":{"name":"five","number":5}}}
]])
+
dnl Dump out and check the actual database contents.
-if test "$IS_WIN32" = "yes"; then
- dnl XXX Windows does not have --run command
- AT_CHECK([[ovsdb-server --detach --pidfile --no-chdir --remote=punix:socket db]],
- [0], [stdout], [ignore])
- AT_CHECK([[ovsdb-client dump unix:socket ordinals]],
- [0], [stdout], [ignore])
- OVS_APP_EXIT_AND_WAIT([ovsdb-server])
-else
- AT_CHECK([[ovsdb-server --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
- [0], [stdout], [ignore])
-fi
+on_exit 'kill `cat ovsdb-server.pid`'
+AT_CHECK([[ovsdb-server --detach --pidfile --no-chdir --remote=punix:socket db]],
+ [0], [stdout], [ignore])
+AT_CHECK([[ovsdb-client dump unix:socket ordinals]],
+ [0], [stdout], [ignore])
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
+
AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
ordinals table
_uuid name number
@@ -153,17 +150,12 @@ 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 too:
-if test "$IS_WIN32" = "yes"; then
- dnl XXX Windows does not have --run command
- AT_CHECK([[ovsdb-server --detach --pidfile --no-chdir --remote=punix:socket db]],
- [0], [stdout], [ignore])
- AT_CHECK([[ovsdb-client dump unix:socket ordinals]],
- [0], [stdout], [ignore])
- OVS_APP_EXIT_AND_WAIT([ovsdb-server])
-else
- AT_CHECK([[ovsdb-server --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
- [0], [stdout], [ignore])
-fi
+AT_CHECK([[ovsdb-server --detach --pidfile --no-chdir --remote=punix:socket db]],
+ [0], [stdout], [ignore])
+AT_CHECK([[ovsdb-client dump unix:socket ordinals]],
+ [0], [stdout], [ignore])
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
+
AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl
ordinals table
_uuid name number
More information about the dev
mailing list