@@ -29,6 +29,17 @@ const bool ENABLE_DETAILED_CMS_LOG = true;
29
29
const bool ENABLE_DETAILED_CMS_LOG = false ;
30
30
#endif
31
31
32
+ #define COMMA ,
33
+ Y_DECLARE_OUT_SPEC (, std::map<NKikimrBlobStorage::EDriveStatus COMMA std::set<ui32>>, o, value) {
34
+ std::vector<TString> pairs;
35
+ for (const auto & [status, nodes] : value) {
36
+ pairs.push_back (
37
+ TStringBuilder () << status << " =" << ' [' << JoinSeq (' ,' , nodes) << ' ]'
38
+ );
39
+ }
40
+ o << ' [' << JoinSeq (' ,' , pairs) << ' ]' ;
41
+ };
42
+
32
43
namespace NKikimr {
33
44
namespace NCmsTest {
34
45
@@ -391,7 +402,7 @@ static NKikimrConfig::TBootstrap GenerateBootstrapConfig(TTestActorRuntime &runt
391
402
return res;
392
403
}
393
404
394
- static void SetupServices (TTestActorRuntime &runtime, const TTestEnvOpts &options) {
405
+ static void SetupServices (TTestBasicRuntime &runtime, const TTestEnvOpts &options) {
395
406
const ui32 domainsNum = 1 ;
396
407
const ui32 disksInDomain = 1 ;
397
408
@@ -503,6 +514,7 @@ static void SetupServices(TTestActorRuntime &runtime, const TTestEnvOpts &option
503
514
),
504
515
0 );
505
516
517
+ runtime.LocationCallback = options.NodeLocationCallback ;
506
518
runtime.Initialize (app.Unwrap ());
507
519
auto dnsConfig = new TDynamicNameserviceConfig ();
508
520
dnsConfig->MaxStaticNodeId = 1000 ;
@@ -868,6 +880,39 @@ TCmsTestEnv::CheckRequest(const TString &user,
868
880
return rec;
869
881
}
870
882
883
+ void TCmsTestEnv::CheckBSCUpdateRequests (std::set<ui32> expectedNodes,
884
+ NKikimrBlobStorage::EDriveStatus expectedStatus)
885
+ {
886
+ using TBSCRequests = std::map<NKikimrBlobStorage::EDriveStatus, std::set<ui32>>;
887
+
888
+ TBSCRequests expectedRequests = { {expectedStatus, expectedNodes} };
889
+ TBSCRequests actualRequests;
890
+
891
+ TDispatchOptions options;
892
+ options.FinalEvents .emplace_back ([&](IEventHandle& ev) {
893
+ if (ev.GetTypeRewrite () == TEvBlobStorage::TEvControllerConfigRequest::EventType) {
894
+ const auto & request = ev.Get <TEvBlobStorage::TEvControllerConfigRequest>()->Record ;
895
+ bool foundUpdateDriveCommand = false ;
896
+ for (const auto & command : request.GetRequest ().GetCommand ()) {
897
+ if (command.HasUpdateDriveStatus ()) {
898
+ foundUpdateDriveCommand = true ;
899
+ const auto & update = command.GetUpdateDriveStatus ();
900
+ actualRequests[update.GetStatus ()].insert (update.GetHostKey ().GetNodeId ());
901
+ }
902
+ }
903
+ return foundUpdateDriveCommand;
904
+ }
905
+ return false ;
906
+ });
907
+ DispatchEvents (options, TDuration::Minutes (1 ));
908
+
909
+ UNIT_ASSERT_C (
910
+ actualRequests == expectedRequests,
911
+ TStringBuilder () << " Sentinel sent wrong update requests to BSC: "
912
+ << " expected# " << expectedRequests
913
+ << " , actual# " << actualRequests
914
+ );
915
+ }
871
916
872
917
void TCmsTestEnv::CheckWalleStoreTaskIsFailed (NCms::TEvCms::TEvStoreWalleTask* req)
873
918
{
0 commit comments