2424#include < iostream>
2525
2626#define DEFAULT_OPTIONS_CASSSANDRA_VERSION CCM::CassVersion (" 3.11.4" )
27- #define DEFAULT_OPTIONS_DSE_VERSION CCM::DseVersion (" 6.0.8" )
27+ #define DEFAULT_OPTIONS_DSE_VERSION CCM::DseVersion (" 6.7.5" )
28+ #define DEFAULT_OPTIONS_DDAC_VERSION CCM::DseVersion (" 5.1.17" )
2829
2930// Initialize the defaults for all the options
3031bool Options::is_initialized_ = false;
3132bool Options::is_help_ = false ;
3233bool Options::is_keep_clusters_ = false ;
3334bool Options::is_log_tests_ = true ;
3435CCM::CassVersion Options::server_version_ = DEFAULT_OPTIONS_CASSSANDRA_VERSION;
35- bool Options::is_dse_ = false ;
3636bool Options::use_git_ = false ;
3737std::string Options::branch_tag_;
3838bool Options::use_install_dir_ = false ;
@@ -55,6 +55,7 @@ CCM::DseCredentialsType Options::dse_credentials_type_;
5555CCM::AuthenticationType Options::authentication_type_;
5656CCM::DeploymentType Options::deployment_type_;
5757std::set<TestCategory> Options::categories_;
58+ CCM::ServerType Options::server_type_;
5859
5960bool Options::initialize (int argc, char * argv[]) {
6061 // Only allow initialization to occur once
@@ -63,6 +64,7 @@ bool Options::initialize(int argc, char* argv[]) {
6364 dse_credentials_type_ = CCM::DseCredentialsType::USERNAME_PASSWORD;
6465 authentication_type_ = CCM::AuthenticationType::USERNAME_PASSWORD;
6566 deployment_type_ = CCM::DeploymentType::LOCAL;
67+ server_type_ = CCM::ServerType::CASSANDRA;
6668
6769 // Check for the help argument first (keeps defaults for help display)
6870 for (int i = 1 ; i < argc; ++i) {
@@ -77,6 +79,8 @@ bool Options::initialize(int argc, char* argv[]) {
7779 for (int i = 1 ; i < argc; ++i) {
7880 if (std::string (argv[i]) == " --dse" ) {
7981 server_version_ = DEFAULT_OPTIONS_DSE_VERSION;
82+ } else if (std::string (argv[i]) == " --ddac" ) {
83+ server_version_ = DEFAULT_OPTIONS_DDAC_VERSION;
8084 }
8185 }
8286
@@ -107,7 +111,9 @@ bool Options::initialize(int argc, char* argv[]) {
107111 << std::endl;
108112 }
109113 } else if (key == " --dse" ) {
110- is_dse_ = true ;
114+ server_type_ = CCM::ServerType::DSE;
115+ } else if (key == " --ddac" ) {
116+ server_type_ = CCM::ServerType::DDAC;
111117 } else if (key == " --dse-username" ) {
112118 if (!value.empty ()) {
113119 dse_username_ = value;
@@ -129,7 +135,7 @@ bool Options::initialize(int argc, char* argv[]) {
129135 }
130136 }
131137 if (!is_found) {
132- std::cerr << " Invalid DSE Credentials Type: Using default "
138+ std::cerr << " Invalid DSE/DDAC Credentials Type: Using default "
133139 << dse_credentials_type_.to_string () << std::endl;
134140 }
135141 } else if (key == " --git" ) {
@@ -272,7 +278,7 @@ bool Options::initialize(int argc, char* argv[]) {
272278 for (TestCategory::iterator iterator = TestCategory::begin (); iterator != TestCategory::end ();
273279 ++iterator) {
274280 // Only add the DSE test category if DSE is enabled
275- if (*iterator != TestCategory::DSE || is_dse_ ) {
281+ if (*iterator != TestCategory::DSE || is_dse () ) {
276282 categories_.insert (*iterator);
277283 } else {
278284 std::cerr << " DSE Category Will be Ignored: DSE is not enabled [--dse]" << std::endl;
@@ -282,11 +288,11 @@ bool Options::initialize(int argc, char* argv[]) {
282288 if (deployment_type_ == CCM::DeploymentType::LOCAL) {
283289 host_ = " 127.0.0.1" ;
284290 }
285- if (is_dse_ && !use_install_dir_) {
286- // Determine if the DSE credentials type should be updated
291+ if (! is_cassandra () && !use_install_dir_) {
292+ // Determine if the DSE/DDAC credentials type should be updated
287293 if (dse_credentials_type_ == CCM::DseCredentialsType::USERNAME_PASSWORD) {
288294 if (dse_username_.empty () || dse_password_.empty ()) {
289- std::cerr << " Invalid Username and/or Password: Default to INI_FILE DSE credentials"
295+ std::cerr << " Invalid Username and/or Password: Default to INI_FILE DSE/DDAC credentials"
290296 << std::endl;
291297 dse_credentials_type_ = CCM::DseCredentialsType::INI_FILE;
292298 }
@@ -309,10 +315,11 @@ void Options::print_help() {
309315 std::cout << std::endl << " CCM Options:" << std::endl;
310316 std::cout << " --version=[VERSION]" << std::endl
311317 << " "
312- << " Cassandra/DSE version to use." << std::endl
318+ << " Cassandra/DSE/DDAC version to use." << std::endl
313319 << " Default:" << std::endl
314320 << " Cassandra Version: " << server_version ().to_string () << std::endl
315- << " DSE Version: " << DEFAULT_OPTIONS_DSE_VERSION.to_string () << std::endl;
321+ << " DSE Version: " << DEFAULT_OPTIONS_DSE_VERSION.to_string () << std::endl
322+ << " DDAC Version: " << DEFAULT_OPTIONS_DDAC_VERSION.to_string () << std::endl;
316323 std::string categories;
317324 for (TestCategory::iterator iterator = TestCategory::begin (); iterator != TestCategory::end ();
318325 ++iterator) {
@@ -330,16 +337,20 @@ void Options::print_help() {
330337 std::cout << " --dse" << std::endl
331338 << " "
332339 << " Indicate server version supplied is DSE." << std::endl;
340+ std::cout << " --ddac" << std::endl
341+ << " "
342+ << " Indicate server version supplied is DDAC." << std::endl;
333343 std::cout << " --dse-credentials=(USERNAME_PASSWORD|INI_FILE)" << std::endl
334344 << " "
335- << " DSE credentials to use for download authentication. The default is " << std::endl
345+ << " DSE/DDAC credentials to use for download authentication. The default is "
346+ << std::endl
336347 << " " << dse_credentials ().to_string () << " ." << std::endl;
337348 std::cout << " --dse-username=[USERNAME]" << std::endl
338349 << " "
339- << " Username to use for DSE download authentication." << std::endl;
350+ << " Username to use for DSE/DDAC download authentication." << std::endl;
340351 std::cout << " --dse-password=[PASSWORD]" << std::endl
341352 << " "
342- << " Password to use for DSE download authentication." << std::endl;
353+ << " Password to use for DSE/DDAC download authentication." << std::endl;
343354 std::cout << " --git" << std::endl
344355 << " "
345356 << " Indicate Cassandra/DSE server download should be obtained from" << std::endl
@@ -408,18 +419,20 @@ void Options::print_settings() {
408419 if (log_tests ()) {
409420 std::cout << " Logging driver messages" << std::endl;
410421 }
411- if (is_dse ()) {
412- std::cout << " DSE Version: " << CCM::DseVersion (server_version ()).to_string () << std::endl;
422+ if (!is_cassandra ()) {
423+ std::cout << " " << server_type_.to_string ()
424+ << " Version: " << CCM::DseVersion (server_version ()).to_string () << std::endl;
413425 if (!use_install_dir ()) {
414426 if (dse_credentials () == CCM::DseCredentialsType::USERNAME_PASSWORD) {
415427 std::cout << " Username: " << dse_username () << std::endl;
416428 std::cout << " Password: " << dse_password () << std::endl;
417429 } else {
418- std::cout << " Using INI file for DSE download authentication" << std::endl;
430+ std::cout << " Using INI file for DSE/DDAC download authentication" << std::endl;
419431 }
420432 }
421433 } else {
422- std::cout << " Cassandra Version: " << server_version ().to_string () << std::endl;
434+ std::cout << " " << server_type_.to_string () << " Version: " << server_version ().to_string ()
435+ << std::endl;
423436 }
424437 if (use_install_dir ()) {
425438 std::cout << " Using installation directory [" << install_dir () << " ]" << std::endl;
@@ -456,7 +469,13 @@ bool Options::log_tests() { return is_log_tests_; }
456469
457470CCM::CassVersion Options::server_version () { return server_version_; }
458471
459- bool Options::is_dse () { return is_dse_; }
472+ CCM::ServerType Options::server_type () { return server_type_; }
473+
474+ bool Options::is_cassandra () { return server_type_ == CCM::ServerType::CASSANDRA; }
475+
476+ bool Options::is_dse () { return server_type_ == CCM::ServerType::DSE; }
477+
478+ bool Options::is_ddac () { return server_type_ == CCM::ServerType::DDAC; }
460479
461480CCM::DseCredentialsType Options::dse_credentials () {
462481 // Static initialization cannot be guaranteed
@@ -514,7 +533,7 @@ const std::string& Options::private_key() { return private_key_; }
514533
515534SharedPtr<CCM::Bridge, StdDeleter<CCM::Bridge> > Options::ccm () {
516535 return new CCM::Bridge (Options::server_version (), Options::use_git (), Options::branch_tag (),
517- Options::use_install_dir (), Options::install_dir (), Options::is_dse (),
536+ Options::use_install_dir (), Options::install_dir (), Options::server_type (),
518537 CCM::Bridge::DEFAULT_DSE_WORKLOAD, Options::cluster_prefix (),
519538 Options::dse_credentials (), Options::dse_username (),
520539 Options::dse_password (), Options::deployment_type (),
0 commit comments