From d57e77e3cad3d95807156500fe09097f424e6e7b Mon Sep 17 00:00:00 2001 From: Steven Murray <Steven.Murray@cern.ch> Date: Mon, 20 May 2019 15:18:39 +0200 Subject: [PATCH] Added supply parameter to Catalogue::createTapePool() --- catalogue/Catalogue.hpp | 3 +- catalogue/CatalogueRetryWrapper.hpp | 4 +- catalogue/CatalogueTest.cpp | 400 ++++++++++++++---- catalogue/DummyCatalogue.hpp | 2 +- catalogue/RdbmsCatalogue.cpp | 7 + catalogue/RdbmsCatalogue.hpp | 2 +- scheduler/SchedulerTest.cpp | 4 +- .../daemon/DataTransferSessionTest.cpp | 3 +- .../daemon/MigrationReportPackerTest.cpp | 8 +- xroot_plugins/XrdSsiCtaRequestMessage.cpp | 3 +- 10 files changed, 339 insertions(+), 97 deletions(-) diff --git a/catalogue/Catalogue.hpp b/catalogue/Catalogue.hpp index 85e3e0a6be..19184a2837 100644 --- a/catalogue/Catalogue.hpp +++ b/catalogue/Catalogue.hpp @@ -59,6 +59,7 @@ #include "common/exception/UserError.hpp" #include "common/log/LogContext.hpp" #include "common/log/Logger.hpp" +#include "common/optional.hpp" #include <list> #include <map> @@ -238,7 +239,7 @@ public: virtual void modifyStorageClassNbCopies(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &name, const uint64_t nbCopies) = 0; virtual void modifyStorageClassComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &name, const std::string &comment) = 0; - virtual void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo, const uint64_t nbPartialTapes, const bool encryptionValue, const std::string &comment) = 0; + virtual void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo, const uint64_t nbPartialTapes, const bool encryptionValue, const cta::optional<std::string> &supply, const std::string &comment) = 0; virtual void deleteTapePool(const std::string &name) = 0; virtual std::list<TapePool> getTapePools() const = 0; virtual void modifyTapePoolVo(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo) = 0; diff --git a/catalogue/CatalogueRetryWrapper.hpp b/catalogue/CatalogueRetryWrapper.hpp index 9e01f127fe..98e56ada30 100644 --- a/catalogue/CatalogueRetryWrapper.hpp +++ b/catalogue/CatalogueRetryWrapper.hpp @@ -137,8 +137,8 @@ public: return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyStorageClassComment(admin, instanceName, name, comment);}, m_maxTriesToConnect); } - void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo, const uint64_t nbPartialTapes, const bool encryptionValue, const std::string &comment) override { - return retryOnLostConnection(m_log, [&]{return m_catalogue->createTapePool(admin, name, vo, nbPartialTapes, encryptionValue, comment);}, m_maxTriesToConnect); + void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo, const uint64_t nbPartialTapes, const bool encryptionValue, const cta::optional<std::string> &supply, const std::string &comment) override { + return retryOnLostConnection(m_log, [&]{return m_catalogue->createTapePool(admin, name, vo, nbPartialTapes, encryptionValue, supply, comment);}, m_maxTriesToConnect); } void deleteTapePool(const std::string &name) override { diff --git a/catalogue/CatalogueTest.cpp b/catalogue/CatalogueTest.cpp index 5223ea8193..efb9c670d0 100644 --- a/catalogue/CatalogueTest.cpp +++ b/catalogue/CatalogueTest.cpp @@ -798,8 +798,9 @@ TEST_P(cta_catalogue_CatalogueTest, createTapePool) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const std::string comment = "Create tape pool"; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, comment); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, comment); ASSERT_TRUE(m_catalogue->tapePoolExists(tapePoolName)); @@ -812,6 +813,52 @@ TEST_P(cta_catalogue_CatalogueTest, createTapePool) { ASSERT_EQ(vo, pool.vo); ASSERT_EQ(nbPartialTapes, pool.nbPartialTapes); ASSERT_EQ(isEncrypted, pool.encryption); + ASSERT_TRUE((bool)pool.supply); + ASSERT_EQ(supply.value(), pool.supply.value()); + ASSERT_EQ(supply, pool.supply); + ASSERT_EQ(0, pool.nbTapes); + ASSERT_EQ(0, pool.capacityBytes); + ASSERT_EQ(0, pool.dataBytes); + ASSERT_EQ(0, pool.nbPhysicalFiles); + ASSERT_EQ(comment, pool.comment); + + const common::dataStructures::EntryLog creationLog = pool.creationLog; + ASSERT_EQ(m_admin.username, creationLog.username); + ASSERT_EQ(m_admin.host, creationLog.host); + + const common::dataStructures::EntryLog lastModificationLog = + pool.lastModificationLog; + ASSERT_EQ(creationLog, lastModificationLog); +} + +TEST_P(cta_catalogue_CatalogueTest, createTapePool_null_supply) { + using namespace cta; + + ASSERT_TRUE(m_catalogue->getTapePools().empty()); + + const std::string tapePoolName = "tape_pool"; + + ASSERT_FALSE(m_catalogue->tapePoolExists(tapePoolName)); + + const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply; + const std::string comment = "Create tape pool"; + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, comment); + + ASSERT_TRUE(m_catalogue->tapePoolExists(tapePoolName)); + + const auto pools = m_catalogue->getTapePools(); + + ASSERT_EQ(1, pools.size()); + + const auto &pool = pools.front(); + ASSERT_EQ(tapePoolName, pool.name); + ASSERT_EQ(vo, pool.vo); + ASSERT_EQ(nbPartialTapes, pool.nbPartialTapes); + ASSERT_EQ(isEncrypted, pool.encryption); + ASSERT_FALSE((bool)pool.supply); ASSERT_EQ(0, pool.nbTapes); ASSERT_EQ(0, pool.capacityBytes); ASSERT_EQ(0, pool.dataBytes); @@ -834,9 +881,10 @@ TEST_P(cta_catalogue_CatalogueTest, createTapePool_same_twice) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const std::string comment = "Create tape pool"; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, comment); - ASSERT_THROW(m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, comment), + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, comment); + ASSERT_THROW(m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, comment), exception::UserError); } @@ -849,8 +897,9 @@ TEST_P(cta_catalogue_CatalogueTest, deleteTapePool) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const std::string comment = "Create tape pool"; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, comment); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, comment); const auto pools = m_catalogue->getTapePools(); @@ -893,15 +942,18 @@ TEST_P(cta_catalogue_CatalogueTest, deleteTapePool_notEmpty) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const std::string comment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); { const auto pools = m_catalogue->getTapePools(); ASSERT_EQ(1, pools.size()); @@ -973,8 +1025,9 @@ TEST_P(cta_catalogue_CatalogueTest, createTapePool_emptyStringTapePoolName) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const std::string comment = "Create tape pool"; - ASSERT_THROW(m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, comment), + ASSERT_THROW(m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, comment), catalogue::UserSpecifiedAnEmptyStringTapePoolName); } @@ -990,8 +1043,9 @@ TEST_P(cta_catalogue_CatalogueTest, createTapePool_emptyStringVO) { const std::string vo = ""; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const std::string comment = "Create tape pool"; - ASSERT_THROW(m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, comment), + ASSERT_THROW(m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, comment), catalogue::UserSpecifiedAnEmptyStringVo); } @@ -1007,8 +1061,9 @@ TEST_P(cta_catalogue_CatalogueTest, createTapePool_emptyStringComment) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const std::string comment = ""; - ASSERT_THROW(m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, comment), + ASSERT_THROW(m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, comment), catalogue::UserSpecifiedAnEmptyStringComment); } @@ -1028,8 +1083,9 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapePoolVo) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const std::string comment = "Create tape pool"; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, comment); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, comment); { const auto pools = m_catalogue->getTapePools(); @@ -1100,8 +1156,9 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapePoolVo_emptyStringVo) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const std::string comment = "Create tape pool"; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, comment); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, comment); { const auto pools = m_catalogue->getTapePools(); @@ -1141,8 +1198,9 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapePoolNbPartialTapes) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const std::string comment = "Create tape pool"; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, comment); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, comment); { const auto pools = m_catalogue->getTapePools(); @@ -1224,8 +1282,9 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapePoolComment) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const std::string comment = "Create tape pool"; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, comment); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, comment); { const auto pools = m_catalogue->getTapePools(); @@ -1296,8 +1355,9 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapePoolComment_emptyStringComment) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const std::string comment = "Create tape pool"; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, comment); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, comment); { const auto pools = m_catalogue->getTapePools(); @@ -1347,8 +1407,9 @@ TEST_P(cta_catalogue_CatalogueTest, setTapePoolEncryption) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const std::string comment = "Create tape pool"; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, comment); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, comment); { const auto pools = m_catalogue->getTapePools(); @@ -1427,7 +1488,8 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; const std::string comment = "Create archive route"; @@ -1470,7 +1532,8 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_emptyStringDiskInstanceNa const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const std::string diskInstanceName = ""; const uint32_t copyNb = 1; @@ -1497,7 +1560,8 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_emptyStringStorageClassNa const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const std::string storageClassName = ""; const uint32_t copyNb = 1; @@ -1524,7 +1588,8 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_zeroCopyNb) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 0; const std::string comment = "Create archive route"; @@ -1571,7 +1636,8 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_emptyStringComment) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; const std::string comment = ""; @@ -1593,7 +1659,8 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_non_existent_storage_clas const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; const std::string comment = "Create archive route"; @@ -1650,7 +1717,8 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_same_name_different_disk_ const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; const std::string comment = "Create archive route"; @@ -1702,7 +1770,8 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_same_twice) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; const std::string comment = "Create archive route"; @@ -1729,7 +1798,8 @@ TEST_P(cta_catalogue_CatalogueTest, deleteArchiveRoute) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; const std::string comment = "Create archive route"; @@ -1782,7 +1852,8 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_deleteStorageClass) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; const std::string comment = "Create archive route"; @@ -1828,10 +1899,12 @@ TEST_P(cta_catalogue_CatalogueTest, modifyArchiveRouteTapePoolName) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const std::string anotherTapePoolName = "another_tape_pool"; - m_catalogue->createTapePool(m_admin, anotherTapePoolName, vo, nbPartialTapes, isEncrypted, "Create another tape pool"); + m_catalogue->createTapePool(m_admin, anotherTapePoolName, vo, nbPartialTapes, isEncrypted, supply, + "Create another tape pool"); const uint32_t copyNb = 1; const std::string comment = "Create archive route"; @@ -1896,7 +1969,8 @@ TEST_P(cta_catalogue_CatalogueTest, modifyArchiveRouteTapePoolName_nonExistentAr const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; ASSERT_THROW(m_catalogue->modifyArchiveRouteTapePoolName(m_admin, storageClass.diskInstance, storageClass.name, @@ -1921,7 +1995,8 @@ TEST_P(cta_catalogue_CatalogueTest, modifyArchiveRouteComment) { const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; const std::string comment = "Create archive route"; @@ -1988,7 +2063,8 @@ TEST_P(cta_catalogue_CatalogueTest, modifyArchiveRouteComment_nonExistentArchive const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; const std::string comment = "Comment"; @@ -2149,6 +2225,9 @@ TEST_P(cta_catalogue_CatalogueTest, createTape) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -2157,7 +2236,7 @@ TEST_P(cta_catalogue_CatalogueTest, createTape) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); { const auto pools = m_catalogue->getTapePools(); ASSERT_EQ(1, pools.size()); @@ -2230,6 +2309,9 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_emptyStringVid) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -2238,7 +2320,7 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_emptyStringVid) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); { const auto pools = m_catalogue->getTapePools(); ASSERT_EQ(1, pools.size()); @@ -2270,12 +2352,15 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_emptyStringMediaType) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string comment = "Create tape"; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); { const auto pools = m_catalogue->getTapePools(); ASSERT_EQ(1, pools.size()); @@ -2307,12 +2392,15 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_emptyStringVendor) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string comment = "Create tape"; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); { const auto pools = m_catalogue->getTapePools(); ASSERT_EQ(1, pools.size()); @@ -2344,12 +2432,15 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_emptyStringLogicalLibraryName) { const std::string logicalLibraryName = ""; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string comment = "Create tape"; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); { const auto pools = m_catalogue->getTapePools(); ASSERT_EQ(1, pools.size()); @@ -2407,6 +2498,9 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_zeroCapacity) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = 0; const bool disabledValue = true; const bool fullValue = false; @@ -2415,7 +2509,7 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_zeroCapacity) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); { const auto pools = m_catalogue->getTapePools(); ASSERT_EQ(1, pools.size()); @@ -2447,6 +2541,9 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_emptyStringComment) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -2455,7 +2552,7 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_emptyStringComment) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); { const auto pools = m_catalogue->getTapePools(); ASSERT_EQ(1, pools.size()); @@ -2484,12 +2581,15 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_non_existent_logical_library) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string comment = "Create tape"; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); ASSERT_THROW(m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment), exception::UserError); } @@ -2526,6 +2626,9 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_9_exabytes_capacity) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); // The maximum size of an SQLite integer is a signed 64-bit integer const uint64_t capacityInBytes = 9L * 1000 * 1000 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; @@ -2534,7 +2637,7 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_9_exabytes_capacity) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); { const auto pools = m_catalogue->getTapePools(); ASSERT_EQ(1, pools.size()); @@ -2602,6 +2705,9 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_same_twice) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -2610,7 +2716,7 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_same_twice) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); { const auto pools = m_catalogue->getTapePools(); ASSERT_EQ(1, pools.size()); @@ -2666,6 +2772,9 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_many_tapes) { const std::string logicalLibrary = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t) 10 * 1000 * 1000 * 1000 * 1000; const bool disabled = true; const bool full = false; @@ -2675,7 +2784,7 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_many_tapes) { m_catalogue->createLogicalLibrary(m_admin, logicalLibrary, "Create logical library"); ASSERT_TRUE(m_catalogue->getTapePools().empty()); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); { const auto pools = m_catalogue->getTapePools(); ASSERT_EQ(1, pools.size()); @@ -2930,13 +3039,16 @@ TEST_P(cta_catalogue_CatalogueTest, createTape_1_tape_with_write_log_1_tape_with const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string comment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); { const auto pools = m_catalogue->getTapePools(); @@ -3093,6 +3205,9 @@ TEST_P(cta_catalogue_CatalogueTest, deleteTape) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -3100,7 +3215,7 @@ TEST_P(cta_catalogue_CatalogueTest, deleteTape) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -3155,6 +3270,9 @@ TEST_P(cta_catalogue_CatalogueTest, deleteNonEmptyTape) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -3162,7 +3280,7 @@ TEST_P(cta_catalogue_CatalogueTest, deleteNonEmptyTape) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -3274,6 +3392,9 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeMediaType) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -3281,7 +3402,7 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeMediaType) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -3352,6 +3473,9 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeVendor) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -3359,7 +3483,7 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeVendor) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -3431,6 +3555,9 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeLogicalLibraryName) { const std::string anotherLogicalLibraryName = "another_logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -3439,7 +3566,7 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeLogicalLibraryName) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); m_catalogue->createLogicalLibrary(m_admin, anotherLogicalLibraryName, "Create another logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -3523,6 +3650,9 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeTapePoolName) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const std::string anotherTapePoolName = "another_tape_pool_name"; const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; @@ -3531,8 +3661,8 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeTapePoolName) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); - m_catalogue->createTapePool(m_admin, anotherTapePoolName, vo, 2, true, "Create another tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); + m_catalogue->createTapePool(m_admin, anotherTapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create another tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -3602,9 +3732,12 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeTapePoolName_nonExistentTape) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); ASSERT_THROW(m_catalogue->modifyTapeTapePoolName(m_admin, vid, tapePoolName), exception::UserError); } @@ -3620,6 +3753,9 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeCapacityInBytes) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -3627,7 +3763,7 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeCapacityInBytes) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -3711,6 +3847,9 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeEncryptionKey) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -3718,7 +3857,7 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeEncryptionKey) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -3803,6 +3942,9 @@ TEST_P(cta_catalogue_CatalogueTest, tapeLabelled) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -3810,7 +3952,7 @@ TEST_P(cta_catalogue_CatalogueTest, tapeLabelled) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -3895,6 +4037,9 @@ TEST_P(cta_catalogue_CatalogueTest, tapeMountedForArchive) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -3902,7 +4047,7 @@ TEST_P(cta_catalogue_CatalogueTest, tapeMountedForArchive) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -3987,6 +4132,9 @@ TEST_P(cta_catalogue_CatalogueTest, tapeMountedForRetrieve) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -3994,7 +4142,7 @@ TEST_P(cta_catalogue_CatalogueTest, tapeMountedForRetrieve) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -4079,6 +4227,9 @@ TEST_P(cta_catalogue_CatalogueTest, setTapeFull) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -4086,7 +4237,7 @@ TEST_P(cta_catalogue_CatalogueTest, setTapeFull) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -4168,6 +4319,9 @@ TEST_P(cta_catalogue_CatalogueTest, noSpaceLeftOnTape) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -4175,7 +4329,7 @@ TEST_P(cta_catalogue_CatalogueTest, noSpaceLeftOnTape) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -4257,6 +4411,9 @@ TEST_P(cta_catalogue_CatalogueTest, setTapeDisabled) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = false; const bool fullValue = false; @@ -4264,7 +4421,7 @@ TEST_P(cta_catalogue_CatalogueTest, setTapeDisabled) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -4346,13 +4503,16 @@ TEST_P(cta_catalogue_CatalogueTest, getTapesForWriting) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = false; const bool fullValue = false; const std::string comment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); m_catalogue->tapeLabelled(vid, "tape_drive"); @@ -4383,13 +4543,16 @@ TEST_P(cta_catalogue_CatalogueTest, DISABLED_getTapesForWriting_no_labelled_tape const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = false; const bool fullValue = false; const std::string comment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -5753,7 +5916,8 @@ TEST_P(cta_catalogue_CatalogueTest, checkAndGetNextArchiveFileId_no_mount_rules) const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; const std::string archiveRouteComment = "Create archive route"; @@ -5838,7 +6002,8 @@ TEST_P(cta_catalogue_CatalogueTest, checkAndGetNextArchiveFileId_requester_mount const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; const std::string archiveRouteComment = "Create archive route"; @@ -5928,7 +6093,8 @@ TEST_P(cta_catalogue_CatalogueTest, checkAndGetNextArchiveFileId_requester_group const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; const std::string archiveRouteComment = "Create archive route"; @@ -6037,7 +6203,8 @@ TEST_P(cta_catalogue_CatalogueTest, checkAndGetNextArchiveFileId_requester_mount const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; const std::string archiveRouteComment = "Create archive route"; @@ -6186,7 +6353,8 @@ TEST_P(cta_catalogue_CatalogueTest, getArchiveFileQueueCriteria_requester_mount_ const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; const std::string archiveRouteComment = "Create archive route"; @@ -6268,7 +6436,8 @@ TEST_P(cta_catalogue_CatalogueTest, getArchiveFileQueueCriteria_requester_group_ const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; const std::string archiveRouteComment = "Create archive route"; @@ -6369,7 +6538,8 @@ TEST_P(cta_catalogue_CatalogueTest, getArchiveFileQueueCriteria_requester_mount_ const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; const bool isEncrypted = true; - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool"); + const cta::optional<std::string> supply("value for the supply pool mechanism"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t copyNb = 1; const std::string archiveRouteComment = "Create archive route"; @@ -6414,13 +6584,16 @@ TEST_P(cta_catalogue_CatalogueTest, prepareToRetrieveFileUsingArchiveFileId) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = false; const bool fullValue = false; const std::string createTapeComment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, createTapeComment); m_catalogue->createTape(m_admin, vid2, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, @@ -6672,13 +6845,16 @@ TEST_P(cta_catalogue_CatalogueTest, prepareToRetrieveFileUsingArchiveFileId_disa const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = false; const bool fullValue = false; const std::string createTapeComment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, createTapeComment); m_catalogue->createTape(m_admin, vid2, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, @@ -7148,6 +7324,9 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_many_archive_files) { const std::string tapePoolName1 = "tape_pool_name_1"; const std::string tapePoolName2 = "tape_pool_name_2"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 1; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -7155,7 +7334,7 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_many_archive_files) { m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName1, vo, 1, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName1, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); { const auto pools = m_catalogue->getTapePools(); ASSERT_EQ(1, pools.size()); @@ -7172,7 +7351,7 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_many_archive_files) { ASSERT_EQ(0, pool.nbPhysicalFiles); } - m_catalogue->createTapePool(m_admin, tapePoolName2, vo, 1, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName2, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); { const auto pools = m_catalogue->getTapePools(); ASSERT_EQ(2, pools.size()); @@ -8133,6 +8312,9 @@ TEST_P(cta_catalogue_CatalogueTest, DISABLED_concurrent_filesWrittenToTape_many_ const std::string tapePoolName1 = "tape_pool_name_1"; const std::string tapePoolName2 = "tape_pool_name_2"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 1; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -8140,7 +8322,7 @@ TEST_P(cta_catalogue_CatalogueTest, DISABLED_concurrent_filesWrittenToTape_many_ m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName1, vo, 1, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName1, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); { const auto pools = m_catalogue->getTapePools(); ASSERT_EQ(1, pools.size()); @@ -8157,7 +8339,7 @@ TEST_P(cta_catalogue_CatalogueTest, DISABLED_concurrent_filesWrittenToTape_many_ ASSERT_EQ(0, pool.nbPhysicalFiles); } - m_catalogue->createTapePool(m_admin, tapePoolName2, vo, 1, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName2, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); { const auto pools = m_catalogue->getTapePools(); ASSERT_EQ(2, pools.size()); @@ -8953,13 +9135,16 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_1_archive_file_2_tape_cop const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string comment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); m_catalogue->createTape(m_admin, vid2, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, @@ -9182,13 +9367,16 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_1_archive_file_2_tape_cop const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string comment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); m_catalogue->createTape(m_admin, vid2, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, @@ -9407,13 +9595,16 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_1_archive_file_2_tape_cop const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string comment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -9606,13 +9797,16 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_1_archive_file_2_tape_cop const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string comment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); m_catalogue->createTape(m_admin, vid2, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, @@ -9788,13 +9982,16 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_1_archive_file_2_tape_cop const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string comment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); m_catalogue->createTape(m_admin, vid2, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, @@ -9970,13 +10167,16 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_1_archive_file_2_tape_cop const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string comment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); m_catalogue->createTape(m_admin, vid2, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, @@ -10152,13 +10352,16 @@ TEST_P(cta_catalogue_CatalogueTest, deleteArchiveFile) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string comment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); m_catalogue->createTape(m_admin, vid2, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, @@ -10469,13 +10672,16 @@ TEST_P(cta_catalogue_CatalogueTest, deleteArchiveFile_by_archive_file_id_of_anot const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string comment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); m_catalogue->createTape(m_admin, vid2, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, @@ -10815,12 +11021,14 @@ TEST_P(cta_catalogue_CatalogueTest, getAllTapes_many_tapes) { const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); const uint32_t nbTapes = 10; @@ -10867,13 +11075,16 @@ TEST_P(cta_catalogue_CatalogueTest, reclaimTape_full_lastFSeq_0_no_tape_files) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string comment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -10948,13 +11159,16 @@ TEST_P(cta_catalogue_CatalogueTest, reclaimTape_not_full_lastFSeq_0_no_tape_file const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string comment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, comment); @@ -11004,13 +11218,16 @@ TEST_P(cta_catalogue_CatalogueTest, reclaimTape_full_lastFSeq_1_no_tape_files) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string createTapeComment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, createTapeComment); @@ -11227,13 +11444,16 @@ TEST_P(cta_catalogue_CatalogueTest, reclaimTape_full_lastFSeq_1_one_tape_file) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string createTapeComment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, createTapeComment); @@ -11387,13 +11607,16 @@ TEST_P(cta_catalogue_CatalogueTest, reclaimTape_full_lastFSeq_1_one_tape_file_su const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string createTapeComment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, createTapeComment); m_catalogue->createTape(m_admin, vid2, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, @@ -11606,13 +11829,16 @@ TEST_P(cta_catalogue_CatalogueTest, exist_non_superseded_files_after_fseq) { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; const std::string createTapeComment = "Create tape"; m_catalogue->createLogicalLibrary(m_admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(m_admin, tapePoolName, vo, 2, true, "Create tape pool"); + m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, supply, "Create tape pool"); m_catalogue->createTape(m_admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabledValue, fullValue, createTapeComment); diff --git a/catalogue/DummyCatalogue.hpp b/catalogue/DummyCatalogue.hpp index 506f2678be..69ab14469c 100644 --- a/catalogue/DummyCatalogue.hpp +++ b/catalogue/DummyCatalogue.hpp @@ -42,7 +42,7 @@ public: 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 createStorageClass(const common::dataStructures::SecurityIdentity& admin, const common::dataStructures::StorageClass& storageClass) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void createTape(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const std::string &mediaType, const std::string &vendor, const std::string& logicalLibraryName, const std::string& tapePoolName, const uint64_t capacityInBytes, const bool disabled, const bool full, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } - void createTapePool(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const std::string & vo, const uint64_t nbPartialTapes, const bool encryptionValue, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } + void createTapePool(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const std::string & vo, const uint64_t nbPartialTapes, const bool encryptionValue, const cta::optional<std::string> &supply, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void deleteAdminUser(const std::string& username) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void deleteArchiveFile(const std::string& instanceName, const uint64_t archiveFileId, log::LogContext &lc) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void deleteArchiveRoute(const std::string& diskInstanceName, const std::string& storageClassName, const uint32_t copyNb) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } diff --git a/catalogue/RdbmsCatalogue.cpp b/catalogue/RdbmsCatalogue.cpp index 0db0322496..a2b8ddbecd 100644 --- a/catalogue/RdbmsCatalogue.cpp +++ b/catalogue/RdbmsCatalogue.cpp @@ -568,6 +568,7 @@ void RdbmsCatalogue::createTapePool( const std::string &vo, const uint64_t nbPartialTapes, const bool encryptionValue, + const cta::optional<std::string> &supply, const std::string &comment) { try { if(name.empty()) { @@ -595,6 +596,7 @@ void RdbmsCatalogue::createTapePool( "VO," "NB_PARTIAL_TAPES," "IS_ENCRYPTED," + "SUPPLY," "USER_COMMENT," @@ -610,6 +612,7 @@ void RdbmsCatalogue::createTapePool( ":VO," ":NB_PARTIAL_TAPES," ":IS_ENCRYPTED," + ":SUPPLY," ":USER_COMMENT," @@ -626,6 +629,7 @@ void RdbmsCatalogue::createTapePool( stmt.bindString(":VO", vo); stmt.bindUint64(":NB_PARTIAL_TAPES", nbPartialTapes); stmt.bindBool(":IS_ENCRYPTED", encryptionValue); + stmt.bindOptionalString(":SUPPLY", supply); stmt.bindString(":USER_COMMENT", comment); @@ -893,6 +897,7 @@ std::list<TapePool> RdbmsCatalogue::getTapePools() const { "COALESCE(TAPE_POOL.VO, 'NONE') AS VO," // TBD Remove COALESCE "TAPE_POOL.NB_PARTIAL_TAPES AS NB_PARTIAL_TAPES," "TAPE_POOL.IS_ENCRYPTED AS IS_ENCRYPTED," + "TAPE_POOL.SUPPLY AS SUPPLY," "COALESCE(COUNT(TAPE.VID), 0) AS NB_TAPES," "COALESCE(SUM(TAPE.CAPACITY_IN_BYTES), 0) AS CAPACITY_IN_BYTES," @@ -917,6 +922,7 @@ std::list<TapePool> RdbmsCatalogue::getTapePools() const { "TAPE_POOL.VO," "TAPE_POOL.NB_PARTIAL_TAPES," "TAPE_POOL.IS_ENCRYPTED," + "TAPE_POOL.SUPPLY," "TAPE_POOL.USER_COMMENT," "TAPE_POOL.CREATION_LOG_USER_NAME," "TAPE_POOL.CREATION_LOG_HOST_NAME," @@ -937,6 +943,7 @@ std::list<TapePool> RdbmsCatalogue::getTapePools() const { pool.vo = rset.columnString("VO"); pool.nbPartialTapes = rset.columnUint64("NB_PARTIAL_TAPES"); pool.encryption = rset.columnBool("IS_ENCRYPTED"); + pool.supply = rset.columnOptionalString("SUPPLY"); pool.nbTapes = rset.columnUint64("NB_TAPES"); pool.capacityBytes = rset.columnUint64("CAPACITY_IN_BYTES"); pool.dataBytes = rset.columnUint64("DATA_IN_BYTES"); diff --git a/catalogue/RdbmsCatalogue.hpp b/catalogue/RdbmsCatalogue.hpp index 44deff7e83..dc32daccac 100644 --- a/catalogue/RdbmsCatalogue.hpp +++ b/catalogue/RdbmsCatalogue.hpp @@ -233,7 +233,7 @@ public: void modifyStorageClassNbCopies(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &name, const uint64_t nbCopies) override; void modifyStorageClassComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &name, const std::string &comment) override; - void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo, const uint64_t nbPartialTapes, const bool encryptionValue, const std::string &comment) override; + void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo, const uint64_t nbPartialTapes, const bool encryptionValue, const cta::optional<std::string> &supply, const std::string &comment) override; void deleteTapePool(const std::string &name) override; std::list<TapePool> getTapePools() const override; void modifyTapePoolVo(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo) override; diff --git a/scheduler/SchedulerTest.cpp b/scheduler/SchedulerTest.cpp index e19034f0fa..9a142e50e0 100644 --- a/scheduler/SchedulerTest.cpp +++ b/scheduler/SchedulerTest.cpp @@ -214,7 +214,9 @@ public: const std::string tapePoolComment = "Tape-pool comment"; const std::string vo = "vo"; const bool tapePoolEncryption = false; - catalogue.createTapePool(s_adminOnAdminHost, s_tapePoolName, vo, nbPartialTapes, tapePoolEncryption, tapePoolComment); + const cta::optional<std::string> tapePoolSupply("value for the supply pool mechanism"); + catalogue.createTapePool(s_adminOnAdminHost, s_tapePoolName, vo, nbPartialTapes, tapePoolEncryption, tapePoolSupply, + tapePoolComment); const uint32_t copyNb = 1; const std::string archiveRouteComment = "Archive-route comment"; catalogue.createArchiveRoute(s_adminOnAdminHost, s_diskInstance, s_storageClassName, copyNb, s_tapePoolName, diff --git a/tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp b/tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp index ac371d79d0..49e4dcacd5 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp @@ -295,8 +295,9 @@ public: const std::string tapePoolComment = "Tape-pool comment"; const std::string vo = "vo"; const bool tapePoolEncryption = false; + const cta::optional<std::string> tapePoolSupply("value for the supply pool mechanism"); ASSERT_NO_THROW(catalogue.createTapePool(s_adminOnAdminHost, s_tapePoolName, vo, nbPartialTapes, tapePoolEncryption, - tapePoolComment)); + tapePoolSupply, tapePoolComment)); const uint32_t copyNb = 1; const std::string archiveRouteComment = "Archive-route comment"; catalogue.createArchiveRoute(s_adminOnAdminHost, s_diskInstance, s_storageClassName, copyNb, s_tapePoolName, diff --git a/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPackerTest.cpp b/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPackerTest.cpp index 297d99caa0..a233c8d7f0 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPackerTest.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPackerTest.cpp @@ -118,6 +118,7 @@ namespace unitTests { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -125,7 +126,7 @@ namespace unitTests { cta::common::dataStructures::SecurityIdentity admin = cta::common::dataStructures::SecurityIdentity("admin","localhost"); m_catalogue->createLogicalLibrary(admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(admin, tapePoolName, vo, 2, true, "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, disabledValue, fullValue, createTapeComment); @@ -264,6 +265,9 @@ namespace unitTests { const std::string logicalLibraryName = "logical_library_name"; const std::string tapePoolName = "tape_pool_name"; const std::string vo = "vo"; + const uint64_t nbPartialTapes = 2; + const bool isEncrypted = true; + const cta::optional<std::string> supply("value for the supply pool mechanism"); const uint64_t capacityInBytes = (uint64_t)10 * 1000 * 1000 * 1000 * 1000; const bool disabledValue = true; const bool fullValue = false; @@ -271,7 +275,7 @@ namespace unitTests { cta::common::dataStructures::SecurityIdentity admin = cta::common::dataStructures::SecurityIdentity("admin","localhost"); m_catalogue->createLogicalLibrary(admin, logicalLibraryName, "Create logical library"); - m_catalogue->createTapePool(admin, tapePoolName, vo, 2, true, "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, disabledValue, fullValue, createTapeComment); diff --git a/xroot_plugins/XrdSsiCtaRequestMessage.cpp b/xroot_plugins/XrdSsiCtaRequestMessage.cpp index 6748f41cd2..e0be2a9f84 100644 --- a/xroot_plugins/XrdSsiCtaRequestMessage.cpp +++ b/xroot_plugins/XrdSsiCtaRequestMessage.cpp @@ -2049,8 +2049,9 @@ void RequestMessage::processTapePool_Add(const cta::admin::AdminCmd &admincmd, c auto &ptn = getRequired(OptionUInt64::PARTIAL_TAPES_NUMBER); auto &comment = getRequired(OptionString::COMMENT); auto &encrypted = getRequired(OptionBoolean::ENCRYPTED); + const cta::optional<std::string> supply("TBD"); - m_catalogue.createTapePool(m_cliIdentity, name, vo, ptn, encrypted, comment); + m_catalogue.createTapePool(m_cliIdentity, name, vo, ptn, encrypted, supply, comment); response.set_type(cta::xrd::Response::RSP_SUCCESS); } -- GitLab