summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Goulish <mgoulish@apache.org>2010-05-24 22:56:40 +0000
committerMichael Goulish <mgoulish@apache.org>2010-05-24 22:56:40 +0000
commitaa1ddcebf5a63c4908b08035b223b1ec1fa54037 (patch)
tree55f10e87140a7cd26d463114d1ca762987c680de
parenta2d7fd45b134ab9e7c28cb42e26a16fca29bbee3 (diff)
downloadqpid-python-aa1ddcebf5a63c4908b08035b223b1ec1fa54037.tar.gz
Disable new sasl testing if SASL version is less than 2.1.22.
Earlier version do not have SASL_PATH_TYPE_CONFIG, which this testing requires. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@947850 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp3
-rw-r--r--qpid/cpp/src/tests/cluster_authentication_soak.cpp5
2 files changed, 8 insertions, 0 deletions
diff --git a/qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp b/qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp
index e5102ea4b0..1683432329 100644
--- a/qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp
+++ b/qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp
@@ -98,6 +98,8 @@ void SaslAuthenticator::init(const std::string& saslName, std::string const & sa
int code;
// If we are not given a specific sasl path, do
// nothing and allow the default to be used.
+ // If we have a version of SASL in which SASL_PATH_TYPE_CONFIG does not yet exist, do nothing.
+ #if (SASL_VERSION_MAJOR >= 2) && (SASL_VERSION_MINOR >= 1) && (SASL_VERSION_STEP >= 22)
if ( ! saslConfigPath.empty() ) {
if(SASL_OK != (code=sasl_set_path(SASL_PATH_TYPE_CONFIG, const_cast<char *>(saslConfigPath.c_str())))) {
QPID_LOG(error, "SASL: sasl_set_path: [" << code << "] " );
@@ -105,6 +107,7 @@ void SaslAuthenticator::init(const std::string& saslName, std::string const & sa
}
QPID_LOG(info, "SASL: config path set to " << saslConfigPath );
}
+ #endif
code = sasl_server_init(NULL, saslName.c_str());
if (code != SASL_OK) {
diff --git a/qpid/cpp/src/tests/cluster_authentication_soak.cpp b/qpid/cpp/src/tests/cluster_authentication_soak.cpp
index 6963438d5f..9e878be6d1 100644
--- a/qpid/cpp/src/tests/cluster_authentication_soak.cpp
+++ b/qpid/cpp/src/tests/cluster_authentication_soak.cpp
@@ -241,6 +241,11 @@ using namespace qpid::tests;
int
main ( int argc, char ** argv )
{
+ // I need the SASL_PATH_TYPE_CONFIG feature, which did not appear until SASL 2.1.22
+ #if (SASL_VERSION_MAJOR < 2) || (SASL_VERSION_MINOR < 1) || (SASL_VERSION_STEP < 22)
+ return 0;
+ #endif
+
int n_iterations = argc > 1 ? atoi(argv[1]) : 1;
runSilent = argc > 2 ? atoi(argv[2]) : 1; // default to silent
int killBroker = argc > 3 ? atoi(argv[3]) : 0; // Force the kill of one broker.