30
30
namespace NKikimr::NGRpcService {
31
31
32
32
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
- };
47
33
48
- struct TKikimrTestNoSystemViews : TKikimrTestSettings {
49
- static constexpr bool EnableSystemViews = false;
50
- };
51
-
52
- template <typename TestSettings = TKikimrTestSettings>
53
- class TBasicKikimrWithGrpcAndRootSchema {
34
+ class TKikimrWithGrpcAndRootSchema {
54
35
public:
55
- TBasicKikimrWithGrpcAndRootSchema (
36
+ TKikimrWithGrpcAndRootSchema (
56
37
NKikimrConfig::TAppConfig appConfig = {},
57
38
TAutoPtr<TLogBackend> logBackend = {})
58
39
{
@@ -63,19 +44,13 @@ class TBasicKikimrWithGrpcAndRootSchema {
63
44
ServerSettings->SetLogBackend(logBackend);
64
45
ServerSettings->SetDomainName(" Root" );
65
46
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" );
77
51
ServerSettings->Formats = new TFormatFactory;
78
52
ServerSettings->FeatureFlags = appConfig.GetFeatureFlags();
53
+ ServerSettings->FeatureFlags.SetAllowUpdateChannelsBindingOfSolomonPartitions(true);
79
54
ServerSettings->RegisterGrpcService<NKikimr::NGRpcService::TKeyValueGRpcService>(" keyvalue" );
80
55
81
56
Server_.Reset(new Tests::TServer(*ServerSettings));
@@ -101,9 +76,6 @@ class TBasicKikimrWithGrpcAndRootSchema {
101
76
//Server_->GetRuntime()->SetLogPriority(NKikimrServices::TX_COLUMNSHARD, NActors::NLog::PRI_DEBUG);
102
77
103
78
NYdbGrpc::TServerOptions grpcOption;
104
- if (TestSettings::AUTH) {
105
- grpcOption.SetUseAuth(true);
106
- }
107
79
grpcOption.SetPort(grpc);
108
80
Server_->EnableGRpc(grpcOption);
109
81
@@ -145,7 +117,6 @@ class TBasicKikimrWithGrpcAndRootSchema {
145
117
ui16 GRpcPort_;
146
118
};
147
119
148
- using TKikimrWithGrpcAndRootSchema = TBasicKikimrWithGrpcAndRootSchema<TKikimrTestSettings>;
149
120
150
121
Y_UNIT_TEST_SUITE(KeyValueGRPCService) {
151
122
@@ -237,13 +208,20 @@ Y_UNIT_TEST_SUITE(KeyValueGRPCService) {
237
208
createVolumeResponse.operation().result().UnpackTo(&createVolumeResult);
238
209
}
239
210
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 = {} ) {
241
212
std::unique_ptr<Ydb::KeyValue::V1::KeyValueService::Stub> stub;
242
213
stub = Ydb::KeyValue::V1::KeyValueService::NewStub(channel);
243
214
244
215
Ydb::KeyValue::AlterVolumeRequest alterVolumeRequest;
245
216
alterVolumeRequest.set_path(path);
246
217
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
+ }
247
225
248
226
Ydb::KeyValue::AlterVolumeResponse alterVolumeResponse;
249
227
Ydb::KeyValue::AlterVolumeResult alterVolumeResult;
@@ -831,6 +809,15 @@ Y_UNIT_TEST_SUITE(KeyValueGRPCService) {
831
809
UNIT_ASSERT_VALUES_EQUAL(channel.media(), " ssd" );
832
810
}
833
811
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
+
834
821
DropVolume(channel, tablePath);
835
822
listDirectoryResult = ListDirectory(channel, path);
836
823
UNIT_ASSERT_VALUES_EQUAL(listDirectoryResult.self().name(), " mydb" );
0 commit comments