Commit 53037137 authored by Steven Murray's avatar Steven Murray
Browse files

Added isDisabled parameter to Catalogue::createLogicalLibrary()

parent ad717bf0
...@@ -274,7 +274,7 @@ public: ...@@ -274,7 +274,7 @@ public:
virtual void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &tapePoolName) = 0; virtual void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &tapePoolName) = 0;
virtual void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &comment) = 0; virtual void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &comment) = 0;
virtual void createLogicalLibrary(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) = 0; virtual void createLogicalLibrary(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const bool isDisabled, const std::string &comment) = 0;
virtual void deleteLogicalLibrary(const std::string &name) = 0; virtual void deleteLogicalLibrary(const std::string &name) = 0;
virtual std::list<common::dataStructures::LogicalLibrary> getLogicalLibraries() const = 0; virtual std::list<common::dataStructures::LogicalLibrary> getLogicalLibraries() const = 0;
virtual void modifyLogicalLibraryComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) = 0; virtual void modifyLogicalLibraryComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) = 0;
......
...@@ -189,8 +189,8 @@ public: ...@@ -189,8 +189,8 @@ public:
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyArchiveRouteComment(admin, instanceName, storageClassName, copyNb, comment);}, m_maxTriesToConnect); return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyArchiveRouteComment(admin, instanceName, storageClassName, copyNb, comment);}, m_maxTriesToConnect);
} }
void createLogicalLibrary(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) override { void createLogicalLibrary(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const bool isDisabled, const std::string &comment) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->createLogicalLibrary(admin, name, comment);}, m_maxTriesToConnect); return retryOnLostConnection(m_log, [&]{return m_catalogue->createLogicalLibrary(admin, name, isDisabled, comment);}, m_maxTriesToConnect);
} }
void deleteLogicalLibrary(const std::string &name) override { void deleteLogicalLibrary(const std::string &name) override {
......
This diff is collapsed.
...@@ -36,7 +36,7 @@ public: ...@@ -36,7 +36,7 @@ public:
void createAdminUser(const common::dataStructures::SecurityIdentity& admin, const std::string& username, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void createAdminUser(const common::dataStructures::SecurityIdentity& admin, const std::string& username, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createArchiveRoute(const common::dataStructures::SecurityIdentity& admin, const std::string& diskInstanceName, const std::string& storageClassName, const uint32_t copyNb, const std::string& tapePoolName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void createArchiveRoute(const common::dataStructures::SecurityIdentity& admin, const std::string& diskInstanceName, const std::string& storageClassName, const uint32_t copyNb, const std::string& tapePoolName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createLogicalLibrary(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void createLogicalLibrary(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const bool isDisabled, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createMountPolicy(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const uint64_t archivePriority, const uint64_t minArchiveRequestAge, const uint64_t retrievePriority, const uint64_t minRetrieveRequestAge, const uint64_t maxDrivesAllowed, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void createMountPolicy(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const uint64_t archivePriority, const uint64_t minArchiveRequestAge, const uint64_t retrievePriority, const uint64_t minRetrieveRequestAge, const uint64_t maxDrivesAllowed, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createRequesterGroupMountRule(const common::dataStructures::SecurityIdentity& admin, const std::string& mountPolicyName, const std::string& diskInstanceName, const std::string& requesterGroupName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void createRequesterGroupMountRule(const common::dataStructures::SecurityIdentity& admin, const std::string& mountPolicyName, const std::string& diskInstanceName, const std::string& requesterGroupName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createRequesterMountRule(const common::dataStructures::SecurityIdentity& admin, const std::string& mountPolicyName, const std::string& diskInstance, const std::string& requesterName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void createRequesterMountRule(const common::dataStructures::SecurityIdentity& admin, const std::string& mountPolicyName, const std::string& diskInstance, const std::string& requesterName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......
...@@ -1491,6 +1491,7 @@ void RdbmsCatalogue::modifyArchiveRouteComment(const common::dataStructures::Sec ...@@ -1491,6 +1491,7 @@ void RdbmsCatalogue::modifyArchiveRouteComment(const common::dataStructures::Sec
void RdbmsCatalogue::createLogicalLibrary( void RdbmsCatalogue::createLogicalLibrary(
const common::dataStructures::SecurityIdentity &admin, const common::dataStructures::SecurityIdentity &admin,
const std::string &name, const std::string &name,
const bool isDisabled,
const std::string &comment) { const std::string &comment) {
try { try {
auto conn = m_connPool.getConn(); auto conn = m_connPool.getConn();
...@@ -1502,6 +1503,7 @@ void RdbmsCatalogue::createLogicalLibrary( ...@@ -1502,6 +1503,7 @@ void RdbmsCatalogue::createLogicalLibrary(
const char *const sql = const char *const sql =
"INSERT INTO LOGICAL_LIBRARY(" "INSERT INTO LOGICAL_LIBRARY("
"LOGICAL_LIBRARY_NAME," "LOGICAL_LIBRARY_NAME,"
"IS_DISABLED,"
"USER_COMMENT," "USER_COMMENT,"
...@@ -1514,6 +1516,7 @@ void RdbmsCatalogue::createLogicalLibrary( ...@@ -1514,6 +1516,7 @@ void RdbmsCatalogue::createLogicalLibrary(
"LAST_UPDATE_TIME)" "LAST_UPDATE_TIME)"
"VALUES(" "VALUES("
":LOGICAL_LIBRARY_NAME," ":LOGICAL_LIBRARY_NAME,"
":IS_DISABLED,"
":USER_COMMENT," ":USER_COMMENT,"
...@@ -1527,6 +1530,7 @@ void RdbmsCatalogue::createLogicalLibrary( ...@@ -1527,6 +1530,7 @@ void RdbmsCatalogue::createLogicalLibrary(
auto stmt = conn.createStmt(sql); auto stmt = conn.createStmt(sql);
stmt.bindString(":LOGICAL_LIBRARY_NAME", name); stmt.bindString(":LOGICAL_LIBRARY_NAME", name);
stmt.bindBool(":IS_DISABLED", isDisabled);
stmt.bindString(":USER_COMMENT", comment); stmt.bindString(":USER_COMMENT", comment);
...@@ -1602,6 +1606,7 @@ std::list<common::dataStructures::LogicalLibrary> RdbmsCatalogue::getLogicalLibr ...@@ -1602,6 +1606,7 @@ std::list<common::dataStructures::LogicalLibrary> RdbmsCatalogue::getLogicalLibr
const char *const sql = const char *const sql =
"SELECT " "SELECT "
"LOGICAL_LIBRARY_NAME AS LOGICAL_LIBRARY_NAME," "LOGICAL_LIBRARY_NAME AS LOGICAL_LIBRARY_NAME,"
"IS_DISABLED AS IS_DISABLED,"
"USER_COMMENT AS USER_COMMENT," "USER_COMMENT AS USER_COMMENT,"
...@@ -1623,6 +1628,7 @@ std::list<common::dataStructures::LogicalLibrary> RdbmsCatalogue::getLogicalLibr ...@@ -1623,6 +1628,7 @@ std::list<common::dataStructures::LogicalLibrary> RdbmsCatalogue::getLogicalLibr
common::dataStructures::LogicalLibrary lib; common::dataStructures::LogicalLibrary lib;
lib.name = rset.columnString("LOGICAL_LIBRARY_NAME"); lib.name = rset.columnString("LOGICAL_LIBRARY_NAME");
lib.isDisabled = rset.columnBool("IS_DISABLED");
lib.comment = rset.columnString("USER_COMMENT"); lib.comment = rset.columnString("USER_COMMENT");
lib.creationLog.username = rset.columnString("CREATION_LOG_USER_NAME"); lib.creationLog.username = rset.columnString("CREATION_LOG_USER_NAME");
lib.creationLog.host = rset.columnString("CREATION_LOG_HOST_NAME"); lib.creationLog.host = rset.columnString("CREATION_LOG_HOST_NAME");
......
...@@ -269,7 +269,7 @@ public: ...@@ -269,7 +269,7 @@ public:
void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &tapePoolName) override; void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &tapePoolName) override;
void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &comment) override; void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &comment) override;
void createLogicalLibrary(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) override; void createLogicalLibrary(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const bool isDisabled, const std::string &comment) override;
void deleteLogicalLibrary(const std::string &name) override; void deleteLogicalLibrary(const std::string &name) override;
std::list<common::dataStructures::LogicalLibrary> getLogicalLibraries() const override; std::list<common::dataStructures::LogicalLibrary> getLogicalLibraries() const override;
void modifyLogicalLibraryComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) override; void modifyLogicalLibraryComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) override;
......
...@@ -435,8 +435,9 @@ TEST_P(SchedulerTest, archive_report_and_retrieve_new_file) { ...@@ -435,8 +435,9 @@ TEST_P(SchedulerTest, archive_report_and_retrieve_new_file) {
// Create the environment for the migration to happen (library + tape) // Create the environment for the migration to happen (library + tape)
const std::string libraryComment = "Library comment"; const std::string libraryComment = "Library comment";
const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName, catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName,
libraryComment); libraryIsDisabled, libraryComment);
{ {
auto libraries = catalogue.getLogicalLibraries(); auto libraries = catalogue.getLogicalLibraries();
ASSERT_EQ(1, libraries.size()); ASSERT_EQ(1, libraries.size());
...@@ -634,8 +635,9 @@ TEST_P(SchedulerTest, archive_and_retrieve_failure) { ...@@ -634,8 +635,9 @@ TEST_P(SchedulerTest, archive_and_retrieve_failure) {
// Create the environment for the migration to happen (library + tape) // Create the environment for the migration to happen (library + tape)
const std::string libraryComment = "Library comment"; const std::string libraryComment = "Library comment";
const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName, catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName,
libraryComment); libraryIsDisabled, libraryComment);
{ {
auto libraries = catalogue.getLogicalLibraries(); auto libraries = catalogue.getLogicalLibraries();
ASSERT_EQ(1, libraries.size()); ASSERT_EQ(1, libraries.size());
...@@ -884,8 +886,9 @@ TEST_P(SchedulerTest, archive_and_retrieve_report_failure) { ...@@ -884,8 +886,9 @@ TEST_P(SchedulerTest, archive_and_retrieve_report_failure) {
// Create the environment for the migration to happen (library + tape) // Create the environment for the migration to happen (library + tape)
const std::string libraryComment = "Library comment"; const std::string libraryComment = "Library comment";
const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName, catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName,
libraryComment); libraryIsDisabled, libraryComment);
{ {
auto libraries = catalogue.getLogicalLibraries(); auto libraries = catalogue.getLogicalLibraries();
ASSERT_EQ(1, libraries.size()); ASSERT_EQ(1, libraries.size());
...@@ -1128,8 +1131,9 @@ TEST_P(SchedulerTest, retry_archive_until_max_reached) { ...@@ -1128,8 +1131,9 @@ TEST_P(SchedulerTest, retry_archive_until_max_reached) {
// Create the environment for the migration to happen (library + tape) // Create the environment for the migration to happen (library + tape)
const std::string libraryComment = "Library comment"; const std::string libraryComment = "Library comment";
const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName, catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName,
libraryComment); libraryIsDisabled, libraryComment);
{ {
auto libraries = catalogue.getLogicalLibraries(); auto libraries = catalogue.getLogicalLibraries();
ASSERT_EQ(1, libraries.size()); ASSERT_EQ(1, libraries.size());
...@@ -1366,7 +1370,8 @@ TEST_P(SchedulerTest, expandRepackRequest) { ...@@ -1366,7 +1370,8 @@ TEST_P(SchedulerTest, expandRepackRequest) {
const std::string diskFileGroup = "public_disk_group"; const std::string diskFileGroup = "public_disk_group";
//Create a logical library in the catalogue //Create a logical library in the catalogue
catalogue.createLogicalLibrary(admin, s_libraryName, "Create logical library"); const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(admin, s_libraryName, libraryIsDisabled, "Create logical library");
uint64_t nbTapesToRepack = 10; uint64_t nbTapesToRepack = 10;
uint64_t nbTapesForTest = 2; //corresponds to the targetAvailableRequests variable in the Scheduler::promoteRepackRequestsToToExpand() method uint64_t nbTapesForTest = 2; //corresponds to the targetAvailableRequests variable in the Scheduler::promoteRepackRequestsToToExpand() method
...@@ -1701,7 +1706,8 @@ TEST_P(SchedulerTest, expandRepackRequestRetrieveFailed) { ...@@ -1701,7 +1706,8 @@ TEST_P(SchedulerTest, expandRepackRequestRetrieveFailed) {
const std::string diskFileGroup = "public_disk_group"; const std::string diskFileGroup = "public_disk_group";
//Create a logical library in the catalogue //Create a logical library in the catalogue
catalogue.createLogicalLibrary(admin, s_libraryName, "Create logical library"); const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(admin, s_libraryName, libraryIsDisabled, "Create logical library");
std::ostringstream ossVid; std::ostringstream ossVid;
ossVid << s_vid << "_" << 1; ossVid << s_vid << "_" << 1;
...@@ -1940,7 +1946,8 @@ TEST_P(SchedulerTest, expandRepackRequestArchiveSuccess) { ...@@ -1940,7 +1946,8 @@ TEST_P(SchedulerTest, expandRepackRequestArchiveSuccess) {
const std::string diskFileGroup = "public_disk_group"; const std::string diskFileGroup = "public_disk_group";
//Create a logical library in the catalogue //Create a logical library in the catalogue
catalogue.createLogicalLibrary(admin, s_libraryName, "Create logical library"); const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(admin, s_libraryName, libraryIsDisabled, "Create logical library");
std::ostringstream ossVid; std::ostringstream ossVid;
ossVid << s_vid << "_" << 1; ossVid << s_vid << "_" << 1;
...@@ -2186,7 +2193,8 @@ TEST_P(SchedulerTest, expandRepackRequestArchiveFailed) { ...@@ -2186,7 +2193,8 @@ TEST_P(SchedulerTest, expandRepackRequestArchiveFailed) {
const std::string diskFileGroup = "public_disk_group"; const std::string diskFileGroup = "public_disk_group";
//Create a logical library in the catalogue //Create a logical library in the catalogue
catalogue.createLogicalLibrary(admin, s_libraryName, "Create logical library"); const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(admin, s_libraryName, libraryIsDisabled, "Create logical library");
std::ostringstream ossVid; std::ostringstream ossVid;
ossVid << s_vid << "_" << 1; ossVid << s_vid << "_" << 1;
......
...@@ -374,8 +374,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionGooddayRecall) { ...@@ -374,8 +374,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionGooddayRecall) {
// 5) Create the environment for the migration to happen (library + tape) // 5) Create the environment for the migration to happen (library + tape)
const std::string libraryComment = "Library comment"; const std::string libraryComment = "Library comment";
const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName, catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName,
libraryComment); libraryIsDisabled, libraryComment);
{ {
auto libraries = catalogue.getLogicalLibraries(); auto libraries = catalogue.getLogicalLibraries();
ASSERT_EQ(1, libraries.size()); ASSERT_EQ(1, libraries.size());
...@@ -554,8 +555,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionWrongRecall) { ...@@ -554,8 +555,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionWrongRecall) {
// 5) Create the environment for the migration to happen (library + tape) // 5) Create the environment for the migration to happen (library + tape)
const std::string libraryComment = "Library comment"; const std::string libraryComment = "Library comment";
const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName, catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName,
libraryComment); libraryIsDisabled, libraryComment);
{ {
auto libraries = catalogue.getLogicalLibraries(); auto libraries = catalogue.getLogicalLibraries();
ASSERT_EQ(1, libraries.size()); ASSERT_EQ(1, libraries.size());
...@@ -748,8 +750,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionRAORecall) { ...@@ -748,8 +750,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionRAORecall) {
// 5) Create the environment for the migration to happen (library + tape) // 5) Create the environment for the migration to happen (library + tape)
const std::string libraryComment = "Library comment"; const std::string libraryComment = "Library comment";
const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName, catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName,
libraryComment); libraryIsDisabled, libraryComment);
{ {
auto libraries = catalogue.getLogicalLibraries(); auto libraries = catalogue.getLogicalLibraries();
ASSERT_EQ(1, libraries.size()); ASSERT_EQ(1, libraries.size());
...@@ -965,8 +968,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionNoSuchDrive) { ...@@ -965,8 +968,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionNoSuchDrive) {
// 5) Create the environment for the migration to happen (library + tape) // 5) Create the environment for the migration to happen (library + tape)
const std::string libraryComment = "Library comment"; const std::string libraryComment = "Library comment";
const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName, catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName,
libraryComment); libraryIsDisabled, libraryComment);
{ {
auto libraries = catalogue.getLogicalLibraries(); auto libraries = catalogue.getLogicalLibraries();
ASSERT_EQ(1, libraries.size()); ASSERT_EQ(1, libraries.size());
...@@ -1112,8 +1116,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionFailtoMount) { ...@@ -1112,8 +1116,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionFailtoMount) {
// 5) Create the environment for the migration to happen (library + tape) // 5) Create the environment for the migration to happen (library + tape)
const std::string libraryComment = "Library comment"; const std::string libraryComment = "Library comment";
const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName, catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName,
libraryComment); libraryIsDisabled, libraryComment);
{ {
auto libraries = catalogue.getLogicalLibraries(); auto libraries = catalogue.getLogicalLibraries();
ASSERT_EQ(1, libraries.size()); ASSERT_EQ(1, libraries.size());
...@@ -1269,8 +1274,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionGooddayMigration) { ...@@ -1269,8 +1274,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionGooddayMigration) {
// 5) Create the environment for the migration to happen (library + tape) // 5) Create the environment for the migration to happen (library + tape)
const std::string libraryComment = "Library comment"; const std::string libraryComment = "Library comment";
const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName, catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName,
libraryComment); libraryIsDisabled, libraryComment);
{ {
auto libraries = catalogue.getLogicalLibraries(); auto libraries = catalogue.getLogicalLibraries();
ASSERT_EQ(1, libraries.size()); ASSERT_EQ(1, libraries.size());
...@@ -1411,8 +1417,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionMissingFilesMigration) { ...@@ -1411,8 +1417,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionMissingFilesMigration) {
// 5) Create the environment for the migration to happen (library + tape) // 5) Create the environment for the migration to happen (library + tape)
const std::string libraryComment = "Library comment"; const std::string libraryComment = "Library comment";
const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName, catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName,
libraryComment); libraryIsDisabled, libraryComment);
{ {
auto libraries = catalogue.getLogicalLibraries(); auto libraries = catalogue.getLogicalLibraries();
ASSERT_EQ(1, libraries.size()); ASSERT_EQ(1, libraries.size());
...@@ -1569,8 +1576,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionTapeFullMigration) { ...@@ -1569,8 +1576,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionTapeFullMigration) {
// 5) Create the environment for the migration to happen (library + tape) // 5) Create the environment for the migration to happen (library + tape)
const std::string libraryComment = "Library comment"; const std::string libraryComment = "Library comment";
const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName, catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName,
libraryComment); libraryIsDisabled, libraryComment);
{ {
auto libraries = catalogue.getLogicalLibraries(); auto libraries = catalogue.getLogicalLibraries();
ASSERT_EQ(1, libraries.size()); ASSERT_EQ(1, libraries.size());
...@@ -1725,8 +1733,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionTapeFullOnFlushMigration) { ...@@ -1725,8 +1733,9 @@ TEST_P(DataTransferSessionTest, DataTransferSessionTapeFullOnFlushMigration) {
// 5) Create the environment for the migration to happen (library + tape) // 5) Create the environment for the migration to happen (library + tape)
const std::string libraryComment = "Library comment"; const std::string libraryComment = "Library comment";
const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName, catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName,
libraryComment); libraryIsDisabled, libraryComment);
{ {
auto libraries = catalogue.getLogicalLibraries(); auto libraries = catalogue.getLogicalLibraries();
ASSERT_EQ(1, libraries.size()); ASSERT_EQ(1, libraries.size());
...@@ -1879,8 +1888,9 @@ TEST_P(DataTransferSessionTest, WriteDataInTapeWithNonSupersededFilesOnIt) { ...@@ -1879,8 +1888,9 @@ TEST_P(DataTransferSessionTest, WriteDataInTapeWithNonSupersededFilesOnIt) {
// 5) Create the environment for the migration to happen (library + tape) // 5) Create the environment for the migration to happen (library + tape)
const std::string libraryComment = "Library comment"; const std::string libraryComment = "Library comment";
const bool libraryIsDisabled = false;
catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName, catalogue.createLogicalLibrary(s_adminOnAdminHost, s_libraryName,
libraryComment); libraryIsDisabled, libraryComment);
{ {
auto libraries = catalogue.getLogicalLibraries(); auto libraries = catalogue.getLogicalLibraries();
ASSERT_EQ(1, libraries.size()); ASSERT_EQ(1, libraries.size());
......
...@@ -116,6 +116,7 @@ namespace unitTests { ...@@ -116,6 +116,7 @@ namespace unitTests {
const std::string mediaType = "media_type"; const std::string mediaType = "media_type";
const std::string vendor = "vendor"; const std::string vendor = "vendor";
const std::string logicalLibraryName = "logical_library_name"; const std::string logicalLibraryName = "logical_library_name";
const bool logicalLibraryIsDisabled = false;
const std::string tapePoolName = "tape_pool_name"; const std::string tapePoolName = "tape_pool_name";
const std::string vo = "vo"; const std::string vo = "vo";
const cta::optional<std::string> supply("value for the supply pool mechanism"); const cta::optional<std::string> supply("value for the supply pool mechanism");
...@@ -125,7 +126,7 @@ namespace unitTests { ...@@ -125,7 +126,7 @@ namespace unitTests {
const std::string createTapeComment = "Create tape"; const std::string createTapeComment = "Create tape";
cta::common::dataStructures::SecurityIdentity admin = cta::common::dataStructures::SecurityIdentity("admin","localhost"); cta::common::dataStructures::SecurityIdentity admin = cta::common::dataStructures::SecurityIdentity("admin","localhost");
m_catalogue->createLogicalLibrary(admin, logicalLibraryName, "Create logical library"); m_catalogue->createLogicalLibrary(admin, logicalLibraryName, logicalLibraryIsDisabled, "Create logical library");
m_catalogue->createTapePool(admin, tapePoolName, vo, 2, true, supply, "Create tape pool"); m_catalogue->createTapePool(admin, tapePoolName, vo, 2, true, supply, "Create tape pool");
m_catalogue->createTape(admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, m_catalogue->createTape(admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes,
disabledValue, fullValue, createTapeComment); disabledValue, fullValue, createTapeComment);
...@@ -263,6 +264,7 @@ namespace unitTests { ...@@ -263,6 +264,7 @@ namespace unitTests {
const std::string mediaType = "media_type"; const std::string mediaType = "media_type";
const std::string vendor = "vendor"; const std::string vendor = "vendor";
const std::string logicalLibraryName = "logical_library_name"; const std::string logicalLibraryName = "logical_library_name";
const bool logicalLibraryIsDisabled = false;
const std::string tapePoolName = "tape_pool_name"; const std::string tapePoolName = "tape_pool_name";
const std::string vo = "vo"; const std::string vo = "vo";
const uint64_t nbPartialTapes = 2; const uint64_t nbPartialTapes = 2;
...@@ -274,7 +276,7 @@ namespace unitTests { ...@@ -274,7 +276,7 @@ namespace unitTests {
const std::string createTapeComment = "Create tape"; const std::string createTapeComment = "Create tape";
cta::common::dataStructures::SecurityIdentity admin = cta::common::dataStructures::SecurityIdentity("admin","localhost"); cta::common::dataStructures::SecurityIdentity admin = cta::common::dataStructures::SecurityIdentity("admin","localhost");
m_catalogue->createLogicalLibrary(admin, logicalLibraryName, "Create logical library"); m_catalogue->createLogicalLibrary(admin, logicalLibraryName, logicalLibraryIsDisabled, "Create logical library");
m_catalogue->createTapePool(admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTapePool(admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool");
m_catalogue->createTape(admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, m_catalogue->createTape(admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes,
disabledValue, fullValue, createTapeComment); disabledValue, fullValue, createTapeComment);
......
...@@ -1203,8 +1203,9 @@ void RequestMessage::processLogicalLibrary_Add(const cta::admin::AdminCmd &admin ...@@ -1203,8 +1203,9 @@ void RequestMessage::processLogicalLibrary_Add(const cta::admin::AdminCmd &admin
auto &name = getRequired(OptionString::LOGICAL_LIBRARY); auto &name = getRequired(OptionString::LOGICAL_LIBRARY);
auto &comment = getRequired(OptionString::COMMENT); auto &comment = getRequired(OptionString::COMMENT);
const bool isDisabled = false; // TBD
m_catalogue.createLogicalLibrary(m_cliIdentity, name, comment); m_catalogue.createLogicalLibrary(m_cliIdentity, name, isDisabled, comment);
response.set_type(cta::xrd::Response::RSP_SUCCESS); response.set_type(cta::xrd::Response::RSP_SUCCESS);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment