Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions tests/src/integration/tests/test_auth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, ProtocolVersions) {
CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, InvalidEmptyCredentials) {
CHECK_FAILURE;

// Iterate over all known/supported protocol versions
logger_.add_critera("Key may not be empty");
logger_.add_critera("Password must not be null");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to match the message observed for the default C* version (3.11.6)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe leave the old criteria and add the new one? Then update the logger count check to a > 0? I don't know why this asserts a specific count...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I like that quite a bit better than my initial change. I'll update.


// Iterate over all known/supported protocol versions
for (int i = CASS_LOWEST_SUPPORTED_PROTOCOL_VERSION; i <= CASS_HIGHEST_SUPPORTED_PROTOCOL_VERSION;
++i) {
/*
Expand All @@ -118,8 +120,8 @@ CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, InvalidEmptyCredentials) {
* a simple form. This test serves to characterize what is there presently.
*/
Session session = connect_using_credentials(i, "", "");
ASSERT_EQ(session.connect_error_code(), CASS_ERROR_LIB_NO_HOSTS_AVAILABLE);
ASSERT_EQ(logger_.count(), 2u);
ASSERT_EQ(session.connect_error_code(), CASS_ERROR_SERVER_BAD_CREDENTIALS);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test was reporting this error rather than "no hosts available" and it seems more descriptive anyway

ASSERT_GT(logger_.count(), 0u);
logger_.reset_count();
}
}
Expand All @@ -139,8 +141,10 @@ CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, InvalidEmptyCredentials) {
CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, InvalidNullUsernameCredentials) {
CHECK_FAILURE;

// Iterate over all known/supported protocol versions
logger_.add_critera("Key may not be empty");
logger_.add_critera("Authentication ID must not be null");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to above, update to match what's going on with 3.11.6


// Iterate over all known/supported protocol versions
for (int i = CASS_LOWEST_SUPPORTED_PROTOCOL_VERSION; i <= CASS_HIGHEST_SUPPORTED_PROTOCOL_VERSION;
++i) {
/*
Expand All @@ -149,8 +153,8 @@ CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, InvalidNullUsernameCredentials
* a simple form. This test serves to characterize what is there presently.
*/
Session session = connect_using_credentials(i, NULL, "pass");
ASSERT_EQ(session.connect_error_code(), CASS_ERROR_LIB_NO_HOSTS_AVAILABLE);
ASSERT_EQ(logger_.count(), 2u);
ASSERT_EQ(session.connect_error_code(), CASS_ERROR_SERVER_BAD_CREDENTIALS);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to above, "bad credentials" seems more correct here

ASSERT_GT(logger_.count(), 0u);
logger_.reset_count();
}
}
Expand All @@ -170,8 +174,10 @@ CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, InvalidNullUsernameCredentials
CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, InvalidNullPasswordCredentials) {
CHECK_FAILURE;

// Iterate over all known/supported protocol versions
logger_.add_critera("and/or password are incorrect");
logger_.add_critera("Password must not be null");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to above, update to match what's going on with 3.11.6


// Iterate over all known/supported protocol versions
for (int i = CASS_LOWEST_SUPPORTED_PROTOCOL_VERSION; i <= CASS_HIGHEST_SUPPORTED_PROTOCOL_VERSION;
++i) {
/*
Expand All @@ -181,7 +187,7 @@ CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, InvalidNullPasswordCredentials
*/
Session session = connect_using_credentials(i, "user", NULL);
ASSERT_EQ(session.connect_error_code(), CASS_ERROR_SERVER_BAD_CREDENTIALS);
ASSERT_GE(logger_.count(), 1u);
ASSERT_GT(logger_.count(), 0u);
logger_.reset_count();
}
}
Expand Down