You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2015/07/18 00:07:27 UTC

[1/3] qpid-proton git commit: NO-JIRA: Minor changes to CMake to detect and pass some extra things to tests

Repository: qpid-proton
Updated Branches:
  refs/heads/master 4ee726002 -> 71f0be88e


NO-JIRA: Minor changes to CMake to detect and pass some extra things to tests


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/eec9cb33
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/eec9cb33
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/eec9cb33

Branch: refs/heads/master
Commit: eec9cb33ab5ea08ed515a10015a3643f3d09b261
Parents: 4ee7260
Author: Andrew Stitcher <as...@apache.org>
Authored: Thu Jul 16 03:24:21 2015 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Fri Jul 17 17:39:36 2015 -0400

----------------------------------------------------------------------
 proton-c/CMakeLists.txt | 80 ++++++++++++++++++++++++--------------------
 1 file changed, 44 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/eec9cb33/proton-c/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt
index 8c31a89..46cf60e 100644
--- a/proton-c/CMakeLists.txt
+++ b/proton-c/CMakeLists.txt
@@ -57,6 +57,10 @@ find_path(CYRUS_SASL_INCLUDE_DIR sasl/sasl.h PATH_SUFFIXES include)
 find_package_handle_standard_args(CyrusSASL DEFAULT_MSG CYRUS_SASL_LIBRARY CYRUS_SASL_INCLUDE_DIR)
 mark_as_advanced(CYRUS_SASL_LIBRARY CYRUS_SASL_INCLUDE_DIR)
 
+# Find saslpasswd2 executable to generate test config
+find_program(SASLPASSWD_EXE saslpasswd2 DOC "Program used to make SASL user db for testing")
+mark_as_advanced(SASLPASSWD_EXE)
+
 if(PN_WINAPI)
   set(ssl_impl schannel)
   set(ssl_providers "'none','schannel','openssl'")
@@ -488,26 +492,29 @@ if (BUILD_PYTHON)
   set (app_path $<TARGET_FILE_DIR:msgr-send> "${pn_test_root}/tools/apps/python")
   set (py_path ${py_bld} ${app_path} $ENV{PATH})
   set (py_pythonpath ${py_root} ${py_src} ${py_bin} ${py_dll} $ENV{PYTHONPATH})
+  to_native_path ("${py_pythonpath}" py_pythonpath)
 
   if (NOT OLD_ADD_TEST_COMMAND)
-  to_native_path ("${py_path}" py_path)
-  to_native_path ("${py_pythonpath}" py_pythonpath)
-  add_test (NAME python-test
-            COMMAND ${env_py}
-	    "PATH=${py_path}" "PYTHONPATH=${py_pythonpath}" "PKG_CONFIG_PATH=${pn_c_root}"
-            "CLASSPATH=${CMAKE_BINARY_DIR}/proton-j/proton-j.jar"
-            ${VALGRIND_ENV}
-            ${PYTHON_EXECUTABLE} "${py_root}/proton-test")
-  set_tests_properties(python-test PROPERTIES PASS_REGULAR_EXPRESSION "Totals: .* 0 failed")
+    to_native_path ("${py_path}" py_path)
+    add_test (NAME python-test
+              COMMAND ${env_py}
+                "PATH=${py_path}" "PYTHONPATH=${py_pythonpath}" "PKG_CONFIG_PATH=${pn_c_root}"
+                "CLASSPATH=${CMAKE_BINARY_DIR}/proton-j/proton-j.jar"
+                "SASLPASSWD=${SASLPASSWD_EXE}"
+                ${VALGRIND_ENV}
+                ${PYTHON_EXECUTABLE} "${py_root}/proton-test")
+    set_tests_properties(python-test PROPERTIES PASS_REGULAR_EXPRESSION "Totals: .* 0 failed")
   else (NOT OLD_ADD_TEST_COMMAND)
-  list (APPEND py_path "${Proton_BINARY_DIR}/tests/tools/apps/c")
-  to_native_path ("${py_path}" py_path)
-  to_native_path ("${py_pythonpath}" py_pythonpath)
-  add_test (python-test
-            ${env_py}
-	    "PATH=${py_path}" "PYTHONPATH=${py_pythonpath}" "PKG_CONFIG_PATH=${pn_c_root}" ${VALGRIND_ENV}
-            ${PYTHON_EXECUTABLE} "${py_root}/proton-test")
-  set_tests_properties(python-test PROPERTIES PASS_REGULAR_EXPRESSION "Totals: .* 0 failed")
+    list (APPEND py_path "${Proton_BINARY_DIR}/tests/tools/apps/c")
+    to_native_path ("${py_path}" py_path)
+    add_test (python-test
+                ${env_py}
+                "PATH=${py_path}" "PYTHONPATH=${py_pythonpath}" "PKG_CONFIG_PATH=${pn_c_root}"
+                "CLASSPATH=${CMAKE_BINARY_DIR}/proton-j/proton-j.jar"
+                "SASLPASSWD=${SASLPASSWD_EXE}"
+                ${VALGRIND_ENV}
+                ${PYTHON_EXECUTABLE} "${py_root}/proton-test")
+    set_tests_properties(python-test PROPERTIES PASS_REGULAR_EXPRESSION "Totals: .* 0 failed")
   endif (NOT OLD_ADD_TEST_COMMAND)
 
   # Eventually, we'll get rid of this check when other
@@ -515,25 +522,26 @@ if (BUILD_PYTHON)
   # the build for non linux plaforms, it doesn't make sense
   # to try to run them.
   if (CMAKE_SYSTEM_NAME STREQUAL Linux)
-     find_program(TOX_CMD "tox")
-     if (TOX_CMD)
-         list (APPEND py_path "${Proton_BINARY_DIR}/tests/tools/apps/c")
-         to_native_path ("${py_path}" py_path)
-         to_native_path ("${py_pythonpath}" py_pythonpath)
-         add_test (NAME python-tox-test
-		   WORKING_DIRECTORY ${py_src}
-                   COMMAND ${env_py}
-		   "PATH=${py_path}" "QPID_PROTON_SRC=${CMAKE_CURRENT_SOURCE_DIR}/../"
-                   "CLASSPATH=${CMAKE_BINARY_DIR}/proton-j/proton-j.jar"
-                   ${VALGRIND_ENV}
-                   tox)
-         set_tests_properties(python-tox-test
-                              PROPERTIES
-                              PASS_REGULAR_EXPRESSION "Totals: .* ignored, 0 failed"
-                              FAIL_REGULAR_EXPRESSION "ERROR:[ ]+py[0-9]*: commands failed")
-     else (TOX_CMD)
-         message(STATUS "The tox tool is not available - skipping the python-tox-tests")
-     endif (TOX_CMD)
+   find_program(TOX_EXE "tox")
+   mark_as_advanced(TOX_EXE)
+   if (TOX_EXE)
+     to_native_path ("${py_path}" py_path)
+     add_test (NAME python-tox-test
+               WORKING_DIRECTORY ${py_src}
+               COMMAND ${env_py}
+                 "PATH=${py_path}" "QPID_PROTON_SRC=${CMAKE_CURRENT_SOURCE_DIR}/../"
+                 "CLASSPATH=${CMAKE_BINARY_DIR}/proton-j/proton-j.jar"
+                 "SASLPASSWD=${SASLPASSWD_EXE}"
+                 "SWIG=${SWIG_EXECUTABLE}"
+                 ${VALGRIND_ENV}
+                 ${TOX_EXE})
+     set_tests_properties(python-tox-test
+                          PROPERTIES
+                          PASS_REGULAR_EXPRESSION "Totals: .* ignored, 0 failed"
+                          FAIL_REGULAR_EXPRESSION "ERROR:[ ]+py[0-9]*: commands failed")
+   else (TOX_EXE)
+     message(STATUS "The tox tool is not available - skipping the python-tox-tests")
+   endif (TOX_EXE)
   endif (CMAKE_SYSTEM_NAME STREQUAL Linux)
 
 endif (BUILD_PYTHON)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[2/3] qpid-proton git commit: NO-JIRA: Skip Extended SASL tests if we can't find saslpasswd2

