3030namespace NKikimr::NGRpcService {
3131
3232
33- struct TKikimrTestSettings {
34- static constexpr bool SSL = false;
35- static constexpr bool AUTH = false;
36- static constexpr bool PrecreatePools = true;
37- static constexpr bool EnableSystemViews = true;
38- };
39-
40- struct TKikimrTestWithAuth : TKikimrTestSettings {
41- static constexpr bool AUTH = true;
42- };
43-
44- struct TKikimrTestWithAuthAndSsl : TKikimrTestWithAuth {
45- static constexpr bool SSL = true;
46- };
4733
48- struct TKikimrTestNoSystemViews : TKikimrTestSettings {
49- static constexpr bool EnableSystemViews = false;
50- };
51-
52- template <typename TestSettings = TKikimrTestSettings>
53- class TBasicKikimrWithGrpcAndRootSchema {
34+ class TKikimrWithGrpcAndRootSchema {
5435public:
55- TBasicKikimrWithGrpcAndRootSchema (
36+ TKikimrWithGrpcAndRootSchema (
5637 NKikimrConfig::TAppConfig appConfig = {},
5738 TAutoPtr<TLogBackend> logBackend = {})
5839 {
@@ -63,19 +44,13 @@ class TBasicKikimrWithGrpcAndRootSchema {
6344 ServerSettings->SetLogBackend(logBackend);
6445 ServerSettings->SetDomainName(" Root" );
6546 ServerSettings->SetDynamicNodeCount(1);
66- if (TestSettings::PrecreatePools) {
67- ServerSettings->AddStoragePool(" ssd" );
68- ServerSettings->AddStoragePool(" hdd" );
69- ServerSettings->AddStoragePool(" hdd1" );
70- ServerSettings->AddStoragePool(" hdd2" );
71- } else {
72- ServerSettings->AddStoragePoolType(" ssd" );
73- ServerSettings->AddStoragePoolType(" hdd" );
74- ServerSettings->AddStoragePoolType(" hdd1" );
75- ServerSettings->AddStoragePoolType(" hdd2" );
76- }
47+ ServerSettings->AddStoragePool(" ssd" , " ssd-pool" );
48+ ServerSettings->AddStoragePool(" hdd" , " hdd-pool" );
49+ ServerSettings->AddStoragePool(" hdd1" , " hdd1-pool" );
50+ ServerSettings->AddStoragePool(" hdd2" , " hdd2-pool" );
7751 ServerSettings->Formats = new TFormatFactory;
7852 ServerSettings->FeatureFlags = appConfig.GetFeatureFlags();
53+ ServerSettings->FeatureFlags.SetAllowUpdateChannelsBindingOfSolomonPartitions(true);
7954 ServerSettings->RegisterGrpcService<NKikimr::NGRpcService::TKeyValueGRpcService>(" keyvalue" );
8055
8156 Server_.Reset(new Tests::TServer(*ServerSettings));
@@ -101,9 +76,6 @@ class TBasicKikimrWithGrpcAndRootSchema {
10176 //Server_->GetRuntime()->SetLogPriority(NKikimrServices::TX_COLUMNSHARD, NActors::NLog::PRI_DEBUG);
10277
10378 NYdbGrpc::TServerOptions grpcOption;
104- if (TestSettings::AUTH) {
105- grpcOption.SetUseAuth(true);
106- }
10779 grpcOption.SetPort(grpc);
10880 Server_->EnableGRpc(grpcOption);
10981
@@ -145,7 +117,6 @@ class TBasicKikimrWithGrpcAndRootSchema {
145117 ui16 GRpcPort_;
146118};
147119
148- using TKikimrWithGrpcAndRootSchema = TBasicKikimrWithGrpcAndRootSchema<TKikimrTestSettings>;
149120
150121Y_UNIT_TEST_SUITE(KeyValueGRPCService) {
151122
@@ -237,13 +208,20 @@ Y_UNIT_TEST_SUITE(KeyValueGRPCService) {
237208 createVolumeResponse.operation().result().UnpackTo(&createVolumeResult);
238209 }
239210
240- void AlterVolume(auto &channel, const TString &path, ui32 partition_count = 1) {
211+ void AlterVolume(auto &channel, const TString &path, ui32 partition_count = 1, std::optional<Ydb::KeyValue::StorageConfig> storage_config = {} ) {
241212 std::unique_ptr<Ydb::KeyValue::V1::KeyValueService::Stub> stub;
242213 stub = Ydb::KeyValue::V1::KeyValueService::NewStub(channel);
243214
244215 Ydb::KeyValue::AlterVolumeRequest alterVolumeRequest;
245216 alterVolumeRequest.set_path(path);
246217 alterVolumeRequest.set_alter_partition_count(partition_count);
218+ if (storage_config) {
219+ auto *storageConfig = alterVolumeRequest.mutable_storage_config();
220+ for (const auto &channel : storage_config->channel()) {
221+ auto *channelBind = storageConfig->add_channel();
222+ channelBind->set_media(channel.media());
223+ }
224+ }
247225
248226 Ydb::KeyValue::AlterVolumeResponse alterVolumeResponse;
249227 Ydb::KeyValue::AlterVolumeResult alterVolumeResult;
@@ -831,6 +809,15 @@ Y_UNIT_TEST_SUITE(KeyValueGRPCService) {
831809 UNIT_ASSERT_VALUES_EQUAL(channel.media(), " ssd" );
832810 }
833811
812+ AlterVolume(channel, tablePath, 3, describeVolumeResult.storage_config());
813+ describeVolumeResult = DescribeVolume(channel, tablePath);
814+ UNIT_ASSERT_VALUES_EQUAL(3, describeVolumeResult.partition_count());
815+ UNIT_ASSERT(describeVolumeResult.has_storage_config());
816+ UNIT_ASSERT_VALUES_EQUAL(describeVolumeResult.storage_config().channel_size(), 3);
817+ for (const auto& channel : describeVolumeResult.storage_config().channel()) {
818+ UNIT_ASSERT_VALUES_EQUAL(channel.media(), " ssd" );
819+ }
820+
834821 DropVolume(channel, tablePath);
835822 listDirectoryResult = ListDirectory(channel, path);
836823 UNIT_ASSERT_VALUES_EQUAL(listDirectoryResult.self().name(), " mydb" );
0 commit comments