DataTransferSessionTest.cpp 44.6 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/******************************************************************************
 *
 * This file is part of the Castor project.
 * See http://castor.web.cern.ch/castor
 *
 * Copyright (C) 2003  CERN
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * 
 *
 * @author Castor Dev team, castor-dev@cern.ch
 *****************************************************************************/

24
25
26
27
#define __STDC_CONSTANT_MACROS // For using stdint macros (stdint is included
// by inttypes.h, so we shoot first)
#include <stdint.h>
#include <inttypes.h>
28
#include <gtest/gtest.h>
29

30
#include "castor/legacymsg/RmcProxyDummy.hpp"
31
#include "castor/log/StringLogger.hpp"
32
33
34
#include "castor/mediachanger/MediaChangerFacade.hpp"
#include "castor/mediachanger/MmcProxyDummy.hpp"
#include "castor/messages/AcsProxyDummy.hpp"
35
#include "castor/messages/TapeserverProxyDummy.hpp"
36
#include "castor/server/ProcessCapDummy.hpp"
37
#include "castor/server/Threading.hpp"
38
#include "castor/tape/tapeserver/daemon/DataTransferSession.hpp"
39
#include "castor/tape/tapeserver/daemon/VolumeInfo.hpp"
40
41
#include "castor/tape/tapeserver/system/Wrapper.hpp"
#include "castor/tape/tapeserver/file/File.hpp"
42
#include "castor/tape/tapeserver/drive/FakeDrive.hpp"
43
44
#include "common/exception/Exception.hpp"
#include "common/Utils.hpp"
45
#include "Ctape.h"
46
#include "scheduler/Scheduler.hpp"
47
#include "smc_struct.h"
48
49
#include "nameserver/mockNS/MockNameServer.hpp"
#include "remotens/MockRemoteNS.hpp"
50
#include "scheduler/DummyScheduler.hpp"
51
#include "scheduler/OStoreDB/OStoreDBFactory.hpp"
52
#include "scheduler/MountType.hpp"
53

54
#include <dirent.h>
55
#include <fcntl.h>
56
#include <stdexcept>
Eric Cano's avatar
Eric Cano committed
57
58
59
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
60
61
#include <unistd.h>
#include <zlib.h>
Eric Cano's avatar
Eric Cano committed
62

