Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yegorskii committed Jan 30, 2024
1 parent 1a82150 commit c46a764
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cloud/blockstore/libs/endpoints/endpoint_manager_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <cloud/blockstore/libs/encryption/encryption_client.h>
#include <cloud/blockstore/libs/encryption/encryption_key.h>
#include <cloud/blockstore/libs/endpoints_grpc/socket_endpoint_listener.h>
#include <cloud/blockstore/libs/server/client_acceptor.h>
#include <cloud/blockstore/libs/server/client_storage_factory.h>
#include <cloud/blockstore/libs/service/service_test.h>
#include <cloud/blockstore/libs/service/storage_provider.h>

Expand Down Expand Up @@ -913,7 +913,7 @@ Y_UNIT_TEST_SUITE(TEndpointManagerTest)
TBootstrap bootstrap(CreateTestService(mountedVolumes));

auto grpcListener = CreateSocketEndpointListener(bootstrap.Logging, 16);
grpcListener->SetClientAcceptor(CreateClientAcceptorStub());
grpcListener->SetClientStorageFactory(CreateClientStorageFactoryStub());

auto manager = CreateEndpointManager(
bootstrap,
Expand Down
28 changes: 28 additions & 0 deletions cloud/blockstore/libs/server/client_storage_factory.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
#include "client_storage_factory.h"

namespace NCloud::NBlockStore::NServer {

using namespace NCloud::NStorage::NServer;

////////////////////////////////////////////////////////////////////////////////

struct TClientStorageFactoryStub
: public IClientStorageFactory
{
NStorage::NServer::IClientStoragePtr CreateClientStorage(
IBlockStorePtr service) override
{
Y_UNUSED(service);
return CreateClientStorageStub();
}
};

////////////////////////////////////////////////////////////////////////////////

IClientStorageFactoryPtr CreateClientStorageFactoryStub()
{
return std::make_shared<TClientStorageFactoryStub>();
}

////////////////////////////////////////////////////////////////////////////////

} // namespace NCloud::NBlockStore::NServer
6 changes: 6 additions & 0 deletions cloud/blockstore/libs/server/client_storage_factory.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include "public.h"

#include <cloud/blockstore/libs/service/public.h>

#include <cloud/storage/core/libs/uds/client_storage.h>
Expand All @@ -18,4 +20,8 @@ struct IClientStorageFactory

////////////////////////////////////////////////////////////////////////////////

IClientStorageFactoryPtr CreateClientStorageFactoryStub();

////////////////////////////////////////////////////////////////////////////////

} // namespace NCloud::NBlockStore::NServer
3 changes: 1 addition & 2 deletions cloud/blockstore/libs/server/public.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ struct IServer;
using IServerPtr = std::shared_ptr<IServer>;

struct IClientStorageFactory;
using IClientStorageFactoryPtr =
std::shared_ptr<IClientStorageFactory>;
using IClientStorageFactoryPtr = std::shared_ptr<IClientStorageFactory>;

} // namespace NServer
} // namespace NCloud::NBlockStore

0 comments on commit c46a764

Please sign in to comment.