6
6
#include " blobstorage_pdisk_actorsystem_creator.h"
7
7
#include " blobstorage_pdisk_mon.h"
8
8
#include " blobstorage_pdisk_ut_defs.h"
9
+ #include " blobstorage_pdisk_ut_helpers.h"
9
10
10
11
#include < ydb/core/control/immediate_control_board_wrapper.h>
11
12
@@ -138,16 +139,6 @@ class TCompletionWorkerWithCounter : public NPDisk::TCompletionAction {
138
139
TDuration WorkTime;
139
140
};
140
141
141
- static TString MakeDatabasePath (const char *dir) {
142
- TString databaseDirectory = Sprintf (" %s/yard" , dir);
143
- return databaseDirectory;
144
- }
145
-
146
- static TString MakePDiskPath (const char *dir) {
147
- TString databaseDirectory = MakeDatabasePath (dir);
148
- return databaseDirectory + " /pdisk.dat" ;
149
- }
150
-
151
142
TString CreateFile (const char *baseDir, ui32 dataSize) {
152
143
TString databaseDirectory = MakeDatabasePath (baseDir);
153
144
MakeDirIfNotExist (databaseDirectory.c_str ());
@@ -249,6 +240,7 @@ Y_UNIT_TEST_SUITE(TBlockDeviceTest) {
249
240
THolder<TPDiskMon> mon (new TPDiskMon (counters, 0 , nullptr ));
250
241
251
242
ui32 buffSize = 64_KB;
243
+ auto randomData = PrepareData (buffSize);
252
244
ui32 bufferPoolSize = 512 ;
253
245
THolder<NPDisk::TBufferPool> bufferPool (NPDisk::CreateBufferPool (buffSize, bufferPoolSize, false , {}));
254
246
ui64 inFlight = 128 ;
@@ -273,6 +265,7 @@ Y_UNIT_TEST_SUITE(TBlockDeviceTest) {
273
265
device->PreadAsync (data, 32_KB, 0 , buffer.Release (), TReqId (), nullptr );
274
266
break ;
275
267
case 1 :
268
+ memcpy (data, randomData.data (), 32_KB);
276
269
device->PwriteAsync (data, 32_KB, 0 , buffer.Release (), TReqId (), nullptr );
277
270
break ;
278
271
case 2 :
0 commit comments