diff mbox

[ovs-dev,V6,14/17] python tests: Ignore stderr output

Message ID 1467808691-17280-15-git-send-email-pboca@cloudbasesolutions.com
State Superseded
Delegated to: Guru Shetty
Headers show

Commit Message

Paul Boca July 6, 2016, 12:38 p.m. UTC
test-unixctl.py and test-vlog.py outputs on stderr and on Windows
stderr is not overriden by every AT_CHECK call, the logs are only
apended to the file and subsequent AT_CHECKs get errors from previous
call.

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
---
V3: Initial commit
V4: No changes
V5: No changes
V6: Redirect stderr to /dev/null and ignore it in AT_CHECK command
    instead of redirecting it to a file. The detailed explanation for
    this can be found in commit bcbc886ee7fc5725afac7c8cfc56fc3b595b91fb.
    Added same modification for VLOG_CLOSE_PYN in order to enable the
    tests that uses it.
---
 tests/unixctl-py.at |  3 ++-
 tests/vlog.at       | 10 ++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

Comments

Alin Serdean July 6, 2016, 6:34 p.m. UTC | #1
+   AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile \
+     --detach 2>/dev/null], [0], [], [ignore])

Either ignore stderr or 2>/dev/null. In case [ignore] doesn't work please add a comment so others will be aware of the problem

Alin.

> -----Mesaj original-----

> De la: dev [mailto:dev-bounces@openvswitch.org] În numele Paul Boca

> Trimis: Wednesday, July 6, 2016 3:39 PM

> Către: dev@openvswitch.org

> Subiect: [ovs-dev] [PATCH V6 14/17] python tests: Ignore stderr output

> 

> test-unixctl.py and test-vlog.py outputs on stderr and on Windows stderr is

> not overriden by every AT_CHECK call, the logs are only apended to the file

> and subsequent AT_CHECKs get errors from previous call.

> 

> +   AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile \

> +     --detach 2>/dev/null], [0], [], [ignore])

> 

>     AT_CHECK([APPCTL -t test-unixctl.py vlog/list], [0], [dnl

>                   console    syslog    file

> @@ -499,7 +501,7 @@ m4_define([VLOG_RFC5424_PYN],

>  ])

> 

>     AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile \ --

> vFACILITY:daemon --detach])

> +-vFACILITY:daemon --detach], [0], [], [ignore])

> 

>     AT_CHECK([ovs-appctl -t test-unixctl.py vlog/set FACILITY:invalid], [0],

> [Facility invalid is invalid

> --

> 2.7.2.windows.1

> _______________________________________________

> dev mailing list

> dev@openvswitch.org

> http://openvswitch.org/mailman/listinfo/dev
diff mbox

Patch

diff --git a/tests/unixctl-py.at b/tests/unixctl-py.at
index 2031897..0ed3c41 100644
--- a/tests/unixctl-py.at
+++ b/tests/unixctl-py.at
@@ -114,7 +114,8 @@  m4_define([UNIXCTL_SERVER_PYN],
    AT_SKIP_IF([test $2 = no])
    on_exit 'kill `cat test-unixctl.py.pid`'
    AT_CAPTURE_FILE([`pwd`/test-unixctl.py.log])
-   AT_CHECK([$3 $srcdir/test-unixctl.py --log-file --pidfile --detach])
+   AT_CHECK([$3 $srcdir/test-unixctl.py --log-file --pidfile --detach],
+     [0], [], [ignore])
 
    AT_CHECK([APPCTL -t test-unixctl.py help], [0], [stdout])
    AT_CHECK([cat stdout], [0], [dnl
diff --git a/tests/vlog.at b/tests/vlog.at
index b96f394..3a3d435 100644
--- a/tests/vlog.at
+++ b/tests/vlog.at
@@ -192,7 +192,7 @@  m4_define([VLOG_REOPEN_WITHOUT_FILE_PYN],
    AT_SKIP_IF([test $2 = no])
    on_exit 'kill `cat test-unixctl.py.pid`'
 
-   AT_CHECK([$3 $srcdir/test-unixctl.py --pidfile --detach])
+   AT_CHECK([$3 $srcdir/test-unixctl.py --pidfile --detach], [0], [], [ignore])
 
    AT_CHECK([APPCTL -t test-unixctl.py vlog/reopen], [0],
      [Logging to file not configured
@@ -319,7 +319,8 @@  m4_define([VLOG_CLOSE_PYN],
 
    AT_CAPTURE_FILE([log])
    AT_CAPTURE_FILE([log.old])
-   AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach])
+   AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach 2>/dev/null],
+     [0], [], [ignore])
 
    AT_CHECK([APPCTL -t test-unixctl.py log message])
    AT_CHECK([APPCTL -t test-unixctl.py log message2])
@@ -403,7 +404,8 @@  m4_define([VLOG_SET_AND_LIST_PYN],
    on_exit 'kill `cat test-unixctl.py.pid`'
 
    AT_CAPTURE_FILE([log])
-   AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach])
+   AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile \
+     --detach 2>/dev/null], [0], [], [ignore])
 
    AT_CHECK([APPCTL -t test-unixctl.py vlog/list], [0], [dnl
                  console    syslog    file
@@ -499,7 +501,7 @@  m4_define([VLOG_RFC5424_PYN],
 ])
 
    AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile \
--vFACILITY:daemon --detach])
+-vFACILITY:daemon --detach], [0], [], [ignore])
 
    AT_CHECK([ovs-appctl -t test-unixctl.py vlog/set FACILITY:invalid], [0],
 [Facility invalid is invalid