DriveTest.cpp 15.9 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
/******************************************************************************
 *                      DriveTest.cpp
 *
 * 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

Eric Cano's avatar
Eric Cano committed
25
26
#include <gtest/gtest.h>
#include <gmock/gmock-cardinalities.h>
27
28
29
#include "../SCSI/Device.hpp"
#include "../System/Wrapper.hpp"
#include "Drive.hpp"
30

Eric Cano's avatar
Eric Cano committed
31
32
33
using ::testing::AtLeast;
using ::testing::Return;
using ::testing::_;
Eric Cano's avatar
Eric Cano committed
34
using ::testing::An;
35

36
37
namespace UnitTests {

38
TEST(castor_tape_drives_Drive, OpensCorrectly) {
Eric Cano's avatar
Eric Cano committed
39
  /* Prepare the test harness */
40
  castor::tape::System::mockWrapper sysWrapper;
Eric Cano's avatar
Eric Cano committed
41
42
  sysWrapper.fake.setupSLC5();
  sysWrapper.delegateToFake();
43
  
Eric Cano's avatar
Eric Cano committed
44
  /* We expect the following calls: */
Victor Kotlyar's avatar
Victor Kotlyar committed
45
  EXPECT_CALL(sysWrapper, opendir(_)).Times(AtLeast(3));
Eric Cano's avatar
Eric Cano committed
46
  EXPECT_CALL(sysWrapper, readdir(_)).Times(AtLeast(30));
Victor Kotlyar's avatar
Victor Kotlyar committed
47
  EXPECT_CALL(sysWrapper, closedir(_)).Times(AtLeast(3));
Eric Cano's avatar
Eric Cano committed
48
  EXPECT_CALL(sysWrapper, realpath(_, _)).Times(3);
Eric Cano's avatar
Eric Cano committed
49
50
  EXPECT_CALL(sysWrapper, open(_, _)).Times(21);
  EXPECT_CALL(sysWrapper, read(_, _, _)).Times(38);
51
  EXPECT_CALL(sysWrapper, write(_, _, _)).Times(0);
Eric Cano's avatar
Eric Cano committed
52
  EXPECT_CALL(sysWrapper, ioctl(_,_,An<mtget*>())).Times(2);
Eric Cano's avatar
Eric Cano committed
53
  EXPECT_CALL(sysWrapper, close(_)).Times(21);
Eric Cano's avatar
Eric Cano committed
54
55
  EXPECT_CALL(sysWrapper, readlink(_, _, _)).Times(3);
  EXPECT_CALL(sysWrapper, stat(_,_)).Times(7);
56
  
Eric Cano's avatar
Eric Cano committed
57
  /* Test: detect devices, then open the device files */
58
59
  castor::tape::SCSI::DeviceVector dl(sysWrapper);
  for (std::vector<castor::tape::SCSI::DeviceInfo>::iterator i = dl.begin();
Eric Cano's avatar
Eric Cano committed
60
      i != dl.end(); i++) {
61
62
    if (castor::tape::SCSI::Types::tape == i->type) {
      castor::tape::drives::Drive drive(*i, sysWrapper);
Eric Cano's avatar
Eric Cano committed
63
64
65
    }
  }
}
66