Posted by as...@apache.org.
NO-JIRA: Skip Extended SASL tests if we can't find saslpasswd2


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/198af3db
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/198af3db
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/198af3db

Branch: refs/heads/master
Commit: 198af3dbadc5f01f5333bab6313f812ccab0b750
Parents: eec9cb3
Author: Andrew Stitcher <as...@apache.org>
Authored: Thu Jul 16 18:32:15 2015 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Fri Jul 17 17:39:37 2015 -0400

----------------------------------------------------------------------
 config.sh.in                        |  5 ++++
 tests/python/proton_tests/common.py | 44 +++++++++++++++++++++-----------
 tests/python/proton_tests/sasl.py   | 11 ++++----
 3 files changed, 39 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/198af3db/config.sh.in
----------------------------------------------------------------------
diff --git a/config.sh.in b/config.sh.in
index 4b60b2f..25d08b1 100755
--- a/config.sh.in
+++ b/config.sh.in
@@ -59,3 +59,8 @@ export PATH="$PATH:$PROTON_HOME/tests/python"
 if [[ -x "$(type -p valgrind)" ]] ; then
     export VALGRIND=$(type -p valgrind)
 fi
+
+# can the test harness use saslpasswd2?
+if [[ -x "$(type -p saslpasswd2)" ]] ; then
+    export SASLPASSWD=$(type -p saslpasswd2)
+fi

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/198af3db/tests/python/proton_tests/common.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/common.py b/tests/python/proton_tests/common.py
index 857cb50..dab6fba 100644
--- a/tests/python/proton_tests/common.py
+++ b/tests/python/proton_tests/common.py
@@ -108,31 +108,45 @@ def pump(transport1, transport2, buffer_size=1024):
 def isSSLPresent():
     return SSL.present()
 
+createdSASLDb = False
+
 def _cyrusSetup(conf_dir):
   """Write out simple SASL config.
-     This assumes saslpasswd2 is in the OS path.
   """