63
using namespace castor::tape::tapeserver;
64
using namespace castor::tape::tapeserver::daemon;
65
66
namespace unitTest {

67
68
class castor_tape_tapeserver_daemon_DataTransferSessionTest: public
  ::testing::Test {
69
70
71
protected:

  void SetUp() {
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
    strncpy(m_tmpDir, "/tmp/DataTransferSessionTestXXXXXX", sizeof(m_tmpDir));
    if(!mkdtemp(m_tmpDir)) {
      const std::string errMsg = cta::Utils::errnoToString(errno);
      std::ostringstream msg;
      msg << "Failed to create directory with template"
        " /tmp/DataTransferSessionTestXXXXXX: " << errMsg;
      bzero(m_tmpDir, sizeof(m_tmpDir));
      throw cta::exception::Exception(msg.str());
    }

    struct stat statBuf;
    bzero(&statBuf, sizeof(statBuf));
    if(stat(m_tmpDir, &statBuf)) {
      const std::string errMsg = cta::Utils::errnoToString(errno);
      std::ostringstream msg;
      msg << "Failed to stat directory " << m_tmpDir << ": " << errMsg;
      throw cta::exception::Exception(msg.str());
    }

    std::ostringstream cmd;
    cmd << "touch " << m_tmpDir << "/hello";
    system(cmd.str().c_str());
94
95
96
  }

  void TearDown() {
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
    // If Setup() created a temporary directory
    if(m_tmpDir) {

      // Openn the directory
      std::unique_ptr<DIR, std::function<int(DIR*)>>
        dir(opendir(m_tmpDir), closedir);
      if(NULL == dir.get()) {
        const std::string errMsg = cta::Utils::errnoToString(errno);
        std::ostringstream msg;
        msg << "Failed to open directory " << m_tmpDir << ": " << errMsg;
        throw cta::exception::Exception(msg.str());
      }

      // Delete each of the files within the directory
      struct dirent *entry = NULL;
      while((entry = readdir(dir.get()))) {
        const std::string entryName(entry->d_name);
        if(entryName != "." && entryName != "..") {
          const std::string entryPath = std::string(m_tmpDir) + "/" + entryName;
          if(unlink(entryPath.c_str())) {
            const std::string errMsg = cta::Utils::errnoToString(errno);
            std::ostringstream msg;
            msg << "Failed to unlink " << entryPath;
            throw cta::exception::Exception(msg.str());
          }
        }
      }

      // Delete the now empty directory
      if(rmdir(m_tmpDir)) {
        const std::string errMsg = cta::Utils::errnoToString(errno);
        std::ostringstream msg;
        msg << "Failed to delete directory " << m_tmpDir << ": " << errMsg;
        throw cta::exception::Exception(msg.str());
      }
    }
133
  }
134

135
136
137
138
139
140
141
  /**
   * Temporary directory created with mkdtemp that will be used to contain the
   * destination remote files of the tests that need to create them.
   *
   * Please note that a new temporary directory is created and deleted for each
   * test by the Setup() and TearDown() methods.
   */
142
143
  char m_tmpDir[100];

144
145
  class MockArchiveJob: public cta::ArchiveJob {
  public:
146
147
148
    MockArchiveJob(): cta::ArchiveJob(*((cta::ArchiveMount *)NULL), 
        *((cta::NameServer *)NULL), cta::ArchiveFile(), 
        cta::RemotePathAndStatus(), cta::NameServerTapeFile()) {
149
150
151
152
153
154
155
156
157
158
159
160
161
162
    } 
      
    ~MockArchiveJob() throw() {
    } 
  };

  class MockRetrieveJob: public cta::RetrieveJob {
  public:
    MockRetrieveJob() {
    } 
      
    ~MockRetrieveJob() throw() {
    } 
  };
163
164
};

165
TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessionGooddayRecall) {
Eric Cano's avatar
Eric Cano committed
166
167
168
  // 0) Prepare the logger for everyone
  castor::log::StringLogger logger("tapeServerUnitTest");
  
169
  // 1) prepare the fake scheduler
170
  std::string vid = "V12345";
171
  // cta::MountType::Enum mountType = cta::MountType::RETRIEVE;
172
  std::string density = "8000GC";
173

174
175
  // 3) Prepare the necessary environment (logger, plus system wrapper), 
  castor::tape::System::mockWrapper mockSys;
176
177
  mockSys.delegateToFake();
  mockSys.disableGMockCallsCounting();
178
  mockSys.fake.setupForVirtualDriveSLC6();
179
180
181
  //delete is unnecessary
  //pointer with ownership will be passed to the application,
  //which will do the delete 
182
  mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drive::FakeDrive;
183
184
185
186

  // 4) Create the scheduler
  cta::MockNameServer ns;
  cta::MockRemoteNS rns;
187
  cta::OStoreDBWrapper<cta::objectstore::BackendVFS> db("Unittest");
188
189
190
191
192
193
194
195
  cta::Scheduler scheduler(ns, db, rns);

  // Always use the same requester
  const cta::SecurityIdentity requester;

  // List to remember the path of each remote file so that the existance of the
  // files can be tested for at the end of the test
  std::list<std::string> remoteFilePaths;
196
  
197
  // 5) Prepare files for reading by writing them to the mock system
198
199
200
  {
    // Label the tape
    castor::tape::tapeFile::LabelSession ls(*mockSys.fake.m_pathToDrive["/dev/nst0"], 
201
        "V12345");
202
203
    mockSys.fake.m_pathToDrive["/dev/nst0"]->rewind();
    // And write to it
204
    castor::tape::tapeserver::daemon::VolumeInfo volInfo;
205
    volInfo.vid="V12345";
206
    castor::tape::tapeFile::WriteSession ws(*mockSys.fake.m_pathToDrive["/dev/nst0"],
207
       volInfo , 0, true);
208
209
210

    // Write a few files on the virtual tape and modify the archive name space
    // so that it is in sync
211
212
213
    uint8_t data[1000];
    castor::tape::SCSI::Structures::zeroStruct(&data);
    for (int fseq=1; fseq <= 10 ; fseq ++) {
214
215
      // Create a path to a remote destination file
      std::ostringstream remoteFilePath;
216
      remoteFilePath << "file:" << m_tmpDir << "/test" << fseq;
217
218
      remoteFilePaths.push_back(remoteFilePath.str());

219
      // Create an archive file entry in the archive namespace
220
221
222
223
      std::ostringstream archiveFilePath;
      archiveFilePath << "/test" << fseq;
      const mode_t archiveFileMode = 0655;
      const uint64_t archiveFileSize = 256*1024;
224
      ASSERT_NO_THROW(ns.createFile(
225
226
227
        requester,
        archiveFilePath.str(),
        archiveFileMode,
228
229
        archiveFileSize));
        
230
      // Write the file to tape
231
      std::unique_ptr<cta::RetrieveJob> ftr(new MockRetrieveJob());
232
      std::unique_ptr<cta::ArchiveJob> ftm(new MockArchiveJob());
233
      ftr->tapeFileLocation.fSeq = fseq;
234
      ftm->nameServerTapeFile.tapeFileLocation.fSeq = fseq;
235
      ftr->archiveFile.fileId = 1000 + fseq;
236
237
      ftm->archiveFile.fileId = 1000 + fseq;
      castor::tape::tapeFile::WriteFile wf(&ws, *ftm, archiveFileSize);
238
      ftr->tapeFileLocation.blockId = wf.getPosition();
239
      ftr->remotePathAndStatus.path = remoteFilePath.str();
240
241
242
243
      // Write the data (one block)
      wf.write(data, sizeof(data));
      // Close the file
      wf.close();
244

245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
      // Create tape file entry in the archive namespace
      cta::NameServerTapeFile tapeFile;
      tapeFile.copyNb = 1;
      tapeFile.tapeFileLocation.fSeq = fseq;
      tapeFile.tapeFileLocation.blockId = wf.getPosition();
      tapeFile.tapeFileLocation.vid = volInfo.vid;
      tapeFile.tapeFileLocation.copyNb = 1;
      tapeFile.size = archiveFileSize;
      tapeFile.compressedSize = archiveFileSize; // No compression
      cta::Checksum tapeFileChecksum(cta::Checksum::CHECKSUMTYPE_ADLER32,
        cta::ByteArray(cta::Utils::getAdler32(data, sizeof data)));
      tapeFile.checksum = tapeFileChecksum;
      ASSERT_NO_THROW(ns.addTapeFile(
        requester,
        archiveFilePath.str(),
        tapeFile));

262
263
264
      // Schedule the retrieval of the file
      std::list<std::string> archiveFilePaths;
      archiveFilePaths.push_back(archiveFilePath.str());
265
      ASSERT_NO_THROW(scheduler. queueRetrieveRequest(
266
267
        requester,
        archiveFilePaths,
268
        remoteFilePath.str()));
269
270
    }
  }
271
272

  // 6) Create the data transfer session
273
  DriveConfig driveConfig("T10D6116", "T10KD6", "/dev/tape_T10D6116", "manual");
274
275
276
277
278
279
  DataTransferConfig castorConf;
  castorConf.bufsz = 1024*1024; // 1 MB memory buffers
  castorConf.nbBufs = 10;
  castorConf.bulkRequestRecallMaxBytes = UINT64_C(100)*1000*1000*1000;
  castorConf.bulkRequestRecallMaxFiles = 1000;
  castorConf.nbDiskThreads = 1;
280
281
282
283
  castor::messages::AcsProxyDummy acs;
  castor::mediachanger::MmcProxyDummy mmc;
  castor::legacymsg::RmcProxyDummy rmc;
  castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
284
  castor::server::ProcessCap capUtils;
285
  castor::messages::TapeserverProxyDummy initialProcess;
286
  DataTransferSession sess("tapeHost", logger, mockSys,
287
    driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
288
289

  // 7) Run the data transfer session
290
  ASSERT_NO_THROW(sess.execute());
291
292

  // 8) Check the session git the correct VID
293
  ASSERT_EQ("V12345", sess.getVid());
294

295
  // 9) Check the remote files exist and have the correct size
296
297
298
299
300
301
302
303
  for(auto pathItor = remoteFilePaths.cbegin(); pathItor !=
    remoteFilePaths.cend(); pathItor++) {
    struct stat statBuf;
    bzero(&statBuf, sizeof(statBuf));
    const int statRc = stat(pathItor->c_str(), &statBuf);
    ASSERT_EQ(0, statRc);
    ASSERT_EQ(256*1024, statBuf.st_size);
  }
304
}
305

306
TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessionWrongRecall) {
307
308
309
  // This test is the same as the previous one, with 
  // wrong parameters set for the recall, so that we fail 
  // to recall the first file and cancel the second.
310
311

  // 0) Prepare the logger for everyone
312
313
  castor::log::StringLogger logger("tapeServerUnitTest");
  
314
  // 1) prepare the fake scheduler
315
  std::string vid = "V12345";
316
  // cta::MountType::Enum mountType = cta::MountType::RETRIEVE;
317
  std::string density = "8000GC";
318

319
320
321
322
323
324
325
326
  // 3) Prepare the necessary environment (logger, plus system wrapper), 
  castor::tape::System::mockWrapper mockSys;
  mockSys.delegateToFake();
  mockSys.disableGMockCallsCounting();
  mockSys.fake.setupForVirtualDriveSLC6();
  //delete is unnecessary
  //pointer with ownership will be passed to the application,
  //which will do the delete 
327
  mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drive::FakeDrive;
328
329
330
331

  // 4) Create the scheduler
  cta::MockNameServer ns;
  cta::MockRemoteNS rns;
332
  cta::OStoreDBWrapper<cta::objectstore::BackendVFS> db("Unittest");
333
334
335
336
337
338
339
340
  cta::Scheduler scheduler(ns, db, rns);

  // Always use the same requester
  const cta::SecurityIdentity requester;

  // List to remember the path of each remote file so that the existance of the
  // files can be tested for at the end of the test
  std::list<std::string> remoteFilePaths;
341
  
342
  // 5) Prepare files for reading by writing them to the mock system
343
344
345
  {
    // Label the tape
    castor::tape::tapeFile::LabelSession ls(*mockSys.fake.m_pathToDrive["/dev/nst0"], 
346
        "V12345");
347
348
    mockSys.fake.m_pathToDrive["/dev/nst0"]->rewind();
    // And write to it
349
    castor::tape::tapeserver::daemon::VolumeInfo volInfo;
350
351
352
    volInfo.vid="V12345";
    castor::tape::tapeFile::WriteSession ws(*mockSys.fake.m_pathToDrive["/dev/nst0"],
       volInfo , 0, true);
353
354
355

    // Write a few files on the virtual tape and modify the archive name space
    // so that it is in sync
356
357
358
    uint8_t data[1000];
    castor::tape::SCSI::Structures::zeroStruct(&data);
    for (int fseq=1; fseq <= 10 ; fseq ++) {
359
360
361
362
363
      // Create a path to a remote destination file
      std::ostringstream remoteFilePath;
      remoteFilePath << "file:" << m_tmpDir << "/test" << fseq;
      remoteFilePaths.push_back(remoteFilePath.str());

364
      // Create an archive file entry in the archive namespace
365
366
367
368
      std::ostringstream archiveFilePath;
      archiveFilePath << "/test" << fseq;
      const mode_t archiveFileMode = 0655;
      const uint64_t archiveFileSize = 256*1024;
369
      ASSERT_NO_THROW(ns.createFile(
370
371
372
        requester,
        archiveFilePath.str(),
        archiveFileMode,
373
        archiveFileSize));
374
375

      // Write the file to tape
376
377
378
      std::unique_ptr<cta::RetrieveJob> ftr(new MockRetrieveJob());
      std::unique_ptr<cta::ArchiveJob> ftm_temp(new MockArchiveJob());
      ftr->tapeFileLocation.fSeq = fseq;
379
      ftm_temp->nameServerTapeFile.tapeFileLocation.fSeq = fseq;
380
381
      ftr->archiveFile.fileId = 1000 + fseq;
      ftm_temp->archiveFile.fileId = 1000 + fseq;
382
      castor::tape::tapeFile::WriteFile wf(&ws, *ftm_temp, archiveFileSize);
383
      ftr->tapeFileLocation.blockId = wf.getPosition();
384
      ftr->remotePathAndStatus.path = remoteFilePath.str();
385
386
387
388
      // Write the data (one block)
      wf.write(data, sizeof(data));
      // Close the file
      wf.close();
389

390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
      // Create tape file entry in the archive namespace that is beyond the end
      // of data
      cta::NameServerTapeFile tapeFile;
      tapeFile.copyNb = 1;
      tapeFile.tapeFileLocation.fSeq = fseq + 10000;
      tapeFile.tapeFileLocation.blockId = wf.getPosition() + 10000;
      tapeFile.tapeFileLocation.vid = volInfo.vid;
      tapeFile.tapeFileLocation.copyNb = 1;
      tapeFile.size = archiveFileSize;
      tapeFile.compressedSize = archiveFileSize; // No compression
      cta::Checksum tapeFileChecksum(cta::Checksum::CHECKSUMTYPE_ADLER32,
        cta::ByteArray(cta::Utils::getAdler32(data, sizeof data)));
      tapeFile.checksum = tapeFileChecksum;
      ASSERT_NO_THROW(ns.addTapeFile(
        requester,
        archiveFilePath.str(),
        tapeFile));

408
409
410
      // Schedule the retrieval of the file
      std::list<std::string> archiveFilePaths;
      archiveFilePaths.push_back(archiveFilePath.str());
411
      ASSERT_NO_THROW(scheduler. queueRetrieveRequest(
412
413
        requester,
        archiveFilePaths,
414
        remoteFilePath.str()));
415
416
    }
  }
417
418

  // 6) Create the data transfer session
419
  DriveConfig driveConfig("T10D6116", "T10KD6", "/dev/tape_T10D6116", "manual");
420
421
422
423
424
425
  DataTransferConfig castorConf;
  castorConf.bufsz = 1024*1024; // 1 MB memory buffers
  castorConf.nbBufs = 10;
  castorConf.bulkRequestRecallMaxBytes = UINT64_C(100)*1000*1000*1000;
  castorConf.bulkRequestRecallMaxFiles = 1000;
  castorConf.nbDiskThreads = 1;
426
427
428
429
  castor::messages::AcsProxyDummy acs;
  castor::mediachanger::MmcProxyDummy mmc;
  castor::legacymsg::RmcProxyDummy rmc;
  castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
430
431
  castor::server::ProcessCap capUtils;
  castor::messages::TapeserverProxyDummy initialProcess;
432
  DataTransferSession sess("tapeHost", logger, mockSys,
433
    driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
434
435
436
437
438

  // 7) Run the data transfer session
  ASSERT_NO_THROW(sess.execute());

  // 8) Check the session git the correct VID
439
  ASSERT_EQ("V12345", sess.getVid());
440
441
442
443
444
445
446
447
448
449

  // 9) Check the remote files exist and have the correct size
  for(auto pathItor = remoteFilePaths.cbegin(); pathItor !=
    remoteFilePaths.cend(); pathItor++) {
    struct stat statBuf;
    bzero(&statBuf, sizeof(statBuf));
    const int statRc = stat(pathItor->c_str(), &statBuf);
    ASSERT_EQ(0, statRc);
    ASSERT_EQ(256*1024, statBuf.st_size);
  }
450
}
451

452
TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessionNoSuchDrive) {
453
454
455
456
457
  
  // 0) Prepare the logger for everyone
  castor::log::StringLogger logger("tapeServerUnitTest");
  
  // 1) prepare the fake scheduler
458
  std::string vid = "V12345";
459
  // cta::MountType::Enum mountType = cta::MountType::RETRIEVE;
460
  std::string density = "8000GC";
461

462
463
464
465
466
  // 3) Prepare the necessary environment (logger, plus system wrapper), 
  castor::tape::System::mockWrapper mockSys;
  mockSys.delegateToFake();
  mockSys.disableGMockCallsCounting();
  mockSys.fake.setupForVirtualDriveSLC6();
467
468
469
470
471
472
473
474
  //delete is unnecessary
  //pointer with ownership will be passed to the application,
  //which will do the delete 
  mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drive::FakeDrive;

  // 4) Create the scheduler
  cta::MockNameServer ns;
  cta::MockRemoteNS rns;
475
  cta::OStoreDBWrapper<cta::objectstore::BackendVFS> db("Unittest");
476
477
478
479
480
  cta::Scheduler scheduler(ns, db, rns);

  // Always use the same requester
  const cta::SecurityIdentity requester;
  
481
  DriveConfig driveConfig("T10D6116", "T10KD6", "/dev/noSuchTape", "manual");
482
483
484
  DataTransferConfig castorConf;
  castorConf.bufsz = 1024;
  castorConf.nbBufs = 10;
485
486
487
488
  castor::messages::AcsProxyDummy acs;
  castor::mediachanger::MmcProxyDummy mmc;
  castor::legacymsg::RmcProxyDummy rmc;
  castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
489
  castor::messages::TapeserverProxyDummy initialProcess;
490
  castor::server::ProcessCapDummy capUtils;
491
  DataTransferSession sess("tapeHost", logger, mockSys,
492
    driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
493
  ASSERT_NO_THROW(sess.execute());
494
495
496
497
  std::string temp = logger.getLog();
  ASSERT_NE(std::string::npos, logger.getLog().find("Drive not found on this path"));
}

498
TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessionFailtoMount) {
499
500
  
  // 0) Prepare the logger for everyone
501
502
  castor::log::StringLogger logger("tapeServerUnitTest");
  
503
  // 1) prepare the fake scheduler
504
  std::string vid = "V12345";
505
  // cta::MountType::Enum mountType = cta::MountType::RETRIEVE;
506
  std::string density = "8000GC";
507

508
509
510
511
512
  // 3) Prepare the necessary environment (logger, plus system wrapper), 
  castor::tape::System::mockWrapper mockSys;
  mockSys.delegateToFake();
  mockSys.disableGMockCallsCounting();
  mockSys.fake.setupForVirtualDriveSLC6();
513
514
515
516
517
518
519
520
  //delete is unnecessary
  //pointer with ownership will be passed to the application,
  //which will do the delete 
  mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drive::FakeDrive;

  // 4) Create the scheduler
  cta::MockNameServer ns;
  cta::MockRemoteNS rns;
521
  cta::OStoreDBWrapper<cta::objectstore::BackendVFS> db("Unittest");
522
523
524
525
526
527
528
529
  cta::Scheduler scheduler(ns, db, rns);

  // Always use the same requester
  const cta::SecurityIdentity requester;
  
  // List to remember the path of each remote file so that the existance of the
  // files can be tested for at the end of the test
  std::list<std::string> remoteFilePaths;
530
531
532
533
534
535
536
537
538

  //delete is unnecessary
  //pointer with ownership will be passed to the application,
  //which will do the delete 
  const bool failOnMount=true;
  mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drive::FakeDrive(failOnMount);
  
  // We can prepare files for reading on the drive
  {
539
    
540
541
    // Label the tape
    castor::tape::tapeFile::LabelSession ls(*mockSys.fake.m_pathToDrive["/dev/nst0"], 
542
        "V12345");
543
544
    mockSys.fake.m_pathToDrive["/dev/nst0"]->rewind();
    // And write to it
545
    castor::tape::tapeserver::daemon::VolumeInfo volInfo;
546
    volInfo.vid="V12345";
547
548
549
550
551
552
553
    castor::tape::tapeFile::WriteSession ws(*mockSys.fake.m_pathToDrive["/dev/nst0"],
       volInfo , 0, true);

    // Write a few files on the virtual tape and modify the archive name space
    // so that it is in sync
    uint8_t data[1000];
    castor::tape::SCSI::Structures::zeroStruct(&data);
554
    for (int fseq=1; fseq <= 10 ; fseq ++) {
555
556
557
558
559
      // Create a path to a remote destination file
      std::ostringstream remoteFilePath;
      remoteFilePath << "file:" << m_tmpDir << "/test" << fseq;
      remoteFilePaths.push_back(remoteFilePath.str());

560
      // Create an archive file entry in the archive namespace
561
562
563
564
      std::ostringstream archiveFilePath;
      archiveFilePath << "/test" << fseq;
      const mode_t archiveFileMode = 0655;
      const uint64_t archiveFileSize = 256*1024;
565
      ASSERT_NO_THROW(ns.createFile(
566
567
568
        requester,
        archiveFilePath.str(),
        archiveFileMode,
569
        archiveFileSize));
570
571

      // Write the file to tape
572
      std::unique_ptr<cta::RetrieveJob> ftr(new MockRetrieveJob());
573
      std::unique_ptr<cta::ArchiveJob> ftm_temp(new MockArchiveJob());
574
      ftr->tapeFileLocation.fSeq = fseq;
575
      ftm_temp->nameServerTapeFile.tapeFileLocation.fSeq = fseq;
576
      ftr->archiveFile.fileId = 1000 + fseq;
577
578
579
580
581
582
583
584
585
      ftm_temp->archiveFile.fileId = 1000 + fseq;
      castor::tape::tapeFile::WriteFile wf(&ws, *ftm_temp, archiveFileSize);
      ftr->tapeFileLocation.blockId = wf.getPosition();
      ftr->remotePathAndStatus.path = remoteFilePath.str();
      // Write the data (one block)
      wf.write(data, sizeof(data));
      // Close the file
      wf.close();

586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
      // Create tape file entry in the archive namespace
      cta::NameServerTapeFile tapeFile;
      tapeFile.copyNb = 1;
      tapeFile.tapeFileLocation.fSeq = fseq;
      tapeFile.tapeFileLocation.blockId = wf.getPosition();
      tapeFile.tapeFileLocation.vid = volInfo.vid;
      tapeFile.tapeFileLocation.copyNb = 1;
      tapeFile.size = archiveFileSize;
      tapeFile.compressedSize = archiveFileSize; // No compression
      cta::Checksum tapeFileChecksum(cta::Checksum::CHECKSUMTYPE_ADLER32,
        cta::ByteArray(cta::Utils::getAdler32(data, sizeof data)));
      tapeFile.checksum = tapeFileChecksum;
      ASSERT_NO_THROW(ns.addTapeFile(
        requester,
        archiveFilePath.str(),
        tapeFile));

603
604
605
      // Schedule the retrieval of the file
      std::list<std::string> archiveFilePaths;
      archiveFilePaths.push_back(archiveFilePath.str());
606
      ASSERT_NO_THROW(scheduler. queueRetrieveRequest(
607
608
        requester,
        archiveFilePaths,
609
        remoteFilePath.str()));
610
611
    }
  }
612
  DriveConfig driveConfig("T10D6116", "T10KD6", "/dev/tape_T10D6116", "manual");
613
614
615
616
617
618
619
620
621
622
623
624
  DataTransferConfig castorConf;
  castorConf.bufsz = 1024*1024; // 1 MB memory buffers
  castorConf.nbBufs = 10;
  castorConf.bulkRequestRecallMaxBytes = UINT64_C(100)*1000*1000*1000;
  castorConf.bulkRequestRecallMaxFiles = 1000;
  castorConf.nbDiskThreads = 3;
  castor::messages::AcsProxyDummy acs;
  castor::mediachanger::MmcProxyDummy mmc;
  castor::legacymsg::RmcProxyDummy rmc;
  castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
  castor::server::ProcessCap capUtils;
  castor::messages::TapeserverProxyDummy initialProcess;
625
  DataTransferSession sess("tapeHost", logger, mockSys,
626
    driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
627
  ASSERT_NO_THROW(sess.execute());
628
629
630
631
632
  std::string temp = logger.getLog();
  temp += "";
  ASSERT_EQ("V12345", sess.getVid());
}

633
TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessionEmptyOnVolReq) {
634
635
  
  // 0) Prepare the logger for everyone
636
637
  castor::log::StringLogger logger("tapeServerUnitTest");
  
638
  // 1) prepare the fake scheduler
639
  std::string vid = "V12345";
640
  // cta::MountType::Enum mountType = cta::MountType::RETRIEVE;
641
  std::string density = "8000GC";
642

643
644
645
646
647
  // 3) Prepare the necessary environment (logger, plus system wrapper), 
  castor::tape::System::mockWrapper mockSys;
  mockSys.delegateToFake();
  mockSys.disableGMockCallsCounting();
  mockSys.fake.setupForVirtualDriveSLC6();
648
  
649
650
651
  // The drive will not even be opened. so no need for one.
  mockSys.fake.m_pathToDrive["/dev/nst0"] = NULL;
  
652
653
654
  // 4) Create the scheduler
  cta::MockNameServer ns;
  cta::MockRemoteNS rns;
655
  cta::OStoreDBWrapper<cta::objectstore::BackendVFS> db("Unittest");
656
657
658
659
660
  cta::Scheduler scheduler(ns, db, rns);

  // Always use the same requester
  const cta::SecurityIdentity requester;
  
661
  DriveConfig driveConfig("T10D6116", "T10KD6", "/dev/tape_T10D6116", "manual");
662
663
664
665
666
667
668
669
670
671
672
673
  DataTransferConfig castorConf;
  castorConf.bufsz = 1024*1024; // 1 MB memory buffers
  castorConf.nbBufs = 10;
  castorConf.bulkRequestRecallMaxBytes = UINT64_C(100)*1000*1000*1000;
  castorConf.bulkRequestRecallMaxFiles = 1000;
  castorConf.nbDiskThreads = 3;
  castor::messages::AcsProxyDummy acs;
  castor::mediachanger::MmcProxyDummy mmc;
  castor::legacymsg::RmcProxyDummy rmc;
  castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
  castor::server::ProcessCap capUtils;
  castor::messages::TapeserverProxyDummy initialProcess;
674
  DataTransferSession sess("tapeHost", logger, mockSys,
675
    driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
676
  ASSERT_NO_THROW(sess.execute());
677
678
679
680
681
682
  std::string temp = logger.getLog();
  temp += "";
  ASSERT_EQ("", sess.getVid());
  // We should not have logged any error
  ASSERT_EQ(std::string::npos, logger.getLog().find("LVL=E"));
}
683

684
TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessionGooddayMigration) {
685
  
Eric Cano's avatar
Eric Cano committed
686
687
688
  // 0) Prepare the logger for everyone
  castor::log::StringLogger logger("tapeServerUnitTest");
  
689
  // 1) prepare the fake scheduler
Eric Cano's avatar
Eric Cano committed
690
691
  std::string vid = "V12345";
  std::string density = "8000GC";
692

Eric Cano's avatar
Eric Cano committed
693
694
695
696
697
698
699
700
  // 3) Prepare the necessary environment (logger, plus system wrapper), 
  castor::tape::System::mockWrapper mockSys;
  mockSys.delegateToFake();
  mockSys.disableGMockCallsCounting();
  mockSys.fake.setupForVirtualDriveSLC6();
  //delete is unnecessary
  //pointer with ownership will be passed to the application,
  //which will do the delete 
701
  mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drive::FakeDrive;
702
703
704
705
706
707
708
709
710
711
712
713
714

  // 4) Create the scheduler
  cta::MockNameServer ns;
  cta::MockRemoteNS rns;
  cta::OStoreDBWrapper<cta::objectstore::BackendVFS> db("Unittest");
  cta::Scheduler scheduler(ns, db, rns);

  // Always use the same requester
  const cta::SecurityIdentity requester;
  
  // Create the bootstrap admin user and host
  ASSERT_NO_THROW(scheduler.createAdminUserWithoutAuthorizingRequester(requester, requester.getUser(), "admin user"));
  ASSERT_NO_THROW(scheduler.createAdminHostWithoutAuthorizingRequester(requester, requester.getHost(), "admin host"));
Eric Cano's avatar
Eric Cano committed
715
  
716
717
  // create a single copy storage class
  ASSERT_NO_THROW(scheduler.createStorageClass(requester, "SINGLE", 1, 1, "comment"));
Eric Cano's avatar
Eric Cano committed
718
  
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
  // assign it to the root directory
  ASSERT_NO_THROW(scheduler.setDirStorageClass(requester, "/", "SINGLE"));
  
  // create the logical library
  ASSERT_NO_THROW(scheduler.createLogicalLibrary(requester, "illogical", "the illogical library"));
  
  // create the tape pool
  ASSERT_NO_THROW(scheduler.createTapePool(requester, "swimmingpool", 2, "the swimming pool"));
  
  // create the route
  ASSERT_NO_THROW(scheduler.createArchiveRoute(requester, "SINGLE", 1, "swimmingpool", "iArchive"));
  
  // create the tape
  cta::CreationLog log;
  log.comment = "the magic tape";
  ASSERT_NO_THROW(scheduler.createTape(requester, "V12345", "illogical", "swimmingpool", 100000, log));
  
  // List to remember the path of each remote file so that the existence of the
  // files can be tested for at the end of the test
  std::list<std::string> remoteFilePaths;

  //delete is unnecessary
  //pointer with ownership will be passed to the application,
  //which will do the delete
  mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drive::FakeDrive();
  
  // We can prepare files for writing on the drive
  {    
    // Label the tape
    castor::tape::tapeFile::LabelSession ls(*mockSys.fake.m_pathToDrive["/dev/nst0"], "V12345");
    mockSys.fake.m_pathToDrive["/dev/nst0"]->rewind();
    
    // schedule the archivals
    for(int fseq=1; fseq <= 10 ; fseq ++) {      
      // Create a path to a remote destination file
      std::ostringstream remoteFilePath;
      remoteFilePath << "file:" << "/test" << fseq;
      remoteFilePaths.push_back(remoteFilePath.str());
      
      // Create the entry in the remote namespace (same user id of the requester)
      cta::RemotePath rpath(remoteFilePath.str());
      cta::RemoteFileStatus rstatus(requester.getUser(), 0777, 1000);
      rns.createEntry(rpath, rstatus);

      // Schedule the archival of the file
      std::list<std::string> remoteFilePathList;
      remoteFilePathList.push_back(remoteFilePath.str());
      ASSERT_NO_THROW(scheduler.queueArchiveRequest(requester, remoteFilePathList, rpath.getAfterScheme()));
    }
Eric Cano's avatar
Eric Cano committed
768
  }
769
  DriveConfig driveConfig("T10D6116", "T10KD6", "/dev/tape_T10D6116", "manual");
770
771
772
  DataTransferConfig castorConf;
  castorConf.bufsz = 1024*1024; // 1 MB memory buffers
  castorConf.nbBufs = 10;
773
774
  castorConf.bulkRequestRecallMaxBytes = UINT64_C(100)*1000*1000*1000;
  castorConf.bulkRequestRecallMaxFiles = 1000;
775
  castorConf.nbDiskThreads = 1;
776
777
778
779
  castor::messages::AcsProxyDummy acs;
  castor::mediachanger::MmcProxyDummy mmc;
  castor::legacymsg::RmcProxyDummy rmc;
  castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
780
  castor::server::ProcessCap capUtils;
781
  castor::messages::TapeserverProxyDummy initialProcess;
782
783
784
785
786
787
788
789
790
791
792
793
  DataTransferSession sess("tapeHost", logger, mockSys, driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
  ASSERT_NO_THROW(sess.execute());
  std::string temp = logger.getLog();
  temp += "";
  ASSERT_EQ("V12345", sess.getVid());
  for(auto i=remoteFilePaths.begin(); i!=remoteFilePaths.end(); i++) {
    cta::RemotePath rpath(*i);
    ASSERT_NO_THROW(ns.statFile(requester, rpath.getAfterScheme()));
    std::unique_ptr<cta::ArchiveFileStatus> stat(ns.statFile(requester, rpath.getAfterScheme()));
    ASSERT_NE((uint64_t)(stat.get()), NULL);
    ASSERT_EQ(stat->mode, 0777);
    ASSERT_EQ(stat->size, 1000);
794
  }
Eric Cano's avatar
Eric Cano committed
795
796
}

797
798
799
800
//
// This test is the same as the previous one, except that the files are deleted
// from filesystem immediately. The disk tasks will then fail on open.
///
801
TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessionMissingFilesMigration) {
802
  
803
804
805
  // 0) Prepare the logger for everyone
  castor::log::StringLogger logger("tapeServerUnitTest");
  
806
  // 1) prepare the fake scheduler
807
808
  std::string vid = "V12345";
  std::string density = "8000GC";
809

810
811
812
813
814
815
816
817
  // 3) Prepare the necessary environment (logger, plus system wrapper), 
  castor::tape::System::mockWrapper mockSys;
  mockSys.delegateToFake();
  mockSys.disableGMockCallsCounting();
  mockSys.fake.setupForVirtualDriveSLC6();
  //delete is unnecessary
  //pointer with ownership will be passed to the application,
  //which will do the delete 
818
  mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drive::FakeDrive;
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846

  // 4) Create the scheduler
  cta::MockNameServer ns;
  cta::MockRemoteNS rns;
  cta::OStoreDBWrapper<cta::objectstore::BackendVFS> db("Unittest");
  cta::Scheduler scheduler(ns, db, rns);

  // Always use the same requester
  const cta::SecurityIdentity requester;
  
  // Create the bootstrap admin user and host
  ASSERT_NO_THROW(scheduler.createAdminUserWithoutAuthorizingRequester(requester, requester.getUser(), "admin user"));
  ASSERT_NO_THROW(scheduler.createAdminHostWithoutAuthorizingRequester(requester, requester.getHost(), "admin host"));
  
  // create a single copy storage class
  ASSERT_NO_THROW(scheduler.createStorageClass(requester, "SINGLE", 1, 1, "comment"));
  
  // assign it to the root directory
  ASSERT_NO_THROW(scheduler.setDirStorageClass(requester, "/", "SINGLE"));
  
  // create the logical library
  ASSERT_NO_THROW(scheduler.createLogicalLibrary(requester, "illogical", "the illogical library"));
  
  // create the tape pool
  ASSERT_NO_THROW(scheduler.createTapePool(requester, "swimmingpool", 2, "the swimming pool"));
  
  // create the route
  ASSERT_NO_THROW(scheduler.createArchiveRoute(requester, "SINGLE", 1, "swimmingpool", "iArchive"));
847
  
848
849
850
851
  // create the tape
  cta::CreationLog log;
  log.comment = "the magic tape";
  ASSERT_NO_THROW(scheduler.createTape(requester, "V12345", "illogical", "swimmingpool", 100000, log));
852
  
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
  // List to remember the path of each remote file so that the existence of the
  // files can be tested for at the end of the test
  std::list<std::string> remoteFilePaths;

  //delete is unnecessary
  //pointer with ownership will be passed to the application,
  //which will do the delete
  mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drive::FakeDrive();
  
  // We can prepare files for writing on the drive
  {    
    // Label the tape
    castor::tape::tapeFile::LabelSession ls(*mockSys.fake.m_pathToDrive["/dev/nst0"], "V12345");
    mockSys.fake.m_pathToDrive["/dev/nst0"]->rewind();
    
    // schedule the archivals
    for(int fseq=1; fseq <= 10 ; fseq ++) {      
      // Create a path to a remote destination file
      std::ostringstream remoteFilePath;
      remoteFilePath << "file:" << "/test" << fseq;
      remoteFilePaths.push_back(remoteFilePath.str());
      
      // WE, ON PURPOSE, DO NOT create the entry in the remote namespace (see previous test))
      cta::RemotePath rpath(remoteFilePath.str());

      // Schedule the archival of the file
      std::list<std::string> remoteFilePathList;
      remoteFilePathList.push_back(remoteFilePath.str());
      ASSERT_NO_THROW(scheduler.queueArchiveRequest(requester, remoteFilePathList, rpath.getAfterScheme()));
    }
883
  }
884
  DriveConfig driveConfig("T10D6116", "T10KD6", "/dev/tape_T10D6116", "manual");
885
886
887
  DataTransferConfig castorConf;
  castorConf.bufsz = 1024*1024; // 1 MB memory buffers
  castorConf.nbBufs = 10;
888
889
  castorConf.bulkRequestRecallMaxBytes = UINT64_C(100)*1000*1000*1000;
  castorConf.bulkRequestRecallMaxFiles = 1000;
890
  castorConf.nbDiskThreads = 1;
891
892
893
894
  castor::messages::AcsProxyDummy acs;
  castor::mediachanger::MmcProxyDummy mmc;
  castor::legacymsg::RmcProxyDummy rmc;
  castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
895
  castor::server::ProcessCap capUtils;
896
  castor::messages::TapeserverProxyDummy initialProcess;
897
898
  DataTransferSession sess("tapeHost", logger, mockSys, driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
  ASSERT_THROW(sess.execute(), castor::exception::Exception); //this should throw because the remote NS open fails
899
}
900

901
902
903
904
905
//
// This test is identical to the good day migration, but the tape will accept
// only a finite number of bytes and hence we will report a full tape skip the
// last migrations
//
906
TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessionTapeFullMigration) {
907
  
908
909
910
  // 0) Prepare the logger for everyone
  castor::log::StringLogger logger("tapeServerUnitTest");
  
911
  // 1) prepare the fake scheduler
912
913
  std::string vid = "V12345";
  std::string density = "8000GC";
914

915
916
917
918
919
920
921
922
  // 3) Prepare the necessary environment (logger, plus system wrapper), 
  castor::tape::System::mockWrapper mockSys;
  mockSys.delegateToFake();
  mockSys.disableGMockCallsCounting();
  mockSys.fake.setupForVirtualDriveSLC6();
  //delete is unnecessary
  //pointer with ownership will be passed to the application,
  //which will do the delete 
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
  mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drive::FakeDrive;

  // 4) Create the scheduler
  cta::MockNameServer ns;
  cta::MockRemoteNS rns;
  cta::OStoreDBWrapper<cta::objectstore::BackendVFS> db("Unittest");
  cta::Scheduler scheduler(ns, db, rns);

  // Always use the same requester
  const cta::SecurityIdentity requester;
  
  // Create the bootstrap admin user and host
  ASSERT_NO_THROW(scheduler.createAdminUserWithoutAuthorizingRequester(requester, requester.getUser(), "admin user"));
  ASSERT_NO_THROW(scheduler.createAdminHostWithoutAuthorizingRequester(requester, requester.getHost(), "admin host"));
  
  // create a single copy storage class
  ASSERT_NO_THROW(scheduler.createStorageClass(requester, "SINGLE", 1, 1, "comment"));
  
  // assign it to the root directory
  ASSERT_NO_THROW(scheduler.setDirStorageClass(requester, "/", "SINGLE"));
  
  // create the logical library
  ASSERT_NO_THROW(scheduler.createLogicalLibrary(requester, "illogical", "the illogical library"));
  
  // create the tape pool
  ASSERT_NO_THROW(scheduler.createTapePool(requester, "swimmingpool", 2, "the swimming pool"));
  
  // create the route
  ASSERT_NO_THROW(scheduler.createArchiveRoute(requester, "SINGLE", 1, "swimmingpool", "iArchive"));
  
  // create the tape
  cta::CreationLog log;
  log.comment = "the magic tape";
  ASSERT_NO_THROW(scheduler.createTape(requester, "V12345", "illogical", "swimmingpool", 100000, log));
  
  // List to remember the path of each remote file so that the existence of the
  // files can be tested for at the end of the test
  std::list<std::string> remoteFilePaths;

  //delete is unnecessary
  //pointer with ownership will be passed to the application,
  //which will do the delete
965
  const uint64_t tapeSize = 5000;
966
  mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drive::FakeDrive(tapeSize);
967
  
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
  // We can prepare files for writing on the drive
  {    
    // Label the tape
    castor::tape::tapeFile::LabelSession ls(*mockSys.fake.m_pathToDrive["/dev/nst0"], "V12345");
    mockSys.fake.m_pathToDrive["/dev/nst0"]->rewind();
    
    // schedule the archivals
    for(int fseq=1; fseq <= 10 ; fseq ++) {      
      // Create a path to a remote destination file
      std::ostringstream remoteFilePath;
      remoteFilePath << "file:" << "/test" << fseq;
      remoteFilePaths.push_back(remoteFilePath.str());
      
      // Create the entry in the remote namespace (same user id of the requester)
      cta::RemotePath rpath(remoteFilePath.str());
      cta::RemoteFileStatus rstatus(requester.getUser(), 0777, 1000);
      rns.createEntry(rpath, rstatus);

      // Schedule the archival of the file
      std::list<std::string> remoteFilePathList;
      remoteFilePathList.push_back(remoteFilePath.str());
      ASSERT_NO_THROW(scheduler.queueArchiveRequest(requester, remoteFilePathList, rpath.getAfterScheme()));
990
991
    }
  }
992
  DriveConfig driveConfig("T10D6116", "T10KD6", "/dev/tape_T10D6116", "manual");
993
994
995
  DataTransferConfig castorConf;
  castorConf.bufsz = 1024*1024; // 1 MB memory buffers
  castorConf.nbBufs = 10;
996
997
  castorConf.bulkRequestRecallMaxBytes = UINT64_C(100)*1000*1000*1000;
  castorConf.bulkRequestRecallMaxFiles = 1000;
998
  castorConf.nbDiskThreads = 1;
999
1000
  castor::messages::AcsProxyDummy acs;
  castor::mediachanger::MmcProxyDummy mmc;