67
TEST(castor_tape_drives_Drive, getPositionInfoAndPositionToLogicalObject) {
68
  /* Prepare the test harness */
69
  castor::tape::System::mockWrapper sysWrapper;
70
71
72
73
  sysWrapper.fake.setupSLC5();
  sysWrapper.delegateToFake();
  
  /* We expect the following calls: */
Victor Kotlyar's avatar
Victor Kotlyar committed
74
  EXPECT_CALL(sysWrapper, opendir(_)).Times(AtLeast(3));
75
  EXPECT_CALL(sysWrapper, readdir(_)).Times(AtLeast(30));
Victor Kotlyar's avatar
Victor Kotlyar committed
76
  EXPECT_CALL(sysWrapper, closedir(_)).Times(AtLeast(3));
77
  EXPECT_CALL(sysWrapper, realpath(_, _)).Times(3);
Eric Cano's avatar
Eric Cano committed
78
79
  EXPECT_CALL(sysWrapper, open(_, _)).Times(21);
  EXPECT_CALL(sysWrapper, read(_, _, _)).Times(38);
80
81
  EXPECT_CALL(sysWrapper, write(_, _, _)).Times(0);
  EXPECT_CALL(sysWrapper, ioctl(_,_,An<mtget*>())).Times(2);
Eric Cano's avatar
Eric Cano committed
82
  EXPECT_CALL(sysWrapper, close(_)).Times(21);
83
84
85
86
  EXPECT_CALL(sysWrapper, readlink(_, _, _)).Times(3);
  EXPECT_CALL(sysWrapper, stat(_,_)).Times(7);
  
  /* Test: detect devices, then open the device files */
87
88
  castor::tape::SCSI::DeviceVector dl(sysWrapper);
  for (std::vector<castor::tape::SCSI::DeviceInfo>::iterator i = dl.begin();
89
      i != dl.end(); i++) {
90
91
    if (castor::tape::SCSI::Types::tape == i->type) {
      castor::tape::drives::Drive dContainer(*i, sysWrapper);
Eric Cano's avatar
Eric Cano committed
92
93
      /* Compiler cannot implicitly use the conversion operator. Create an 
       * intermediate reference*/
94
95
      castor::tape::drives::DriveGeneric & drive = dContainer;
      castor::tape::drives::positionInfo posInfo;
96
      
97
      EXPECT_CALL(sysWrapper, ioctl(_,_,An<sg_io_hdr_t*>())).Times(1);      
98
      posInfo = drive.getPositionInfo();
99

Victor Kotlyar's avatar
Victor Kotlyar committed
100
101
102
103
      ASSERT_EQ(0xABCDEF12U,posInfo.currentPosition);
      ASSERT_EQ(0x12EFCDABU,posInfo.oldestDirtyObject);
      ASSERT_EQ(0xABCDEFU,posInfo.dirtyObjectsCount);
      ASSERT_EQ(0x12EFCDABU,posInfo.dirtyBytesCount);
104
105
106
107
108
109
110
111
112
113
114
115
116
117
      
      EXPECT_CALL(sysWrapper, ioctl(_,_,An<sg_io_hdr_t*>())).Times(1);      
      drive.positionToLogicalObject(0xABCDEF0);
      
      EXPECT_CALL(sysWrapper, ioctl(_,_,An<sg_io_hdr_t*>())).Times(1);
      posInfo = drive.getPositionInfo();
      
      ASSERT_EQ(0xABCDEF0U,posInfo.currentPosition);
      ASSERT_EQ(0xABCDEF0U,posInfo.oldestDirtyObject);
      ASSERT_EQ(0x0U,posInfo.dirtyObjectsCount);
      ASSERT_EQ(0x0U,posInfo.dirtyBytesCount);
    }
  }
} 
118
TEST(castor_tape_drives_Drive, setDensityAndCompression) {
119
  /* Prepare the test harness */
120
  castor::tape::System::mockWrapper sysWrapper;
121
122
123
124
  sysWrapper.fake.setupSLC5();
  sysWrapper.delegateToFake();
  
  /* We expect the following calls: */
Victor Kotlyar's avatar
Victor Kotlyar committed
125
  EXPECT_CALL(sysWrapper, opendir(_)).Times(AtLeast(3));
126
  EXPECT_CALL(sysWrapper, readdir(_)).Times(AtLeast(30));
Victor Kotlyar's avatar
Victor Kotlyar committed
127
  EXPECT_CALL(sysWrapper, closedir(_)).Times(AtLeast(3));
128
  EXPECT_CALL(sysWrapper, realpath(_, _)).Times(3);
Eric Cano's avatar
Eric Cano committed
129
130
  EXPECT_CALL(sysWrapper, open(_, _)).Times(21);
  EXPECT_CALL(sysWrapper, read(_, _, _)).Times(38);
131
132
  EXPECT_CALL(sysWrapper, write(_, _, _)).Times(0);
  EXPECT_CALL(sysWrapper, ioctl(_,_,An<mtget*>())).Times(2);
Eric Cano's avatar
Eric Cano committed
133
  EXPECT_CALL(sysWrapper, close(_)).Times(21);
134
135
136
137
  EXPECT_CALL(sysWrapper, readlink(_, _, _)).Times(3);
  EXPECT_CALL(sysWrapper, stat(_,_)).Times(7);
  
  /* Test: detect devices, then open the device files */
138
139
  castor::tape::SCSI::DeviceVector dl(sysWrapper);
  for (std::vector<castor::tape::SCSI::DeviceInfo>::iterator i = dl.begin();
140
      i != dl.end(); i++) {
141
142
    if (castor::tape::SCSI::Types::tape == i->type) {
      castor::tape::drives::Drive dContainer(*i, sysWrapper);
Eric Cano's avatar
Eric Cano committed
143
144
      /* Compiler cannot implicitly use the conversion operator. Create an 
       * intermediate reference*/
145
      castor::tape::drives::DriveGeneric & drive = dContainer;
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162

      EXPECT_CALL(sysWrapper, ioctl(_,_,An<sg_io_hdr_t*>())).Times(2);      
      drive.setDensityAndCompression();
      
      EXPECT_CALL(sysWrapper, ioctl(_,_,An<sg_io_hdr_t*>())).Times(2);      
      drive.setDensityAndCompression(true);
      
      EXPECT_CALL(sysWrapper, ioctl(_,_,An<sg_io_hdr_t*>())).Times(2);      
      drive.setDensityAndCompression(false);

      EXPECT_CALL(sysWrapper, ioctl(_,_,An<sg_io_hdr_t*>())).Times(2);      
      drive.setDensityAndCompression(0x42,true);
      
      EXPECT_CALL(sysWrapper, ioctl(_,_,An<sg_io_hdr_t*>())).Times(2);      
      drive.setDensityAndCompression(0x46,false);
    }
  }
163
164
}

