tests/src/integration/tests/test_auth.cpp
/**
 * Perform plain text authentication session connections for all protocol
 * versions using "bad" credentials
 *
 * This test will perform a plain text authentication using each protocol
 * version with "bad" credentials and fail to establish a session connection
 * against a single node cluster.
 *
 * @test_category authentication
 * @since core:1.0.0
 * @expected_result Session will not be established for all protocol versions
 */
Perform plain text authentication session connections for all protocol
versions using "bad" credentials

This test will perform a plain text authentication using each protocol
version with "bad" credentials and fail to establish a session connection
against a single node cluster.

@test_category authentication
@since core:1.0.0
@expected_result Session will not be established for all protocol versions
Perform plain text authentication session connections for all protocol versions using " bad " credentials This test will perform a plain text authentication using each protocol version with " bad " credentials and fail to establish a session connection against a single node cluster . @test_category authentication @since core : 1 . 0 . 0 @expected_result Session will not be established for all protocol versions
CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, BadCredentials) {
  CHECK_FAILURE;
  CCM::CassVersion cass_version = this->server_version_;
  if (!Options::is_cassandra()) {
    cass_version = static_cast<CCM::DseVersion>(cass_version).get_cass_version();
  }
  if (cass_version >= "3.10") {
    logger_.add_critera("Provided username invalid and/or password are incorrect");
  } else {
    logger_.add_critera("Username and/or password are incorrect");
  }
  for (int i = CASS_LOWEST_SUPPORTED_PROTOCOL_VERSION; i <= CASS_HIGHEST_SUPPORTED_PROTOCOL_VERSION;
       ++i) {
    Session session = connect_using_credentials(i, "invalid", "invalid");
    ASSERT_EQ(session.connect_error_code(), CASS_ERROR_SERVER_BAD_CREDENTIALS);
    ASSERT_GE(logger_.count(), 1u);
    logger_.reset_count();
  }
}
CASSANDRA_INTEGRATION_TEST_F ( AuthenticationTests , BadCredentials ) { CHECK_FAILURE ; CCM :: CassVersion cass_version = this -> server_version_ ; if ( ! Options :: is_cassandra ( ) ) { cass_version = static_cast < CCM :: DseVersion > ( cass_version ) . get_cass_version ( ) ; } if ( cass_version >= " " ) { logger_ . add_critera ( " " ) ; } else { logger_ . add_critera ( " " ) ; } for ( int i = CASS_LOWEST_SUPPORTED_PROTOCOL_VERSION ; i <= CASS_HIGHEST_SUPPORTED_PROTOCOL_VERSION ; ++ i ) { Session session = connect_using_credentials ( i , " " , " " ) ; ASSERT_EQ ( session . connect_error_code ( ) , CASS_ERROR_SERVER_BAD_CREDENTIALS ) ; ASSERT_GE ( logger_ . count ( ) , 1u ) ; logger_ . reset_count ( ) ; } }
Perform plain text authentication session connections for all protocol
 versions using "bad" credentials
Perform plain text authentication session connections for all protocol versions using " bad " credentials
// Add the proper logging criteria (based on server version) // Iterate over all known/supported protocol versions /*
     * This is a case that could be guarded in the API entry point, or error out
     * in connection. However, auth is subject to major changes and this is just
     * a simple form. This test serves to characterize what is there presently.
     */