[ovs-dev] [PATCH] tests: Skip vlog close and set if no python is installed

Alin Serdean aserdean at cloudbasesolutions.com
Mon Jun 6 20:21:26 UTC 2016


That will disable the test if it is under 

> -----Mesaj original-----
> De la: dev [mailto:dev-bounces at openvswitch.org] În numele Paul Boca
> Trimis: Friday, June 3, 2016 4:07 PM
> Către: dev at openvswitch.org
> Subiect: [ovs-dev] [PATCH] tests: Skip vlog close and set if no python is
> installed
> 
> AT_CAPTURE_FILE([log.old]) and AT_CAPTURE_FILE([log]) will fail in case no
> python is installed on the system
[Alin Gabriel Serdean: ] AT_CAPTURE_FILE will not fail if python is installed or not
The python tests for vlog/close and vlog/set are disabled please see:
https://github.com/openvswitch/ovs/blob/master/tests/vlog.at#L350-L351
and
https://github.com/openvswitch/ovs/blob/master/tests/vlog.at#L450-L451

To skip the test please see:
https://github.com/openvswitch/ovs/blob/master/tests/vlog.at#L115-L118

Although we could make it work :).

I tried to fix under windows and came up with the following it can be improved and also tested under linux :):
$ git diff tests/vlog.at
diff --git a/tests/vlog.at b/tests/vlog.at
index b793611..ce0604b 100644
--- a/tests/vlog.at
+++ b/tests/vlog.at
@@ -277,27 +277,26 @@ on_exit 'kill `cat test-unixctl.pid`'

 AT_CAPTURE_FILE([log])
 AT_CAPTURE_FILE([log.old])
-AT_CHECK([ovstest test-unixctl --log-file=`pwd`/log --pidfile --detach],
+AT_CHECK([ovstest test-unixctl --log-file=`pwd`/log --pidfile=`pwd`/pid --unixctl=`pwd`/ctl --detach],
   [0], [], [stderr])
-AT_CHECK([vlog_filt stderr], [0], [opened log file
-])

-AT_CHECK([APPCTL -t test-unixctl log message])
-AT_CHECK([APPCTL -t test-unixctl log message2])
+
+AT_CHECK([APPCTL -t `pwd`/ctl log message])
+AT_CHECK([APPCTL -t `pwd`/ctl log message2])

 # After closing the log file, message3 won't appear anywhere.
-AT_CHECK([APPCTL -t test-unixctl vlog/close])
+AT_CHECK([APPCTL -t `pwd`/ctl vlog/close])
 mv log log.old
-AT_CHECK([APPCTL -t test-unixctl log message3])
+AT_CHECK([APPCTL -t `pwd`/ctl log message3])

 # Closing the log file again is harmless.
-AT_CHECK([APPCTL -t test-unixctl vlog/close])
-AT_CHECK([APPCTL -t test-unixctl log message4])
+AT_CHECK([APPCTL -t `pwd`/ctl vlog/close])
+AT_CHECK([APPCTL -t `pwd`/ctl log message4])

 # After reopening the log file, further messages start appearing again.
-AT_CHECK([APPCTL -t test-unixctl vlog/reopen])
-AT_CHECK([APPCTL -t test-unixctl log message5])
-AT_CHECK([APPCTL -t test-unixctl exit])
+AT_CHECK([APPCTL -t `pwd`/ctl vlog/reopen])
+AT_CHECK([APPCTL -t `pwd`/ctl log message5])
+AT_CHECK([APPCTL -t `pwd`/ctl exit])

 AT_CHECK([vlog_filt log.old], [0], [dnl
 opened log file




More information about the dev mailing list