165
TEST(castor_tape_drives_Drive, setStDriverOptions) {
166
  /* Prepare the test harness */
167
  castor::tape::System::mockWrapper sysWrapper;
168
169
170
171
  sysWrapper.fake.setupSLC5();
  sysWrapper.delegateToFake();
  
  /* We expect the following calls: */
Victor Kotlyar's avatar
Victor Kotlyar committed
172
  EXPECT_CALL(sysWrapper, opendir(_)).Times(AtLeast(3));
173
  EXPECT_CALL(sysWrapper, readdir(_)).Times(AtLeast(30));
Victor Kotlyar's avatar
Victor Kotlyar committed
174
  EXPECT_CALL(sysWrapper, closedir(_)).Times(AtLeast(3));
175
  EXPECT_CALL(sysWrapper, realpath(_, _)).Times(3);
Eric Cano's avatar
Eric Cano committed
176
177
  EXPECT_CALL(sysWrapper, open(_, _)).Times(21);
  EXPECT_CALL(sysWrapper, read(_, _, _)).Times(38);
178
179
  EXPECT_CALL(sysWrapper, write(_, _, _)).Times(0);
  EXPECT_CALL(sysWrapper, ioctl(_,_,An<mtget*>())).Times(2);
Eric Cano's avatar
Eric Cano committed
180
  EXPECT_CALL(sysWrapper, close(_)).Times(21);
181
182
183
184
  EXPECT_CALL(sysWrapper, readlink(_, _, _)).Times(3);
  EXPECT_CALL(sysWrapper, stat(_,_)).Times(7);
  
  /* Test: detect devices, then open the device files */
185
186
187
188
  castor::tape::SCSI::DeviceVector dl(sysWrapper);
  for (std::vector<castor::tape::SCSI::DeviceInfo>::iterator i = dl.begin(); i != dl.end(); i++) {
    if (castor::tape::SCSI::Types::tape == i->type) {
      castor::tape::drives::Drive dContainer(*i, sysWrapper);
Eric Cano's avatar
Eric Cano committed
189
190
      /* Compiler cannot implicitly use the conversion operator. Create an 
       * intermediate reference*/
191
      castor::tape::drives::DriveGeneric & drive = dContainer;
192
193
194
195
196
197
198
199
200
201
      
      EXPECT_CALL(sysWrapper, ioctl(_,_,An<struct mtop *>())).Times(1);
      drive.setSTBufferWrite(true);
      
      EXPECT_CALL(sysWrapper, ioctl(_,_,An<struct mtop *>())).Times(1);
      drive.setSTBufferWrite(false);
    }
  }
}

