Commit 5fe8b842 authored by Daniele Kruse's avatar Daniele Kruse
Browse files

Fixed 1 more test cases of castor_tape_tapeserver_daemon_DataTransferSessionTest

parent f2c15c79
......@@ -111,8 +111,6 @@ These are the commands that only administrators are allowed to use to operate CT
\item cta ll/logicallibrary
\item cta ta/tape
\item cta sc/storageclass{\normalfont \footnote{storage classes should be as static as possible, no change nor deletion if there is at least 1 directory using it}}
\item cta loa/listongoingarchives
\item cta lor/listongoingretrieves
\item cta lpa/listpendingarchives
\item cta lpr/listpendingretrieves
\item cta lds/listdrivestates{\normalfont \footnote{more or less the ``drive'' part of the current showqueues -x}}
......
......@@ -647,6 +647,20 @@ TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessio
// List to remember the path of each remote file so that the existance of the
// files can be tested for at the end of the test
std::list<std::string> remoteFilePaths;
// 5) Create the tapepool, library and tape for the scheduler.
// Make mounts immediate.
ASSERT_NO_THROW(scheduler.createAdminUserWithoutAuthorizingRequester(requester, requester.getUser(), ""));
ASSERT_NO_THROW(scheduler.createAdminHostWithoutAuthorizingRequester(requester, requester.getHost(), ""));
ASSERT_NO_THROW(scheduler.createTapePool(requester, "TapePool", 1, ""));
cta::MountCriteria immediateMount;
immediateMount.maxAge = 0;
immediateMount.maxBytesQueued = 1;
immediateMount.maxFilesQueued = 1;
immediateMount.quota = 10;
ASSERT_NO_THROW(scheduler.setTapePoolMountCriteria("TapePool", cta::MountCriteriaByDirection(immediateMount, immediateMount)));
ASSERT_NO_THROW(scheduler.createLogicalLibrary(requester, "T10KD6", ""));
ASSERT_NO_THROW(scheduler.createTape(requester, "V12345", "T10KD6", "TapePool", 10*1000*1000, "8000GC", ""));
//delete is unnecessary
//pointer with ownership will be passed to the application,
......@@ -674,14 +688,14 @@ TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessio
for (int fseq=1; fseq <= 10 ; fseq ++) {
// Create a path to a remote destination file
std::ostringstream remoteFilePath;
remoteFilePath << "file:" << m_tmpDir << "/test" << fseq;
remoteFilePath << "file://" << m_tmpDir << "/test" << fseq;
remoteFilePaths.push_back(remoteFilePath.str());
// Create an archive file entry in the archive namespace
std::ostringstream archiveFilePath;
archiveFilePath << "/test" << fseq;
const mode_t archiveFileMode = 0655;
const uint64_t archiveFileSize = 256*1024;
const uint64_t archiveFileSize = 1000;
ASSERT_NO_THROW(ns.createFile(
requester,
archiveFilePath.str(),
......@@ -723,7 +737,7 @@ TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessio
// Schedule the retrieval of the file
std::list<std::string> archiveFilePaths;
archiveFilePaths.push_back(archiveFilePath.str());
ASSERT_NO_THROW(scheduler. queueRetrieveRequest(
ASSERT_NO_THROW(scheduler.queueRetrieveRequest(
requester,
archiveFilePaths,
remoteFilePath.str()));
......@@ -746,8 +760,7 @@ TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessio
driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
ASSERT_NO_THROW(sess.execute());
std::string temp = logger.getLog();
temp += "";
ASSERT_EQ("V12345", sess.getVid());
ASSERT_NE(std::string::npos, logger.getLog().find("Failed to mount the tape"));
}
TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessionEmptyOnVolReq) {
......
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