Commit 9f85a1eb authored by Daniele Kruse's avatar Daniele Kruse
Browse files

Introduced the scheduler to the DataTransferSession, replacing the concept of...

Introduced the scheduler to the DataTransferSession, replacing the concept of DGN with logical library
parent c7dc4c0b
...@@ -34,5 +34,5 @@ castor::legacymsg::TapeLabelRqstMsgBody::TapeLabelRqstMsgBody() throw(): ...@@ -34,5 +34,5 @@ castor::legacymsg::TapeLabelRqstMsgBody::TapeLabelRqstMsgBody() throw():
gid(0) { gid(0) {
memset(vid, '\0', sizeof(vid)); memset(vid, '\0', sizeof(vid));
memset(drive, '\0', sizeof(drive)); memset(drive, '\0', sizeof(drive));
memset(dgn, '\0', sizeof(dgn)); memset(logicalLibrary, '\0', sizeof(logicalLibrary));
} }
...@@ -38,7 +38,7 @@ struct TapeLabelRqstMsgBody { ...@@ -38,7 +38,7 @@ struct TapeLabelRqstMsgBody {
uint32_t gid; uint32_t gid;
char vid[CA_MAXVIDLEN + 1]; char vid[CA_MAXVIDLEN + 1];
char drive[CA_MAXUNMLEN + 1]; char drive[CA_MAXUNMLEN + 1];
char dgn[CA_MAXDGNLEN + 1]; char logicalLibrary[CA_MAXDGNLEN + 1];
/** /**
* Constructor. * Constructor.
......
...@@ -150,7 +150,7 @@ TEST_F(castor_legacymsg_TapeMarshalTest, marshalTapeLabelRqstMsgBody) { ...@@ -150,7 +150,7 @@ TEST_F(castor_legacymsg_TapeMarshalTest, marshalTapeLabelRqstMsgBody) {
srcMsgBody.gid = 4; srcMsgBody.gid = 4;
castor::utils::copyString(srcMsgBody.vid, "VIDVID"); castor::utils::copyString(srcMsgBody.vid, "VIDVID");
castor::utils::copyString(srcMsgBody.drive, "DRIVE001"); castor::utils::copyString(srcMsgBody.drive, "DRIVE001");
castor::utils::copyString(srcMsgBody.dgn, "DGNDGN"); castor::utils::copyString(srcMsgBody.logicalLibrary, "DGNDGN");
size_t bufLen = sizeof(buf); size_t bufLen = sizeof(buf);
size_t totalLen = 0; // Total length of message (header + body) size_t totalLen = 0; // Total length of message (header + body)
...@@ -188,7 +188,7 @@ TEST_F(castor_legacymsg_TapeMarshalTest, marshalTapeLabelRqstMsgBody) { ...@@ -188,7 +188,7 @@ TEST_F(castor_legacymsg_TapeMarshalTest, marshalTapeLabelRqstMsgBody) {
ASSERT_EQ((uint32_t)4, dstMsgBody.gid); ASSERT_EQ((uint32_t)4, dstMsgBody.gid);
ASSERT_EQ(std::string("VIDVID"), dstMsgBody.vid); ASSERT_EQ(std::string("VIDVID"), dstMsgBody.vid);
ASSERT_EQ(std::string("DRIVE001"), dstMsgBody.drive); ASSERT_EQ(std::string("DRIVE001"), dstMsgBody.drive);
ASSERT_EQ(std::string("DGNDGN"), dstMsgBody.dgn); ASSERT_EQ(std::string("DGNDGN"), dstMsgBody.logicalLibrary);
} }
} }
...@@ -204,7 +204,7 @@ TEST_F(castor_legacymsg_TapeMarshalTest, marshalTapeStatReplyMsgBody) { ...@@ -204,7 +204,7 @@ TEST_F(castor_legacymsg_TapeMarshalTest, marshalTapeStatReplyMsgBody) {
srcMsgBody.drives[0].asn = 1; srcMsgBody.drives[0].asn = 1;
srcMsgBody.drives[0].asn_time = 2; srcMsgBody.drives[0].asn_time = 2;
srcMsgBody.drives[0].cfseq = 3; srcMsgBody.drives[0].cfseq = 3;
castor::utils::copyString(srcMsgBody.drives[0].dgn, "DGN000"); castor::utils::copyString(srcMsgBody.drives[0].logicalLibrary, "DGN000");
castor::utils::copyString(srcMsgBody.drives[0].drive, "DRIVE000"); castor::utils::copyString(srcMsgBody.drives[0].drive, "DRIVE000");
srcMsgBody.drives[0].jid = 4; srcMsgBody.drives[0].jid = 4;
castor::utils::copyString(srcMsgBody.drives[0].lblcode, "L00"); castor::utils::copyString(srcMsgBody.drives[0].lblcode, "L00");
...@@ -218,7 +218,7 @@ TEST_F(castor_legacymsg_TapeMarshalTest, marshalTapeStatReplyMsgBody) { ...@@ -218,7 +218,7 @@ TEST_F(castor_legacymsg_TapeMarshalTest, marshalTapeStatReplyMsgBody) {
srcMsgBody.drives[1].asn = 11; srcMsgBody.drives[1].asn = 11;
srcMsgBody.drives[1].asn_time = 12; srcMsgBody.drives[1].asn_time = 12;
srcMsgBody.drives[1].cfseq = 13; srcMsgBody.drives[1].cfseq = 13;
castor::utils::copyString(srcMsgBody.drives[1].dgn, "DGN001"); castor::utils::copyString(srcMsgBody.drives[1].logicalLibrary, "DGN001");
castor::utils::copyString(srcMsgBody.drives[1].drive, "DRIVE001"); castor::utils::copyString(srcMsgBody.drives[1].drive, "DRIVE001");
srcMsgBody.drives[1].jid = 14; srcMsgBody.drives[1].jid = 14;
castor::utils::copyString(srcMsgBody.drives[1].lblcode, "L01"); castor::utils::copyString(srcMsgBody.drives[1].lblcode, "L01");
...@@ -265,7 +265,7 @@ TEST_F(castor_legacymsg_TapeMarshalTest, marshalTapeStatReplyMsgBody) { ...@@ -265,7 +265,7 @@ TEST_F(castor_legacymsg_TapeMarshalTest, marshalTapeStatReplyMsgBody) {
ASSERT_EQ((uint16_t)1, dstMsgBody.drives[0].asn); ASSERT_EQ((uint16_t)1, dstMsgBody.drives[0].asn);
ASSERT_EQ((uint32_t)2, dstMsgBody.drives[0].asn_time); ASSERT_EQ((uint32_t)2, dstMsgBody.drives[0].asn_time);
ASSERT_EQ((uint32_t)3, dstMsgBody.drives[0].cfseq); ASSERT_EQ((uint32_t)3, dstMsgBody.drives[0].cfseq);
ASSERT_EQ(std::string("DGN000"), dstMsgBody.drives[0].dgn); ASSERT_EQ(std::string("DGN000"), dstMsgBody.drives[0].logicalLibrary);
ASSERT_EQ(std::string("DRIVE000"), dstMsgBody.drives[0].drive); ASSERT_EQ(std::string("DRIVE000"), dstMsgBody.drives[0].drive);
ASSERT_EQ((uint32_t)4, dstMsgBody.drives[0].jid); ASSERT_EQ((uint32_t)4, dstMsgBody.drives[0].jid);
ASSERT_EQ(std::string("L00"), dstMsgBody.drives[0].lblcode); ASSERT_EQ(std::string("L00"), dstMsgBody.drives[0].lblcode);
...@@ -279,7 +279,7 @@ TEST_F(castor_legacymsg_TapeMarshalTest, marshalTapeStatReplyMsgBody) { ...@@ -279,7 +279,7 @@ TEST_F(castor_legacymsg_TapeMarshalTest, marshalTapeStatReplyMsgBody) {
ASSERT_EQ((uint16_t)11, dstMsgBody.drives[1].asn); ASSERT_EQ((uint16_t)11, dstMsgBody.drives[1].asn);
ASSERT_EQ((uint32_t)12, dstMsgBody.drives[1].asn_time); ASSERT_EQ((uint32_t)12, dstMsgBody.drives[1].asn_time);
ASSERT_EQ((uint32_t)13, dstMsgBody.drives[1].cfseq); ASSERT_EQ((uint32_t)13, dstMsgBody.drives[1].cfseq);
ASSERT_EQ(std::string("DGN001"), dstMsgBody.drives[1].dgn); ASSERT_EQ(std::string("DGN001"), dstMsgBody.drives[1].logicalLibrary);
ASSERT_EQ(std::string("DRIVE001"), dstMsgBody.drives[1].drive); ASSERT_EQ(std::string("DRIVE001"), dstMsgBody.drives[1].drive);
ASSERT_EQ((uint32_t)14, dstMsgBody.drives[1].jid); ASSERT_EQ((uint32_t)14, dstMsgBody.drives[1].jid);
ASSERT_EQ(std::string("L01"), dstMsgBody.drives[1].lblcode); ASSERT_EQ(std::string("L01"), dstMsgBody.drives[1].lblcode);
......
...@@ -35,7 +35,7 @@ namespace legacymsg { ...@@ -35,7 +35,7 @@ namespace legacymsg {
struct TapeStatDriveEntry { struct TapeStatDriveEntry {
uint32_t uid; uint32_t uid;
uint32_t jid; // process group id or session id uint32_t jid; // process group id or session id
char dgn[CA_MAXDGNLEN+1]; // device group name char logicalLibrary[CA_MAXDGNLEN+1]; // logical Library name
uint16_t up; // drive status: down = 0, up = 1 uint16_t up; // drive status: down = 0, up = 1
uint16_t asn; // assign flag: assigned = 1 uint16_t asn; // assign flag: assigned = 1
uint32_t asn_time; // timestamp of drive assignment uint32_t asn_time; // timestamp of drive assignment
......
...@@ -23,7 +23,7 @@ package castor.messages; ...@@ -23,7 +23,7 @@ package castor.messages;
message ForkCleaner { message ForkCleaner {
// Description of the tape drive // Description of the tape drive
required string unitname = 1; required string unitname = 1;
required string dgn = 2; required string logicallibrary = 2;
required string devfilename = 3; required string devfilename = 3;
required string libraryslot = 4; required string libraryslot = 4;
......
...@@ -23,7 +23,7 @@ package castor.messages; ...@@ -23,7 +23,7 @@ package castor.messages;
message ForkDataTransfer { message ForkDataTransfer {
// Description of the tape drive // Description of the tape drive
required string unitname = 1; required string unitname = 1;
required string dgn = 2; required string logicallibrary = 2;
required string devfilename = 3; required string devfilename = 3;
required string libraryslot = 4; required string libraryslot = 4;
} }
...@@ -23,7 +23,7 @@ package castor.messages; ...@@ -23,7 +23,7 @@ package castor.messages;
message ForkLabel { message ForkLabel {
// Description of the tape drive // Description of the tape drive
required string unitname = 1; required string unitname = 1;
required string dgn = 2; required string logicallibrary = 2;
required string devfilename = 3; required string devfilename = 3;
required string libraryslot = 4; required string libraryslot = 4;
......
...@@ -203,7 +203,7 @@ void castor::tape::tapeserver::daemon::AdminConnectionHandler:: ...@@ -203,7 +203,7 @@ void castor::tape::tapeserver::daemon::AdminConnectionHandler::
log::Param params[] = { log::Param params[] = {
log::Param("unitName", unitName), log::Param("unitName", unitName),
log::Param("dgn", driveConfig.getDgn())}; log::Param("logicalLibrary", driveConfig.getLogicalLibrary())};
switch(body.status) { switch(body.status) {
case CONF_UP: case CONF_UP:
......
...@@ -23,6 +23,8 @@ include_directories(/usr/include/shift) ...@@ -23,6 +23,8 @@ include_directories(/usr/include/shift)
include_directories(${CMAKE_SOURCE_DIR}/tapeserver) include_directories(${CMAKE_SOURCE_DIR}/tapeserver)
include_directories(${CMAKE_SOURCE_DIR}/tapeserver/h) include_directories(${CMAKE_SOURCE_DIR}/tapeserver/h)
include_directories(${PROJECT_BINARY_DIR}/tapeserver) include_directories(${PROJECT_BINARY_DIR}/tapeserver)
include_directories(${CMAKE_SOURCE_DIR})
include_directories(${PROJECT_BINARY_DIR})
find_package( ZLIB REQUIRED ) find_package( ZLIB REQUIRED )
...@@ -74,7 +76,7 @@ add_library(castorTapeServerDaemon ...@@ -74,7 +76,7 @@ add_library(castorTapeServerDaemon
TpconfigLine.cpp TpconfigLine.cpp
TpconfigLines.cpp) TpconfigLines.cpp)
target_link_libraries(castorTapeServerDaemon castormessages castortapereactor) target_link_libraries(castorTapeServerDaemon castormessages castortapereactor ctascheduler ctacommon ctanameserver ctaremotens ctaOStoreSchedulerDB protobuf CTAObjectStore)
add_dependencies(castorTapeServerDaemon castormessagesprotobuf) add_dependencies(castorTapeServerDaemon castormessagesprotobuf)
add_library(castorTapeServerDaemonTestDummies add_library(castorTapeServerDaemonTestDummies
......
...@@ -475,11 +475,11 @@ void castor::tape::tapeserver::daemon::CatalogueDrive::receivedLabelJob( ...@@ -475,11 +475,11 @@ void castor::tape::tapeserver::daemon::CatalogueDrive::receivedLabelJob(
switch(m_state) { switch(m_state) {
case DRIVE_STATE_UP: case DRIVE_STATE_UP:
if(std::string(job.dgn) != m_config.getDgn()) { if(std::string(job.logicalLibrary) != m_config.getLogicalLibrary()) {
castor::exception::Exception ex; castor::exception::Exception ex;
ex.getMessage() << "Failed to " << task.str() << ex.getMessage() << "Failed to " << task.str() <<
": DGN mismatch: catalogueDgn=" << m_config.getDgn() << " labelJobDgn=" ": logicalLibrary mismatch: catalogueLogicalLibrary=" << m_config.getLogicalLibrary() << " labelJobDgn="
<< job.dgn; << job.logicalLibrary;
throw ex; throw ex;
} }
m_session = CatalogueLabelSession::create( m_session = CatalogueLabelSession::create(
...@@ -745,7 +745,7 @@ castor::legacymsg::TapeStatDriveEntry ...@@ -745,7 +745,7 @@ castor::legacymsg::TapeStatDriveEntry
try { try {
entry.uid = getUidForTapeStatDriveEntry(); entry.uid = getUidForTapeStatDriveEntry();
entry.jid = getJidForTapeStatDriveEntry(); entry.jid = getJidForTapeStatDriveEntry();
castor::utils::copyString(entry.dgn, m_config.getDgn()); castor::utils::copyString(entry.logicalLibrary, m_config.getLogicalLibrary());
entry.up = getUpForTapeStatDriveEntry(); entry.up = getUpForTapeStatDriveEntry();
entry.asn = getAsnForTapeStatDriveEntry(); entry.asn = getAsnForTapeStatDriveEntry();
entry.asn_time = getAsnTimeForTapeStatDriveEntry(); entry.asn_time = getAsnTimeForTapeStatDriveEntry();
......
...@@ -79,7 +79,7 @@ TEST_F(castor_tape_tapeserver_daemon_CatalogueTest, goodDayPopulate) { ...@@ -79,7 +79,7 @@ TEST_F(castor_tape_tapeserver_daemon_CatalogueTest, goodDayPopulate) {
const CatalogueDrive &unit1 = catalogue.findDrive("UNIT1"); const CatalogueDrive &unit1 = catalogue.findDrive("UNIT1");
const DriveConfig &unit1Config = unit1.getConfig(); const DriveConfig &unit1Config = unit1.getConfig();
ASSERT_EQ(std::string("DGN1"), unit1Config.getDgn()); ASSERT_EQ(std::string("DGN1"), unit1Config.getLogicalLibrary());
ASSERT_EQ(std::string("DEV1"), unit1Config.getDevFilename()); ASSERT_EQ(std::string("DEV1"), unit1Config.getDevFilename());
ASSERT_EQ(DRIVE_STATE_DOWN, unit1.getState()); ASSERT_EQ(DRIVE_STATE_DOWN, unit1.getState());
...@@ -95,7 +95,7 @@ TEST_F(castor_tape_tapeserver_daemon_CatalogueTest, goodDayPopulate) { ...@@ -95,7 +95,7 @@ TEST_F(castor_tape_tapeserver_daemon_CatalogueTest, goodDayPopulate) {
const CatalogueDrive &unit2 = catalogue.findDrive("UNIT2"); const CatalogueDrive &unit2 = catalogue.findDrive("UNIT2");
const DriveConfig &unit2Config = unit2.getConfig(); const DriveConfig &unit2Config = unit2.getConfig();
ASSERT_EQ(std::string("DGN2"), unit2Config.getDgn()); ASSERT_EQ(std::string("DGN2"), unit2Config.getLogicalLibrary());
ASSERT_EQ(std::string("DEV2"), unit2Config.getDevFilename()); ASSERT_EQ(std::string("DEV2"), unit2Config.getDevFilename());
ASSERT_EQ(DRIVE_STATE_DOWN, unit2.getState()); ASSERT_EQ(DRIVE_STATE_DOWN, unit2.getState());
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "castor/tape/tapeserver/drive/DriveInterface.hpp" #include "castor/tape/tapeserver/drive/DriveInterface.hpp"
#include "castor/tape/tapeserver/SCSI/Device.hpp" #include "castor/tape/tapeserver/SCSI/Device.hpp"
#include "log.h" #include "log.h"
#include "scheduler/TapeMount.hpp"
#include "serrno.h" #include "serrno.h"
#include "stager_client_commandline.h" #include "stager_client_commandline.h"
...@@ -55,14 +56,17 @@ castor::tape::tapeserver::daemon::DataTransferSession::DataTransferSession( ...@@ -55,14 +56,17 @@ castor::tape::tapeserver::daemon::DataTransferSession::DataTransferSession(
castor::mediachanger::MediaChangerFacade & mc, castor::mediachanger::MediaChangerFacade & mc,
castor::messages::TapeserverProxy & initialProcess, castor::messages::TapeserverProxy & initialProcess,
castor::server::ProcessCap & capUtils, castor::server::ProcessCap & capUtils,
const DataTransferConfig & castorConf): const DataTransferConfig & castorConf,
cta::Scheduler & scheduler):
m_log(log), m_log(log),
m_sysWrapper(sysWrapper), m_sysWrapper(sysWrapper),
m_driveConfig(driveConfig), m_driveConfig(driveConfig),
m_castorConf(castorConf), m_castorConf(castorConf),
m_mc(mc), m_mc(mc),
m_intialProcess(initialProcess), m_intialProcess(initialProcess),
m_capUtils(capUtils) { m_capUtils(capUtils),
m_scheduler(scheduler)
{
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -85,6 +89,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction ...@@ -85,6 +89,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
// 2a) Get initial information from the client // 2a) Get initial information from the client
client::ClientProxy::RequestReport reqReport; client::ClientProxy::RequestReport reqReport;
try { try {
std::unique_ptr<cta::TapeMount> tapeMount(m_scheduler.getNextMount("LLname", "DriveName")); //TODO: put right values of logical library and drive name
m_clientProxy.fetchVolumeId(m_volInfo, reqReport); m_clientProxy.fetchVolumeId(m_volInfo, reqReport);
} catch(client::ClientProxy::EndOfSessionWithError & eoswe) { } catch(client::ClientProxy::EndOfSessionWithError & eoswe) {
std::stringstream fullError; std::stringstream fullError;
...@@ -160,7 +165,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction ...@@ -160,7 +165,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
executeDump(lc); executeDump(lc);
return MARK_DRIVE_AS_UP; return MARK_DRIVE_AS_UP;
default: default:
return MARK_DRIVE_AS_UP; return MARK_DRIVE_AS_UP;
} }
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "castor/tape/tapeserver/daemon/Session.hpp" #include "castor/tape/tapeserver/daemon/Session.hpp"
#include "castor/tape/tapeserver/daemon/TapeSingleThreadInterface.hpp" #include "castor/tape/tapeserver/daemon/TapeSingleThreadInterface.hpp"
#include "castor/tape/tapeserver/system/Wrapper.hpp" #include "castor/tape/tapeserver/system/Wrapper.hpp"
#include "scheduler/Scheduler.hpp"
namespace castor { namespace castor {
namespace legacymsg { namespace legacymsg {
...@@ -63,7 +64,8 @@ namespace daemon { ...@@ -63,7 +64,8 @@ namespace daemon {
castor::mediachanger::MediaChangerFacade & mc, castor::mediachanger::MediaChangerFacade & mc,
castor::messages::TapeserverProxy & initialProcess, castor::messages::TapeserverProxy & initialProcess,
castor::server::ProcessCap &capUtils, castor::server::ProcessCap &capUtils,
const DataTransferConfig & castorConf); const DataTransferConfig & castorConf,
cta::Scheduler &scheduler);
/** /**
* Execute the session and return the type of action to be performed * Execute the session and return the type of action to be performed
...@@ -96,7 +98,7 @@ namespace daemon { ...@@ -96,7 +98,7 @@ namespace daemon {
~DataTransferSession() throw(); ~DataTransferSession() throw();
private: private:
/** /**
* Object representing the API of the CASTOR logging system. * Object representing the API of the CASTOR logging system.
*/ */
...@@ -131,6 +133,10 @@ namespace daemon { ...@@ -131,6 +133,10 @@ namespace daemon {
castor::server::ProcessCap &m_capUtils; castor::server::ProcessCap &m_capUtils;
/** hostname, used to report status of the drive */ /** hostname, used to report status of the drive */
const std::string m_hostname; const std::string m_hostname;
/**
* The scheduler, i.e. the local interface to the Objectstore DB
*/
cta::Scheduler &m_scheduler;
/** /**
* Returns the string representation of the specified tapebridge client type * Returns the string representation of the specified tapebridge client type
......
...@@ -48,7 +48,11 @@ ...@@ -48,7 +48,11 @@
#include "castor/tape/tapeserver/file/File.hpp" #include "castor/tape/tapeserver/file/File.hpp"
#include "castor/tape/tapeserver/drive/FakeDrive.hpp" #include "castor/tape/tapeserver/drive/FakeDrive.hpp"
#include "Ctape.h" #include "Ctape.h"
#include "scheduler/Scheduler.hpp"
#include "smc_struct.h" #include "smc_struct.h"
#include "nameserver/mockNS/MockNameServer.hpp"
#include "remotens/MockRemoteNS.hpp"
#include "scheduler/mockDB/MockSchedulerDatabase.hpp"
#include <fcntl.h> #include <fcntl.h>
#include <sys/mman.h> #include <sys/mman.h>
...@@ -154,8 +158,12 @@ TEST(tapeServer, DataTransferSessionGooddayRecall) { ...@@ -154,8 +158,12 @@ TEST(tapeServer, DataTransferSessionGooddayRecall) {
castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc); castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
castor::server::ProcessCap capUtils; castor::server::ProcessCap capUtils;
castor::messages::TapeserverProxyDummy initialProcess; castor::messages::TapeserverProxyDummy initialProcess;
cta::MockNameServer ns;
cta::MockRemoteNS rns;
cta::MockSchedulerDatabase db;
cta::Scheduler scheduler(ns, db, rns);
DataTransferSession sess("tapeHost", logger, mockSys, DataTransferSession sess("tapeHost", logger, mockSys,
driveConfig, mc, initialProcess, capUtils, castorConf); driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
sess.execute(); sess.execute();
simRun.wait(); simRun.wait();
std::string temp = logger.getLog(); std::string temp = logger.getLog();
...@@ -246,8 +254,12 @@ TEST(tapeServer, DataTransferSessionWrongRecall) { ...@@ -246,8 +254,12 @@ TEST(tapeServer, DataTransferSessionWrongRecall) {
castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc); castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
castor::server::ProcessCap capUtils; castor::server::ProcessCap capUtils;
castor::messages::TapeserverProxyDummy initialProcess; castor::messages::TapeserverProxyDummy initialProcess;
cta::MockNameServer ns;
cta::MockRemoteNS rns;
cta::MockSchedulerDatabase db;
cta::Scheduler scheduler(ns, db, rns);
DataTransferSession sess("tapeHost", logger, mockSys, DataTransferSession sess("tapeHost", logger, mockSys,
driveConfig, mc, initialProcess, capUtils, castorConf); driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
sess.execute(); sess.execute();
simRun.wait(); simRun.wait();
std::string temp = logger.getLog(); std::string temp = logger.getLog();
...@@ -288,8 +300,12 @@ TEST(tapeServer, DataTransferSessionNoSuchDrive) { ...@@ -288,8 +300,12 @@ TEST(tapeServer, DataTransferSessionNoSuchDrive) {
castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc); castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
castor::messages::TapeserverProxyDummy initialProcess; castor::messages::TapeserverProxyDummy initialProcess;
castor::server::ProcessCapDummy capUtils; castor::server::ProcessCapDummy capUtils;
cta::MockNameServer ns;
cta::MockRemoteNS rns;
cta::MockSchedulerDatabase db;
cta::Scheduler scheduler(ns, db, rns);
DataTransferSession sess("tapeHost", logger, mockSys, DataTransferSession sess("tapeHost", logger, mockSys,
driveConfig, mc, initialProcess, capUtils, castorConf); driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
sess.execute(); sess.execute();
simRun.wait(); simRun.wait();
std::string temp = logger.getLog(); std::string temp = logger.getLog();
...@@ -364,8 +380,12 @@ TEST(tapeServer, DataTransferSessionFailtoMount) { ...@@ -364,8 +380,12 @@ TEST(tapeServer, DataTransferSessionFailtoMount) {
castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc); castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
castor::server::ProcessCap capUtils; castor::server::ProcessCap capUtils;
castor::messages::TapeserverProxyDummy initialProcess; castor::messages::TapeserverProxyDummy initialProcess;
cta::MockNameServer ns;
cta::MockRemoteNS rns;
cta::MockSchedulerDatabase db;
cta::Scheduler scheduler(ns, db, rns);
DataTransferSession sess("tapeHost", logger, mockSys, DataTransferSession sess("tapeHost", logger, mockSys,
driveConfig, mc, initialProcess, capUtils, castorConf); driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
sess.execute(); sess.execute();
simRun.wait(); simRun.wait();
std::string temp = logger.getLog(); std::string temp = logger.getLog();
...@@ -415,8 +435,12 @@ TEST(tapeServer, DataTransferSessionEmptyOnVolReq) { ...@@ -415,8 +435,12 @@ TEST(tapeServer, DataTransferSessionEmptyOnVolReq) {
castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc); castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
castor::server::ProcessCap capUtils; castor::server::ProcessCap capUtils;
castor::messages::TapeserverProxyDummy initialProcess; castor::messages::TapeserverProxyDummy initialProcess;
cta::MockNameServer ns;
cta::MockRemoteNS rns;
cta::MockSchedulerDatabase db;
cta::Scheduler scheduler(ns, db, rns);
DataTransferSession sess("tapeHost", logger, mockSys, DataTransferSession sess("tapeHost", logger, mockSys,
driveConfig, mc, initialProcess, capUtils, castorConf); driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
sess.execute(); sess.execute();
simRun.wait(); simRun.wait();
std::string temp = logger.getLog(); std::string temp = logger.getLog();
...@@ -550,8 +574,12 @@ TEST(tapeServer, DataTransferSessionGooddayMigration) { ...@@ -550,8 +574,12 @@ TEST(tapeServer, DataTransferSessionGooddayMigration) {
castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc); castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
castor::messages::TapeserverProxyDummy initialProcess; castor::messages::TapeserverProxyDummy initialProcess;
castor::server::ProcessCapDummy capUtils; castor::server::ProcessCapDummy capUtils;
cta::MockNameServer ns;
cta::MockRemoteNS rns;
cta::MockSchedulerDatabase db;
cta::Scheduler scheduler(ns, db, rns);
DataTransferSession sess("tapeHost", logger, mockSys, DataTransferSession sess("tapeHost", logger, mockSys,
driveConfig, mc, initialProcess, capUtils, castorConf); driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
sess.execute(); sess.execute();
simRun.wait(); simRun.wait();
for (std::vector<struct expectedResult>::iterator i = expected.begin(); for (std::vector<struct expectedResult>::iterator i = expected.begin();
...@@ -625,8 +653,12 @@ TEST(tapeServer, DataTransferSessionMissingFilesMigration) { ...@@ -625,8 +653,12 @@ TEST(tapeServer, DataTransferSessionMissingFilesMigration) {
castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc); castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
castor::messages::TapeserverProxyDummy initialProcess; castor::messages::TapeserverProxyDummy initialProcess;
castor::server::ProcessCapDummy capUtils; castor::server::ProcessCapDummy capUtils;
cta::MockNameServer ns;
cta::MockRemoteNS rns;
cta::MockSchedulerDatabase db;
cta::Scheduler scheduler(ns, db, rns);
DataTransferSession sess("tapeHost", logger, mockSys, DataTransferSession sess("tapeHost", logger, mockSys,
driveConfig, mc, initialProcess, capUtils, castorConf); driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
sess.execute(); sess.execute();
simRun.wait(); simRun.wait();
ASSERT_EQ(SEINTERNAL, sim.m_sessionErrorCode); ASSERT_EQ(SEINTERNAL, sim.m_sessionErrorCode);
...@@ -712,8 +744,12 @@ TEST(tapeServer, DataTransferSessionTapeFullMigration) { ...@@ -712,8 +744,12 @@ TEST(tapeServer, DataTransferSessionTapeFullMigration) {
castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc); castor::mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
castor::messages::TapeserverProxyDummy initialProcess; castor::messages::TapeserverProxyDummy initialProcess;
castor::server::ProcessCapDummy capUtils; castor::server::ProcessCapDummy capUtils;
cta::MockNameServer ns;
cta::MockRemoteNS rns;
cta::MockSchedulerDatabase db;
cta::Scheduler scheduler(ns, db, rns);
DataTransferSession sess("tapeHost", logger, mockSys, DataTransferSession sess("tapeHost", logger, mockSys,
driveConfig, mc, initialProcess, capUtils, castorConf); driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
sess.execute(); sess.execute();
simRun.wait(); simRun.wait();
for (std::vector<struct expectedResult>::iterator i = expected.begin(); fo