This is an automated email from the ASF dual-hosted git repository. granthenke pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 2e580fe863b086cf16fd9d285dd56ba817f64cd3 Author: Grant Henke <[email protected]> AuthorDate: Tue Feb 19 08:35:17 2019 -0600 [test] Use the kudu binary in the external mini cluster This patch changes the external mini cluster to use the kudu binary and its ability to start a master and tserver instead of the kudu-master and kudu-tserver binaries. This means the kudu-binary jar only needs to ship a single binary. Change-Id: Ie963f5d50571f3d5ce55e40fcded245bf29b1b55 Reviewed-on: http://gerrit.cloudera.org:8080/12523 Reviewed-by: Grant Henke <[email protected]> Tested-by: Grant Henke <[email protected]> --- build-support/dist_test.py | 7 +---- .../integration-tests/security-faults-itest.cc | 4 +-- src/kudu/integration-tests/security-itest.cc | 11 +++++--- src/kudu/mini-cluster/external_mini_cluster.cc | 30 ++++++++++------------ src/kudu/mini-cluster/external_mini_cluster.h | 1 - 5 files changed, 25 insertions(+), 28 deletions(-) diff --git a/build-support/dist_test.py b/build-support/dist_test.py index 89e53bf..dae260d 100755 --- a/build-support/dist_test.py +++ b/build-support/dist_test.py @@ -94,12 +94,7 @@ DEPS_FOR_ALL = \ # The LLVM symbolizer is necessary for suppressions to work "thirdparty/installed/uninstrumented/bin/llvm-symbolizer", - # Tests that use the external minicluster require these. - # TODO: declare these dependencies per-test. - "build/latest/bin/kudu-tserver", - "build/latest/bin/kudu-master", - - # Tests that require tooling require this. + # Tests that require the the external minicluster or tooling require this. "build/latest/bin/kudu", # The HMS tests require the Hadoop, and Hive libraries. diff --git a/src/kudu/integration-tests/security-faults-itest.cc b/src/kudu/integration-tests/security-faults-itest.cc index a27c722..67880b0 100644 --- a/src/kudu/integration-tests/security-faults-itest.cc +++ b/src/kudu/integration-tests/security-faults-itest.cc @@ -191,7 +191,7 @@ TEST_F(SecurityComponentsFaultsITest, NoKdcOnStart) { const Status s = server->Restart(); ASSERT_TRUE(s.IsRuntimeError()) << s.ToString(); ASSERT_STR_CONTAINS(s.ToString(), - "kudu-master: process exited with non-zero status 3"); + "kudu: process exited with non-zero status 1"); } { auto server = cluster_->tablet_server(0); @@ -199,7 +199,7 @@ TEST_F(SecurityComponentsFaultsITest, NoKdcOnStart) { const Status s = server->Restart(); ASSERT_TRUE(s.IsRuntimeError()) << s.ToString(); ASSERT_STR_CONTAINS(s.ToString(), - "kudu-tserver: process exited with non-zero status 3"); + "kudu: process exited with non-zero status 1"); } } diff --git a/src/kudu/integration-tests/security-itest.cc b/src/kudu/integration-tests/security-itest.cc index 07ba0a3..0db25f7 100644 --- a/src/kudu/integration-tests/security-itest.cc +++ b/src/kudu/integration-tests/security-itest.cc @@ -376,9 +376,12 @@ void GetFullBinaryPath(string* binary) { TEST_F(SecurityITest, TestWorldReadableKeytab) { const string credentials_name = GetTestPath("insecure.keytab"); NO_FATALS(CreateWorldReadableFile(credentials_name)); - string binary = "kudu-master"; + string binary = "kudu"; NO_FATALS(GetFullBinaryPath(&binary)); - const vector<string> argv = { binary, Substitute("--keytab_file=$0", credentials_name) }; + const vector<string> argv = { binary, + "master", + "run", + Substitute("--keytab_file=$0", credentials_name) }; string stderr; Status s = Subprocess::Call(argv, "", nullptr, &stderr); ASSERT_STR_CONTAINS(stderr, Substitute( @@ -389,9 +392,11 @@ TEST_F(SecurityITest, TestWorldReadableKeytab) { TEST_F(SecurityITest, TestWorldReadablePrivateKey) { const string credentials_name = GetTestPath("insecure.key"); NO_FATALS(CreateWorldReadableFile(credentials_name)); - string binary = "kudu-master"; + string binary = "kudu"; NO_FATALS(GetFullBinaryPath(&binary)); const vector<string> argv = { binary, + "master", + "run", "--unlock_experimental_flags", Substitute("--rpc_private_key_file=$0", credentials_name), "--rpc_certificate_file=fake_file", diff --git a/src/kudu/mini-cluster/external_mini_cluster.cc b/src/kudu/mini-cluster/external_mini_cluster.cc index 7e09fd6..7d6341c 100644 --- a/src/kudu/mini-cluster/external_mini_cluster.cc +++ b/src/kudu/mini-cluster/external_mini_cluster.cc @@ -107,8 +107,7 @@ DEFINE_bool(perf_record, false, namespace kudu { namespace cluster { -static const char* const kMasterBinaryName = "kudu-master"; -static const char* const kTabletServerBinaryName = "kudu-tserver"; +static const char* const kKuduBinaryName = "kudu"; static double kTabletServerRegistrationTimeoutSeconds = 15.0; static double kMasterCatalogManagerTimeoutSeconds = 60.0; @@ -410,10 +409,10 @@ void ExternalMiniCluster::DisableMetastoreIntegration() { void ExternalMiniCluster::SetDaemonBinPath(string daemon_bin_path) { opts_.daemon_bin_path = std::move(daemon_bin_path); for (auto& master : masters_) { - master->SetExePath(GetBinaryPath(kMasterBinaryName)); + master->SetExePath(GetBinaryPath(kKuduBinaryName)); } for (auto& ts : tablet_servers_) { - ts->SetExePath(GetBinaryPath(kTabletServerBinaryName)); + ts->SetExePath(GetBinaryPath(kKuduBinaryName)); } } @@ -534,7 +533,7 @@ Status ExternalMiniCluster::StartMasters() { std::back_inserter(flags)); // Start the masters. - const string& exe = GetBinaryPath(kMasterBinaryName); + const string& exe = GetBinaryPath(kKuduBinaryName); for (int i = 0; i < num_masters; i++) { string daemon_id = Substitute("master-$0", i); @@ -611,7 +610,7 @@ Status ExternalMiniCluster::AddTabletServer() { ExternalDaemonOptions opts; opts.messenger = messenger_; opts.block_manager_type = opts_.block_manager_type; - opts.exe = GetBinaryPath(kTabletServerBinaryName); + opts.exe = GetBinaryPath(kKuduBinaryName); opts.wal_dir = GetWalPath(daemon_id); opts.data_dirs = GetDataPaths(daemon_id); opts.log_dir = GetLogPath(daemon_id); @@ -1472,17 +1471,14 @@ Status ExternalMaster::WaitForCatalogManager(WaitMode wait_mode) { } const vector<string>& ExternalMaster::GetCommonFlags() { - static vector<string> kFlags; + static vector<string> kFlags { "master", "run" }; if (!UseLargeKeys()) { - kFlags = { - // See the in-line comment for "--ipki_server_key_size" flag in - // ExternalDaemon::StartProcess() method. - "--ipki_ca_key_size=768", - - // As for the TSK keys, 512 bits is the minimum since we are using - // SHA256 digest for token signing/verification. - "--tsk_num_rsa_bits=512", - }; + // See the in-line comment for "--ipki_server_key_size" flag in + // ExternalDaemon::StartProcess() method. + kFlags.emplace_back("--ipki_ca_key_size=768"); + // As for the TSK keys, 512 bits is the minimum since we are using + // SHA256 digest for token signing/verification. + kFlags.emplace_back("--tsk_num_rsa_bits=512"); } return kFlags; } @@ -1503,6 +1499,7 @@ ExternalTabletServer::~ExternalTabletServer() { Status ExternalTabletServer::Start() { vector<string> flags { + "tserver", "run", Substitute("--rpc_bind_addresses=$0", rpc_bind_address().ToString()), Substitute("--local_ip_for_outbound_sockets=$0", rpc_bind_address().host()), Substitute("--webserver_interface=$0", rpc_bind_address().host()), @@ -1519,6 +1516,7 @@ Status ExternalTabletServer::Restart() { return Status::IllegalState("Tablet server cannot be restarted. Must call Shutdown() first."); } vector<string> flags { + "tserver", "run", Substitute("--rpc_bind_addresses=$0", bound_rpc_.ToString()), Substitute("--local_ip_for_outbound_sockets=$0", rpc_bind_address().host()), Substitute("--tserver_master_addrs=$0", diff --git a/src/kudu/mini-cluster/external_mini_cluster.h b/src/kudu/mini-cluster/external_mini_cluster.h index 4d1d776..be5d3b5 100644 --- a/src/kudu/mini-cluster/external_mini_cluster.h +++ b/src/kudu/mini-cluster/external_mini_cluster.h @@ -31,7 +31,6 @@ #include <boost/optional/optional.hpp> #include <glog/logging.h> -#include "kudu/client/shared_ptr.h" // IWYU pragma: keep #include "kudu/common/common.pb.h" #include "kudu/gutil/macros.h" #include "kudu/gutil/port.h"