202
TEST(castor_tape_drives_Drive, getDeviceInfo) {
203
  /* Prepare the test harness */
204
  castor::tape::System::mockWrapper sysWrapper;
205
206
207
208
  sysWrapper.fake.setupSLC5();
  sysWrapper.delegateToFake();
  
  /* We expect the following calls: */
Victor Kotlyar's avatar
Victor Kotlyar committed
209
  EXPECT_CALL(sysWrapper, opendir(_)).Times(AtLeast(3));
210
  EXPECT_CALL(sysWrapper, readdir(_)).Times(AtLeast(30));
Victor Kotlyar's avatar
Victor Kotlyar committed
211
  EXPECT_CALL(sysWrapper, closedir(_)).Times(AtLeast(3));
212
  EXPECT_CALL(sysWrapper, realpath(_, _)).Times(3);
Eric Cano's avatar
Eric Cano committed
213
214
  EXPECT_CALL(sysWrapper, open(_, _)).Times(21);
  EXPECT_CALL(sysWrapper, read(_, _, _)).Times(38);
215
216
  EXPECT_CALL(sysWrapper, write(_, _, _)).Times(0);
  EXPECT_CALL(sysWrapper, ioctl(_,_,An<mtget*>())).Times(2);
Eric Cano's avatar
Eric Cano committed
217
  EXPECT_CALL(sysWrapper, close(_)).Times(21);
218
219
220
221
  EXPECT_CALL(sysWrapper, readlink(_, _, _)).Times(3);
  EXPECT_CALL(sysWrapper, stat(_,_)).Times(7);
  
  /* Test: detect devices, then open the device files */
222
223
  castor::tape::SCSI::DeviceVector dl(sysWrapper);
  for (std::vector<castor::tape::SCSI::DeviceInfo>::iterator i = dl.begin();
224
      i != dl.end(); i++) {
225
226
    if (castor::tape::SCSI::Types::tape == i->type) {
      castor::tape::drives::Drive dContainer(*i, sysWrapper);
Eric Cano's avatar
Eric Cano committed
227
228
      /* Compiler cannot implicitly use the conversion operator. Create an 
       * intermediate reference*/
229
230
      castor::tape::drives::DriveGeneric & drive = dContainer;
      castor::tape::drives::deviceInfo devInfo;
231
232
233
234
235
236
237
238
239
240
241
242
      
      EXPECT_CALL(sysWrapper, ioctl(_,_,An<sg_io_hdr_t*>())).Times(2);      
      devInfo = drive.getDeviceInfo();

      ASSERT_EQ("STK     ",devInfo.vendor);
      ASSERT_EQ("T10000B         ",devInfo.product);
      ASSERT_EQ("0104",devInfo.productRevisionLevel );
      ASSERT_EQ("XYZZY_A2  ",devInfo.serialNumber );
    }
  }
}

