Marton Greber has posted comments on this change. ( http://gerrit.cloudera.org:8080/23045 )
Change subject: Add REST API integration tests ...................................................................... Patch Set 7: Code-Review+1 (6 comments) Functionality looks good, just a couple nits. http://gerrit.cloudera.org:8080/#/c/23045/7/src/kudu/integration-tests/master_authz-itest.cc File src/kudu/integration-tests/master_authz-itest.cc: http://gerrit.cloudera.org:8080/#/c/23045/7/src/kudu/integration-tests/master_authz-itest.cc@1067 PS7, Line 1067: ASSERT_OK(cluster_->kdc()->Kinit(kSecondUser)); nit: if access is checked below in the scoped blocks, we dont need this line, right? (if i'm not mistaken this->client_ is not supposed to use kSecondUser) http://gerrit.cloudera.org:8080/#/c/23045/7/src/kudu/integration-tests/master_authz-itest.cc@1072 PS7, Line 1072: EasyCurl c; : faststring buf; : c.set_auth(CurlAuthType::SPNEGO); : c.set_custom_method("DELETE"); : : Status s = c.FetchURL(Substitute("http://$0/api/v1/tables/$1", : cluster_->master()->bound_http_hostport().ToString(), : table_id), : &buf); : AssertUnauthorizedResponse(s, buf.ToString()); : : c.set_custom_method("PUT"); : string alter_json = CreateAlterTableJsonAddColumn("test_table"); : s = c.PostToURL(Substitute("http://$0/api/v1/tables/$1", : cluster_->master()->bound_http_hostport().ToString(), : table_id), : alter_json, : &buf); : AssertUnauthorizedResponse(s, buf.ToString()); nit: isn't this the same piece of code that is below in the first {} block? http://gerrit.cloudera.org:8080/#/c/23045/7/src/kudu/integration-tests/master_authz-itest.cc@1101 PS7, Line 1101: cluster_->master()->bound_http_hostport().ToString(), : table_id), : &buf); nit: please add 2 extra spaces indent http://gerrit.cloudera.org:8080/#/c/23045/7/src/kudu/integration-tests/master_authz-itest.cc@1109 PS7, Line 1109: cluster_->master()->bound_http_hostport().ToString(), : table_id), : alter_json, : &buf); nit: please add 2 extra spaces indent http://gerrit.cloudera.org:8080/#/c/23045/7/src/kudu/integration-tests/master_authz-itest.cc@1124 PS7, Line 1124: cluster_->master()->bound_http_hostport().ToString(), : table_id), : &buf)); nit: please add 2 extra spaces indent http://gerrit.cloudera.org:8080/#/c/23045/7/src/kudu/master/spnego_rest_catalog-test.cc File src/kudu/master/spnego_rest_catalog-test.cc: http://gerrit.cloudera.org:8080/#/c/23045/7/src/kudu/master/spnego_rest_catalog-test.cc@310 PS7, Line 310: void GetLeaderMasterIndex(int* leader_idx) { : // Initialize with error value : *leader_idx = -1; : : EasyCurl c; : c.set_auth(CurlAuthType::SPNEGO); : faststring buf; : string leader_addr; : : ASSERT_OK(c.FetchURL(Substitute("http://$0/api/v1/leader", : cluster_->mini_master(0)->bound_http_addr().ToString()), : &buf)); : static KuduRegex re("\"leader\":\"([^\"]+)\"", 1); : vector<string> matches; : if (re.Match(buf.ToString(), &matches)) { : leader_addr = matches[0]; : } : : ASSERT_FALSE(leader_addr.empty()) << "Could not determine leader master address"; : : // Find which master corresponds to the leader address : for (int i = 0; i < cluster_->num_masters(); i++) { : if (leader_addr.find(cluster_->mini_master(i)->bound_http_addr().ToString()) != : string::npos) { : *leader_idx = i; : return; : } : } : *leader_idx = -1; : } I think this part is not necessary as we have something like this built into the mini cluster: Status InternalMiniCluster::GetLeaderMasterIndex(int* idx). If the above function works, you can just get rid of this function definition and use `cluster_->GetLeaderMasterIndex` in TestTableOperationsWithAuthentication. -- To view, visit http://gerrit.cloudera.org:8080/23045 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ifd3ff0dfd67cbc2b5ed0454372dd2bcea71e2ba3 Gerrit-Change-Number: 23045 Gerrit-PatchSet: 7 Gerrit-Owner: Gabriella Lotz <[email protected]> Gerrit-Reviewer: Gabriella Lotz <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Marton Greber <[email protected]> Gerrit-Reviewer: Zoltan Chovan <[email protected]> Gerrit-Comment-Date: Mon, 18 Aug 2025 14:15:11 +0000 Gerrit-HasComments: Yes