-  t = Template("""sasldb_path: ${db}
+  saslpasswd = ""
+  if 'SASLPASSWD' in os.environ:
+    saslpasswd = os.environ['SASLPASSWD']
+  if os.path.exists(saslpasswd):
+    t = Template("""sasldb_path: ${db}
 mech_list: EXTERNAL DIGEST-MD5 SCRAM-SHA-1 CRAM-MD5 PLAIN ANONYMOUS
 """)
-  abs_conf_dir = os.path.abspath(conf_dir)
-  subprocess.call(args=['rm','-rf',abs_conf_dir])
-  os.mkdir(abs_conf_dir)
-  db = os.path.join(abs_conf_dir,'proton.sasldb')
-  conf = os.path.join(abs_conf_dir,'proton-server.conf')
-  f = open(conf, 'w')
-  f.write(t.substitute(db=db))
-  f.close()
-
-  cmd = Template("echo password | saslpasswd2 -c -p -f ${db} -u proton user").substitute(db=db)
-  subprocess.call(args=cmd, shell=True)
-
-  os.environ['PN_SASL_CONFIG_PATH'] = abs_conf_dir
+    abs_conf_dir = os.path.abspath(conf_dir)
+    subprocess.call(args=['rm','-rf',abs_conf_dir])
+    os.mkdir(abs_conf_dir)
+    db = os.path.join(abs_conf_dir,'proton.sasldb')
+    conf = os.path.join(abs_conf_dir,'proton-server.conf')
+    f = open(conf, 'w')
+    f.write(t.substitute(db=db))
+    f.close()
+
+    cmd_template = Template("echo password | ${saslpasswd} -c -p -f ${db} -u proton user")
+    cmd = cmd_template.substitute(db=db, saslpasswd=saslpasswd)
+    subprocess.call(args=cmd, shell=True)
+
+    os.environ['PN_SASL_CONFIG_PATH'] = abs_conf_dir
+    global createdSASLDb
+    createdSASLDb = True
 
 # Globally initialize Cyrus SASL configuration
 if SASL.extended():
   _cyrusSetup('sasl_conf')
 
+def ensureCanTestExtendedSASL():
+  if not SASL.extended():
+    raise Skipped('Extended SASL not supported')
+  if not createdSASLDb:
+    raise Skipped("Can't Test Extended SASL: Couldn't create auth db")
+
 class Test(TestCase):
 
   def __init__(self, name):

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/198af3db/tests/python/proton_tests/sasl.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/sasl.py b/tests/python/proton_tests/sasl.py
index a072150..9c8c38c 100644
--- a/tests/python/proton_tests/sasl.py
+++ b/tests/python/proton_tests/sasl.py
@@ -313,16 +313,14 @@ class CyrusSASLTest(Test):
     _testSaslMech(self, 'ANONYMOUS', authUser='anonymous')
 
   def testMechCRAMMD5(self):
-    if not SASL.extended():
-      raise Skipped('Extended SASL not supported')
+    common.ensureCanTestExtendedSASL()
 
     self.t1.bind(self.c1)
     self.t2.bind(self.c2)
     _testSaslMech(self, 'CRAM-MD5')
 
   def testMechDIGESTMD5(self):
-    if not SASL.extended():
-      raise Skipped('Extended SASL not supported')
+    common.ensureCanTestExtendedSASL()
 
     self.t1.bind(self.c1)
     self.t2.bind(self.c2)
@@ -332,8 +330,7 @@ class CyrusSASLTest(Test):
 # so not universal and hance need a test for support
 # to keep it in tests.
 #  def testMechSCRAMSHA1(self):
-#    if not SASL.extended():
-#      raise Skipped('Extended SASL not supported')
+#    common.ensureCanTestExtendedSASL()
 #
 #    self.t1.bind(self.c1)
 #    self.t2.bind(self.c2)
@@ -365,6 +362,7 @@ class SSLSASLTest(Test):
       raise Skipped("Proton-J does not support SSL with SASL")
     if not SASL.extended():
       raise Skipped("Simple SASL server does not support PLAIN")
+    common.ensureCanTestExtendedSASL()
 
     clientUser = 'user@proton'
     mech = 'PLAIN'
@@ -383,6 +381,7 @@ class SSLSASLTest(Test):
       raise Skipped("Proton-J does not support SSL with SASL")
     if not SASL.extended():
       raise Skipped("Simple SASL server does not support PLAIN")
+    common.ensureCanTestExtendedSASL()
 
     clientUser = 'usr@proton'
     mech = 'PLAIN'


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[3/3] qpid-proton git commit: NO-JIRA: Make tox get the path for swig from the SWIG env var if present

Posted by as...@apache.org.
NO-JIRA: Make tox get the path for swig from the SWIG env var if present


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/71f0be88
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/71f0be88
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/71f0be88

Branch: refs/heads/master
Commit: 71f0be88ee8649e98571e6208858945f1d2708f6
Parents: 198af3d
Author: Andrew Stitcher <as...@apache.org>
Authored: Fri Jul 17 17:36:23 2015 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Fri Jul 17 17:39:37 2015 -0400

----------------------------------------------------------------------
 proton-c/bindings/python/setup.py | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/71f0be88/proton-c/bindings/python/setup.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/setup.py b/proton-c/bindings/python/setup.py
index d4eb3ca..1624e5e 100755
--- a/proton-c/bindings/python/setup.py
+++ b/proton-c/bindings/python/setup.py
@@ -120,6 +120,9 @@ class Configure(build_ext):
     def prepare_swig_wrap(self):
         ext = self.distribution.ext_modules[-1]
 
+        if 'SWIG' in os.environ:
+            self.swig = os.environ['SWIG']
+
         try:
             # This will actually call swig to generate the files
             # and list the sources.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org