243
TEST(castor_tape_drives_Drive, getCompressionAndClearCompressionStats) {
244
  /* Prepare the test harness */
245
  castor::tape::System::mockWrapper sysWrapper;
246
247
248
249
  sysWrapper.fake.setupSLC5();
  sysWrapper.delegateToFake();
  
  /* We expect the following calls: */
Victor Kotlyar's avatar
Victor Kotlyar committed
250
  EXPECT_CALL(sysWrapper, opendir(_)).Times(AtLeast(3));
251
  EXPECT_CALL(sysWrapper, readdir(_)).Times(AtLeast(30));
Victor Kotlyar's avatar
Victor Kotlyar committed
252
  EXPECT_CALL(sysWrapper, closedir(_)).Times(AtLeast(3));
253
  EXPECT_CALL(sysWrapper, realpath(_, _)).Times(3);
Eric Cano's avatar
Eric Cano committed
254
255
  EXPECT_CALL(sysWrapper, open(_, _)).Times(25);
  EXPECT_CALL(sysWrapper, read(_, _, _)).Times(38);
256
257
  EXPECT_CALL(sysWrapper, write(_, _, _)).Times(0);
  EXPECT_CALL(sysWrapper, ioctl(_,_,An<mtget*>())).Times(6);
Eric Cano's avatar
Eric Cano committed
258
  EXPECT_CALL(sysWrapper, close(_)).Times(25);
259
260
261
262
  EXPECT_CALL(sysWrapper, readlink(_, _, _)).Times(3);
  EXPECT_CALL(sysWrapper, stat(_,_)).Times(7);
  
  /* Test: detect devices, then open the device files */
263
264
  castor::tape::SCSI::DeviceVector dl(sysWrapper);
  for (std::vector<castor::tape::SCSI::DeviceInfo>::iterator i = dl.begin();
265
      i != dl.end(); i++) {
266
267
268
    if (castor::tape::SCSI::Types::tape == i->type) {
      castor::tape::drives::DriveGeneric *drive;
      castor::tape::drives::compressionStats comp;
269
270
      
        {
271
          drive = new castor::tape::drives::DriveT10000(*i, sysWrapper);
272
273
274

          EXPECT_CALL(sysWrapper, ioctl(_, _, An<sg_io_hdr_t*>())).Times(1);
          comp = drive->getCompression();
275
276
277
278
          ASSERT_EQ(0xABCDEF1122334455ULL, comp.fromHost);
          ASSERT_EQ(0x2233445566778899ULL, comp.toHost);
          ASSERT_EQ(0x99AABBCCDDEEFF11ULL, comp.fromTape);
          ASSERT_EQ(0x1122334455667788ULL, comp.toTape);
279
280
281
282
283
284
285
286
287
288
289
290
291
292

          EXPECT_CALL(sysWrapper, ioctl(_, _, An<sg_io_hdr_t*>())).Times(1);
          drive->clearCompressionStats();

          EXPECT_CALL(sysWrapper, ioctl(_, _, An<sg_io_hdr_t*>())).Times(1);
          comp = drive->getCompression();
          ASSERT_EQ(0U, comp.fromHost);
          ASSERT_EQ(0U, comp.toHost);
          ASSERT_EQ(0U, comp.fromTape);
          ASSERT_EQ(0U, comp.toTape);

          delete drive;
        }
        {
293
          drive = new castor::tape::drives::DriveIBM3592(*i, sysWrapper);
294
295
296

          EXPECT_CALL(sysWrapper, ioctl(_, _, An<sg_io_hdr_t*>())).Times(1);
          comp = drive->getCompression();
297
298
299
300
          ASSERT_EQ(0x4488CD1000ULL, comp.fromHost);
          ASSERT_EQ(0x15599DE2000ULL, comp.toHost);
          ASSERT_EQ(0x377BBFC4400ULL, comp.fromTape);
          ASSERT_EQ(0x266AAEF3000ULL, comp.toTape);
301
302
303
304
305
306
307
308
309
310
311
312
313
314

          EXPECT_CALL(sysWrapper, ioctl(_, _, An<sg_io_hdr_t*>())).Times(1);
          drive->clearCompressionStats();

          EXPECT_CALL(sysWrapper, ioctl(_, _, An<sg_io_hdr_t*>())).Times(1);
          comp = drive->getCompression();
          ASSERT_EQ(0U, comp.fromHost);
          ASSERT_EQ(0U, comp.toHost);
          ASSERT_EQ(0U, comp.fromTape);
          ASSERT_EQ(0U, comp.toTape);

          delete drive;
        }
        {
315
          drive = new castor::tape::drives::DriveLTO(*i, sysWrapper);
316
317
318

          EXPECT_CALL(sysWrapper, ioctl(_, _, An<sg_io_hdr_t*>())).Times(1);
          comp = drive->getCompression();
319
320
321
322
          ASSERT_EQ(0x209DB2BE187D9ULL, comp.fromHost);
          ASSERT_EQ(0x105707026D088ULL, comp.toHost);
          ASSERT_EQ(0x928C54DFC8A11ULL, comp.fromTape);
          ASSERT_EQ(0xA2D3009B64262ULL, comp.toTape);
323
324
325
326
327
328
329
330
331
332
333
334
335

          EXPECT_CALL(sysWrapper, ioctl(_, _, An<sg_io_hdr_t*>())).Times(1);
          drive->clearCompressionStats();

          EXPECT_CALL(sysWrapper, ioctl(_, _, An<sg_io_hdr_t*>())).Times(1);
          comp = drive->getCompression();
          ASSERT_EQ(0U, comp.fromHost);
          ASSERT_EQ(0U, comp.toHost);
          ASSERT_EQ(0U, comp.fromTape);
          ASSERT_EQ(0U, comp.toTape);

          delete drive;
        }
336
337
    }
  }
Eric Cano's avatar
Eric Cano committed
338
339
}

