[ovs-dev] [PATCH 1/5] ovsdb-monitor.at: Changes for Windows.

Gurucharan Shetty shettyg at nicira.com
Mon May 19 19:52:22 UTC 2014


ovsdb-client's 'monitor' command works with --detach such
that the parent detaches after printing initial transactions in
the database. This is a little tricky to implement
in windows. So for windows, send the process to background with
'&' and then sleep for a second to let the intial transactions
printed. (We can do the same for Linux, but it slows down the
test run)

Also let the perl script that looks at the o/p be aware of
CR LF in windows.

Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
---
 tests/ovsdb-monitor-sort.pl |    3 +++
 tests/ovsdb-monitor.at      |    8 +++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/tests/ovsdb-monitor-sort.pl b/tests/ovsdb-monitor-sort.pl
index 12034f7..24f3ffc 100755
--- a/tests/ovsdb-monitor-sort.pl
+++ b/tests/ovsdb-monitor-sort.pl
@@ -30,6 +30,9 @@ sub output_group {
     print "$_\n" foreach sort { compare_lines($a, $b) } @group;
 }
 
+if ("$^O" eq "msys") {
+    $/ = "\r\n";
+}
 my @group = ();
 while (<STDIN>) {
     chomp;
diff --git a/tests/ovsdb-monitor.at b/tests/ovsdb-monitor.at
index d24ae91..016aa2c 100644
--- a/tests/ovsdb-monitor.at
+++ b/tests/ovsdb-monitor.at
@@ -27,8 +27,14 @@ m4_define([OVSDB_CHECK_MONITOR],
    AT_CAPTURE_FILE([ovsdb-server-log])
    AT_CHECK([ovsdb-server --detach --no-chdir --pidfile="`pwd`"/server-pid --remote=punix:socket --unixctl="`pwd`"/unixctl --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1],
             [0], [], [])
-   AT_CHECK([ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket $4 $5 $8 > output], 
+   if test "$IS_WIN32" = "yes"; then
+     AT_CHECK([ovsdb-client -vjsonrpc --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket $4 $5 $8 > output &],
+              [0], [ignore], [ignore], [kill `cat server-pid`])
+     sleep 1
+   else
+     AT_CHECK([ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket $4 $5 $8 > output],
             [0], [ignore], [ignore], [kill `cat server-pid`])
+   fi
    m4_foreach([txn], [$6],
      [AT_CHECK([ovsdb-client transact unix:socket 'txn'], [0],
                      [ignore], [ignore], [kill `cat server-pid client-pid`])])
-- 
1.7.9.5




More information about the dev mailing list