Skip to content

Commit c7472bf

Browse files
authored
Various integration test fixes (#520)
Fix for AuthenticationTests against default C* version (3.11.6)
1 parent d31ce13 commit c7472bf

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

tests/src/integration/tests/test_auth.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, ProtocolVersions) {
108108
CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, InvalidEmptyCredentials) {
109109
CHECK_FAILURE;
110110

111-
// Iterate over all known/supported protocol versions
112111
logger_.add_critera("Key may not be empty");
112+
logger_.add_critera("Password must not be null");
113+
114+
// Iterate over all known/supported protocol versions
113115
for (int i = CASS_LOWEST_SUPPORTED_PROTOCOL_VERSION; i <= CASS_HIGHEST_SUPPORTED_PROTOCOL_VERSION;
114116
++i) {
115117
/*
@@ -118,8 +120,8 @@ CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, InvalidEmptyCredentials) {
118120
* a simple form. This test serves to characterize what is there presently.
119121
*/
120122
Session session = connect_using_credentials(i, "", "");
121-
ASSERT_EQ(session.connect_error_code(), CASS_ERROR_LIB_NO_HOSTS_AVAILABLE);
122-
ASSERT_EQ(logger_.count(), 2u);
123+
ASSERT_EQ(session.connect_error_code(), CASS_ERROR_SERVER_BAD_CREDENTIALS);
124+
ASSERT_GT(logger_.count(), 0u);
123125
logger_.reset_count();
124126
}
125127
}
@@ -139,8 +141,10 @@ CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, InvalidEmptyCredentials) {
139141
CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, InvalidNullUsernameCredentials) {
140142
CHECK_FAILURE;
141143

142-
// Iterate over all known/supported protocol versions
143144
logger_.add_critera("Key may not be empty");
145+
logger_.add_critera("Authentication ID must not be null");
146+
147+
// Iterate over all known/supported protocol versions
144148
for (int i = CASS_LOWEST_SUPPORTED_PROTOCOL_VERSION; i <= CASS_HIGHEST_SUPPORTED_PROTOCOL_VERSION;
145149
++i) {
146150
/*
@@ -149,8 +153,8 @@ CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, InvalidNullUsernameCredentials
149153
* a simple form. This test serves to characterize what is there presently.
150154
*/
151155
Session session = connect_using_credentials(i, NULL, "pass");
152-
ASSERT_EQ(session.connect_error_code(), CASS_ERROR_LIB_NO_HOSTS_AVAILABLE);
153-
ASSERT_EQ(logger_.count(), 2u);
156+
ASSERT_EQ(session.connect_error_code(), CASS_ERROR_SERVER_BAD_CREDENTIALS);
157+
ASSERT_GT(logger_.count(), 0u);
154158
logger_.reset_count();
155159
}
156160
}
@@ -170,8 +174,10 @@ CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, InvalidNullUsernameCredentials
170174
CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, InvalidNullPasswordCredentials) {
171175
CHECK_FAILURE;
172176

173-
// Iterate over all known/supported protocol versions
174177
logger_.add_critera("and/or password are incorrect");
178+
logger_.add_critera("Password must not be null");
179+
180+
// Iterate over all known/supported protocol versions
175181
for (int i = CASS_LOWEST_SUPPORTED_PROTOCOL_VERSION; i <= CASS_HIGHEST_SUPPORTED_PROTOCOL_VERSION;
176182
++i) {
177183
/*
@@ -181,7 +187,7 @@ CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, InvalidNullPasswordCredentials
181187
*/
182188
Session session = connect_using_credentials(i, "user", NULL);
183189
ASSERT_EQ(session.connect_error_code(), CASS_ERROR_SERVER_BAD_CREDENTIALS);
184-
ASSERT_GE(logger_.count(), 1u);
190+
ASSERT_GT(logger_.count(), 0u);
185191
logger_.reset_count();
186192
}
187193
}

0 commit comments

Comments
 (0)