340
TEST(castor_tape_drives_Drive, getTapeAlerts) {
Eric Cano's avatar
Eric Cano committed
341
342
343
344
345
346

  /**
   * "Local function" allowing the test to be run twice (for SLC5 and then for 
   * SLC6).
   */
  struct {
347
    void operator() (castor::tape::System::mockWrapper & sysWrapper) {
Eric Cano's avatar
Eric Cano committed
348
      /* We expect the following calls: */
Victor Kotlyar's avatar
Victor Kotlyar committed
349
      EXPECT_CALL(sysWrapper, opendir(_)).Times(AtLeast(3));
Eric Cano's avatar
Eric Cano committed
350
      EXPECT_CALL(sysWrapper, readdir(_)).Times(AtLeast(30));
Victor Kotlyar's avatar
Victor Kotlyar committed
351
352
      EXPECT_CALL(sysWrapper, closedir(_)).Times(AtLeast(3));
      EXPECT_CALL(sysWrapper, realpath(_, _)).Times(AtLeast(3));
Eric Cano's avatar
Eric Cano committed
353
354
      EXPECT_CALL(sysWrapper, open(_, _)).Times(AtLeast(21));
      EXPECT_CALL(sysWrapper, read(_, _, _)).Times(AtLeast(38));
Eric Cano's avatar
Eric Cano committed
355
356
      EXPECT_CALL(sysWrapper, write(_, _, _)).Times(0);
      EXPECT_CALL(sysWrapper, ioctl(_, _, An<mtget*>())).Times(2);
Eric Cano's avatar
Eric Cano committed
357
      EXPECT_CALL(sysWrapper, close(_)).Times(AtLeast(21));
Victor Kotlyar's avatar
Victor Kotlyar committed
358
359
      EXPECT_CALL(sysWrapper, readlink(_, _, _)).Times(AtLeast(3));
      EXPECT_CALL(sysWrapper, stat(_, _)).Times(AtLeast(7));
Eric Cano's avatar
Eric Cano committed
360
361

      /* Test: detect devices, then open the device files */
362
363
      castor::tape::SCSI::DeviceVector dl(sysWrapper);
      for (std::vector<castor::tape::SCSI::DeviceInfo>::iterator i = dl.begin();
Eric Cano's avatar
Eric Cano committed
364
          i != dl.end(); i++) {
365
366
        if (castor::tape::SCSI::Types::tape == i->type) {
          castor::tape::drives::Drive dContainer(*i, sysWrapper);
Eric Cano's avatar
Eric Cano committed
367
368
          /* Compiler cannot implicitly use the conversion operator. Create an 
           * intermediate reference*/
369
          castor::tape::drives::DriveGeneric & drive = dContainer;
Eric Cano's avatar
Eric Cano committed
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
          EXPECT_CALL(sysWrapper, ioctl(_, _, An<sg_io_hdr_t*>())).Times(1);
          std::vector<std::string> alerts = drive.getTapeAlerts();
          ASSERT_EQ(3U, alerts.size());
          ASSERT_FALSE(alerts.end() == 
              find(alerts.begin(), alerts.end(), 
              std::string("Unexpected tapeAlert code: 0x41")));
          ASSERT_FALSE(alerts.end() == find(alerts.begin(), alerts.end(), 
              std::string("Obsolete tapeAlert code: 0x28")));
          ASSERT_FALSE(alerts.end() == find(alerts.begin(), alerts.end(), 
              std::string("Forced eject")));
        }
      }
    }
  } test_functor;


  /* Prepare the test harness */
387
388
  castor::tape::System::mockWrapper sysWrapperSLC5;
  castor::tape::System::mockWrapper sysWrapperSLC6;
Victor Kotlyar's avatar
Victor Kotlyar committed
389
390
391
392
393
394
  sysWrapperSLC5.fake.setupSLC5();
  sysWrapperSLC6.fake.setupSLC6();
  sysWrapperSLC5.delegateToFake();
  sysWrapperSLC6.delegateToFake();
  test_functor(sysWrapperSLC5);
  test_functor(sysWrapperSLC6);
Eric Cano's avatar
Eric Cano committed
395
}
396

397
}