Commit 541d2336 authored by Steven Murray's avatar Steven Murray
Browse files

bug #82673: RFE: Tapebridged and rtcpd should support buffered tape-marks over multiple files

The tapebridged daemon now determines and sends the values of the following
three CASTOR configuration parameters to the rtcpd daemon:

TAPEBRIDGE USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES false
TAPEBRIDGE MAXBYTESBEFOREFLUSH 8589934592
TAPEBRIDGE MAXFILESBEFOREFLUSH 100

Please note that the support for buffered tape-marks over multiple files has
NOT been implemented.  On top of this, lines 91 to 109 inclusive of the file
named rtcopy/rtcpd_GetClientInfo.c prevent buffered tape-marks over multiple
files from even trying to start and these lines create an error message that
explicitly tells the user that buffered tape-marks over multiple files is not
supported.

 91   /* This version of rtcpd does NOT support buffered tape-marks over */
 92   /* multiple files                                                  */
 93   if(*clientIsTapeBridge &&
 94     tapeBridgeClientInfo2MsgBody->useBufferedTapeMarksOverMultipleFiles) {
 95     char dummyErrbuf[32]; /* For fire and forget */
 96     char *const ackMsg =
 97       "Buffered tape-marks over multiple files is not supported";
 98   
 99     /* Fire and forget negative acknowledgement to VDQM or tape-bridge */
100     rtcpd_SendAckToVdqmOrTapeBridge(connSock, netTimeout, msgHdr.reqtype, -1    , 
101       ackMsg, dummyErrbuf, sizeof(dummyErrbuf));
102 
103     snprintf(errBuf, errBufLen, "%s()"
104       ": %s",
105       __FUNCTION__, ackMsg);
106     errBuf[errBufLen - 1] = '\0';
107     serrno = ENOTSUP;
108     return(-1);
109   }
parent ee06c0e7
......@@ -128,23 +128,41 @@ namespace tapebridge {
/**
* The compile-time default value of the tapebridged configuration parameter
* named TAPEBRIDGED/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES.
* named TAPEBRIDGE/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES.
*
* The value of this parameter defines whether or not the tapebridged and
* rtcpd daemons will use buffered tape-marks over multiple files when
* migrating data to tape.
*/
const bool TAPEBRIDGED_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES = false;
const bool TAPEBRIDGE_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES = false;
/**
* The compile-time default value of the maximum number of bytes to be
* written to tape before a flush to tape. Please note that a flush occurs
* on a file boundary therefore more bytes will normally be written to tape
* before the actual flush occurs.
* The compile-time default value of the tapebridged configuration parameter
* named TAPEBRIDGE/MAXBYTESBEFOREFLUSH.
*
* The value of this parameter defines the maximum number of bytes to be
* written to tape before a flush to tape (synchronised tape-mark). Please
* note that a flush occurs on a file boundary therefore more bytes will
* normally be written to tape before the actual flush occurs.
*
* The value of this parameter is used when buffered tape-marks are being
* used over multiple files as defined by the parameter named
* TAPEBRIDGE/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES.
*/
const uint64_t TAPEBRIDGED_MAXBYTESBEFOREFLUSH = 8589934592ULL; // 8 GB
const uint64_t TAPEBRIDGE_MAXBYTESBEFOREFLUSH = 8589934592ULL; // 8 GiB
/**
* The compile-time default value of the maximum number of files to be
* written to tape before a flush to tape.
*/
const uint64_t TAPEBRIDGED_MAXFILESBEFOREFLUSH = 100;
* The compile-time default value of the tapebridged configuration parameter
* named TAPEBRIDGE/MAXFILESBEFOREFLUSH.
*
* The value of this parameter defines the maximum number of files to be
* written to tape before a flush to tape (synchronised tape-mark).
*
* The value of this parameter is used when buffered tape-marks are being
* used over multiple files as defined by the parameter named
* TAPEBRIDGE/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES.
*/
const uint64_t TAPEBRIDGE_MAXFILESBEFOREFLUSH = 100;
} // namespace tapebridge
} // namespace tape
......
......@@ -127,7 +127,6 @@ void castor::tape::tapebridge::VdqmRequestHandler::run(void *param)
param = NULL; /* Will cause a segementation fault if used by accident */
}
/*
// Determine whether or not buffered tape-marks should be used over multiple
// files
ConfigParamAndSource<bool> useBufferedTapeMarksOverMultipleFiles("UNKNOWN",
......@@ -208,7 +207,7 @@ void castor::tape::tapebridge::VdqmRequestHandler::run(void *param)
castor::dlf::dlf_writep(cuuid, DLF_LVL_SYSTEM, TAPEBRIDGE_CONFIG_PARAM,
params);
}
*/
// Job request to be received from VDQM
legacymsg::RtcpJobRqstMsgBody jobRequest;
utils::setBytes(jobRequest, '\0');
......@@ -371,9 +370,10 @@ void castor::tape::tapebridge::VdqmRequestHandler::run(void *param)
clientInfoMsgBody.bridgeClientCallbackPort = jobRequest.clientPort;
clientInfoMsgBody.clientUID = jobRequest.clientEuid;
clientInfoMsgBody.clientGID = jobRequest.clientEgid;
clientInfoMsgBody.useBufferedTapeMarksOverMultipleFiles = 0;
clientInfoMsgBody.maxBytesBeforeFlush = (uint64_t)0;
clientInfoMsgBody.maxFilesBeforeFlush = (uint64_t)0;
clientInfoMsgBody.useBufferedTapeMarksOverMultipleFiles =
useBufferedTapeMarksOverMultipleFiles.value ? 1 : 0;
clientInfoMsgBody.maxBytesBeforeFlush = maxBytesBeforeFlush.value;
clientInfoMsgBody.maxFilesBeforeFlush = maxFilesBeforeFlush.value;
utils::copyString(clientInfoMsgBody.bridgeHost, bridgeCallbackHost);
utils::copyString(clientInfoMsgBody.bridgeClientHost,
jobRequest.clientHost);
......@@ -717,14 +717,14 @@ castor::tape::tapebridge::ConfigParamAndSource<bool>
getUseBufferedTapeMarksOverMultipleFiles()
throw(castor::exception::Exception) {
const std::string paramName =
"TAPEBRIDGED/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES";
"TAPEBRIDGE/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES";
const char *paramCStr = NULL;
uint32_t paramBool = false;
std::string paramSource = "UNKNOWN";
// Try to get the number of disk-IO threads from the environment variables
if(NULL != (paramCStr = getenv(
"TAPEBRIDGED_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES"))) {
"TAPEBRIDGE_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES"))) {
paramSource = "environment variable";
std::string paramUpperCaseStr = paramCStr;
......@@ -744,7 +744,7 @@ castor::tape::tapebridge::ConfigParamAndSource<bool>
}
// Else try to get the number of disk IO threads of castor.conf
} else if(NULL != (paramCStr = getconfent("TAPEBRIDGED",
} else if(NULL != (paramCStr = getconfent("TAPEBRIDGE",
"USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES", 0))) {
paramSource = "castor.conf";
......@@ -767,7 +767,7 @@ castor::tape::tapebridge::ConfigParamAndSource<bool>
// Else use the compile-time default
} else {
paramSource = "compile-time default";
paramBool = TAPEBRIDGED_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES;
paramBool = TAPEBRIDGE_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES;
}
return ConfigParamAndSource<bool>(paramName, paramBool, paramSource);
......@@ -780,13 +780,13 @@ castor::tape::tapebridge::ConfigParamAndSource<bool>
castor::tape::tapebridge::ConfigParamAndSource<uint64_t>
castor::tape::tapebridge::VdqmRequestHandler::getMaxBytesBeforeFlush()
throw(castor::exception::Exception) {
const std::string paramName = "TAPEBRIDGED/MAXBYTESBEFOREFLUSH";
const std::string paramName = "TAPEBRIDGE/MAXBYTESBEFOREFLUSH";
const char *paramCStr = NULL;
uint64_t paramUInt64 = 0;
std::string paramSource = "UNKNOWN";
// Try to get the required value from the environment variables
if(NULL != (paramCStr = getenv("TAPEBRIDGED_MAXBYTESBEFOREFLUSH"))) {
if(NULL != (paramCStr = getenv("TAPEBRIDGE_MAXBYTESBEFOREFLUSH"))) {
paramSource = "environment variable";
if(!utils::isValidUInt(paramCStr)) {
......@@ -802,7 +802,7 @@ castor::tape::tapebridge::ConfigParamAndSource<uint64_t>
paramUInt64 = strtou64(paramCStr);
// Else try to get the required value from castor.conf
} else if(NULL != (paramCStr = getconfent("TAPEBRIDGED",
} else if(NULL != (paramCStr = getconfent("TAPEBRIDGE",
"MAXBYTESBEFOREFLUSH", 0))) {
paramSource = "castor.conf";
......@@ -821,7 +821,7 @@ castor::tape::tapebridge::ConfigParamAndSource<uint64_t>
// Else use the compile-time default
} else {
paramSource = "compile-time default";
paramUInt64 = TAPEBRIDGED_MAXBYTESBEFOREFLUSH;
paramUInt64 = TAPEBRIDGE_MAXBYTESBEFOREFLUSH;
}
return ConfigParamAndSource<uint64_t>(paramName, paramUInt64, paramSource);
......@@ -834,13 +834,13 @@ castor::tape::tapebridge::ConfigParamAndSource<uint64_t>
castor::tape::tapebridge::ConfigParamAndSource<uint64_t>
castor::tape::tapebridge::VdqmRequestHandler::getMaxFilesBeforeFlush()
throw(castor::exception::Exception) {
const std::string paramName = "TAPEBRIDGED/MAXFILESBEFOREFLUSH";
const std::string paramName = "TAPEBRIDGE/MAXFILESBEFOREFLUSH";
const char *paramCStr = NULL;
uint64_t paramUInt64 = 0;
std::string paramSource = "UNKNOWN";
// Try to get the required value from the environment variables
if(NULL != (paramCStr = getenv("TAPEBRIDGED_MAXFILESBEFOREFLUSH"))) {
if(NULL != (paramCStr = getenv("TAPEBRIDGE_MAXFILESBEFOREFLUSH"))) {
paramSource = "environment variable";
if(!utils::isValidUInt(paramCStr)) {
......@@ -856,7 +856,7 @@ castor::tape::tapebridge::ConfigParamAndSource<uint64_t>
paramUInt64 = strtou64(paramCStr);
// Else try to get the required value from castor.conf
} else if(NULL != (paramCStr = getconfent("TAPEBRIDGED",
} else if(NULL != (paramCStr = getconfent("TAPEBRIDGE",
"MAXFILESBEFOREFLUSH", 0))) {
paramSource = "castor.conf";
......@@ -875,7 +875,7 @@ castor::tape::tapebridge::ConfigParamAndSource<uint64_t>
// Else use the compile-time default
} else {
paramSource = "compile-time default";
paramUInt64 = TAPEBRIDGED_MAXFILESBEFOREFLUSH;
paramUInt64 = TAPEBRIDGE_MAXFILESBEFOREFLUSH;
}
return ConfigParamAndSource<uint64_t>(paramName, paramUInt64, paramSource);
......
......@@ -901,27 +901,60 @@ TAPEGATEWAY REC_RETRY_POLICY recallRetry
## Tape Bridge ######################################################################
# The port on which the tapebridge will listen for RTCOPY jobs from the VDQM.
# The default is 5070. A value other than the default should NOT normally be
# used.
#
# The default value of this parameter is 5070. A value other than the default
# should NOT normally be used.
TAPEBRIDGE VDQMPORT 5070
# The inclusive low port of the tapebridge's RTCPD callback port number range.
# The default is 30101.
#
# The default value of this parameter is 30101.
TAPEBRIDGE RTCPDLOWPORT 30101
# The inclusive high port of the tapebridge's RTCPD callback port number range.
# The default is 30200.
#
# The default value of this parameter is 30200.
TAPEBRIDGE RTCPDHIGHPORT 30200
# Case insensitive boolean value the defines defines whether or not the
# tapebridged and rtcpd daemons will use buffered tape-marks over multiple
# files when migrating data to tape.
#
# The default value of this parameter is false.
#TAPEBRIDGE USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES false
# The value of this parameter defines the maximum number of bytes to be written
# to tape before a flush to tape (synchronised tape-mark). Please note that a
# flush occurs on a file boundary therefore more bytes will normally be written
# to tape before the actual flush occurs.
#
# The value of this parameter is used when buffered tape-marks are being used
# over multiple files as defined by the parameter named
# TAPEBRIDGE/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES.
#
# The default value of this parameter is 8589934592 (8 GiB).
#TAPEBRIDGE MAXBYTESBEFOREFLUSH 8589934592
# The value of this parameter defines the maximum number of files to be written
# to tape before a flush to tape (synchronised tape-mark).
#
# The value of this parameter is used when buffered tape-marks are being used
# over multiple files as defined by the parameter named
# TAPEBRIDGE/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES.
#
# The default value of this parameter is 100.
#TAPEBRIDGE MAXFILESBEFOREFLUSH 100
## Tape Bridge Clients: dumptp, readtp and writetp ##################################
# The inclusive low port of the tapebridge client callback port number range.
# The default is 30201.
#
# The default value of this parameter is 30201.
#TAPEBRIDGECLIENT LOWPORT
# The inclusive high port of the tapebridge client callback port number range.
# The default is 30300.
#
# The default value of this parameter is 30300.
#TAPEBRIDGECLIENT HIGHPORT
......
......@@ -41,16 +41,16 @@ public:
void setUp() {
setenv("PATH_CONFIG", "/etc/castor/castor.conf", 1);
unsetenv("TAPEBRIDGED_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES");
unsetenv("TAPEBRIDGED_MAXBYTESBEFOREFLUSH");
unsetenv("TAPEBRIDGED_MAXFILESBEFOREFLUSH");
unsetenv("TAPEBRIDGE_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES");
unsetenv("TAPEBRIDGE_MAXBYTESBEFOREFLUSH");
unsetenv("TAPEBRIDGE_MAXFILESBEFOREFLUSH");
}
void tearDown() {
setenv("PATH_CONFIG", "/etc/castor/castor.conf", 1);
unsetenv("TAPEBRIDGED_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES");
unsetenv("TAPEBRIDGED_MAXBYTESBEFOREFLUSH");
unsetenv("TAPEBRIDGED_MAXFILESBEFOREFLUSH");
unsetenv("TAPEBRIDGE_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES");
unsetenv("TAPEBRIDGE_MAXBYTESBEFOREFLUSH");
unsetenv("TAPEBRIDGE_MAXFILESBEFOREFLUSH");
}
void testGetUseBufferedTapeMarksOverMultipleFilesInvalidEnv() {
......@@ -61,9 +61,9 @@ public:
"UNKNOWN SOURCE");
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"setenv TAPEBRIDGED_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES",
"setenv TAPEBRIDGE_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES",
0,
setenv("TAPEBRIDGED_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES",
setenv("TAPEBRIDGE_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES",
"INVALID_BOOL_VALUE", 1));
CPPUNIT_ASSERT_THROW_MESSAGE("Invalid environment variable",
......@@ -80,7 +80,7 @@ public:
}
CPPUNIT_ASSERT_EQUAL_MESSAGE("exceptionMsg",
std::string("Configuration parameter is not a valid unsigned integer:"
" name=TAPEBRIDGED/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES"
" name=TAPEBRIDGE/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES"
" value=INVALID_BOOL_VALUE"
" source=environment variable"),
exceptionMsg);
......@@ -94,9 +94,9 @@ public:
"UNKNOWN SOURCE");
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"setenv TAPEBRIDGED_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES",
"setenv TAPEBRIDGE_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES",
0,
setenv("TAPEBRIDGED_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES", "true", 1));
setenv("TAPEBRIDGE_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES", "true", 1));
CPPUNIT_ASSERT_NO_THROW_MESSAGE(
"getUseBufferedTapeMarksOverMultipleFiles",
......@@ -104,7 +104,7 @@ public:
handler.getUseBufferedTapeMarksOverMultipleFiles());
CPPUNIT_ASSERT_EQUAL_MESSAGE("useBufferedTapeMarksOverMultipleFiles.name",
std::string("TAPEBRIDGED/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES"),
std::string("TAPEBRIDGE/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES"),
useBufferedTapeMarksOverMultipleFiles.name);
CPPUNIT_ASSERT_EQUAL_MESSAGE("useBufferedTapeMarksOverMultipleFiles.value",
......@@ -124,9 +124,9 @@ public:
"UNKNOWN SOURCE");
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"setenv TAPEBRIDGED_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES",
"setenv TAPEBRIDGE_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES",
0,
setenv("TAPEBRIDGED_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES", "false", 1));
setenv("TAPEBRIDGE_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES", "false", 1));
CPPUNIT_ASSERT_NO_THROW_MESSAGE(
"getUseBufferedTapeMarksOverMultipleFiles",
......@@ -134,7 +134,7 @@ public:
handler.getUseBufferedTapeMarksOverMultipleFiles());
CPPUNIT_ASSERT_EQUAL_MESSAGE("useBufferedTapeMarksOverMultipleFiles.name",
std::string("TAPEBRIDGED/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES"),
std::string("TAPEBRIDGE/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES"),
useBufferedTapeMarksOverMultipleFiles.name);
CPPUNIT_ASSERT_EQUAL_MESSAGE("useBufferedTapeMarksOverMultipleFiles.value",
......@@ -163,12 +163,12 @@ public:
handler.getUseBufferedTapeMarksOverMultipleFiles());
CPPUNIT_ASSERT_EQUAL_MESSAGE("useBufferedTapeMarksOverMultipleFiles.name",
std::string("TAPEBRIDGED/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES"),
std::string("TAPEBRIDGE/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES"),
useBufferedTapeMarksOverMultipleFiles.name);
CPPUNIT_ASSERT_EQUAL_MESSAGE("useBufferedTapeMarksOverMultipleFiles.value",
castor::tape::tapebridge::
TAPEBRIDGED_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES,
TAPEBRIDGE_USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES,
useBufferedTapeMarksOverMultipleFiles.value);
CPPUNIT_ASSERT_EQUAL_MESSAGE("useBufferedTapeMarksOverMultipleFiles.source",
......@@ -202,7 +202,7 @@ public:
}
CPPUNIT_ASSERT_EQUAL_MESSAGE("exceptionMsg",
std::string("Configuration parameter is not a valid unsigned integer:"
" name=TAPEBRIDGED/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES"
" name=TAPEBRIDGE/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES"
" value=INVALID_BOOL_VALUE"
" source=castor.conf"),
exceptionMsg);
......@@ -226,7 +226,7 @@ public:
handler.getUseBufferedTapeMarksOverMultipleFiles());
CPPUNIT_ASSERT_EQUAL_MESSAGE("useBufferedTapeMarksOverMultipleFiles.name",
std::string("TAPEBRIDGED/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES"),
std::string("TAPEBRIDGE/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES"),
useBufferedTapeMarksOverMultipleFiles.name);
CPPUNIT_ASSERT_EQUAL_MESSAGE("useBufferedTapeMarksOverMultipleFiles.value",
......@@ -256,7 +256,7 @@ public:
handler.getUseBufferedTapeMarksOverMultipleFiles());
CPPUNIT_ASSERT_EQUAL_MESSAGE("useBufferedTapeMarksOverMultipleFiles.name",
std::string("TAPEBRIDGED/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES"),
std::string("TAPEBRIDGE/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES"),
useBufferedTapeMarksOverMultipleFiles.name);
CPPUNIT_ASSERT_EQUAL_MESSAGE("useBufferedTapeMarksOverMultipleFiles.value",
......@@ -274,9 +274,9 @@ public:
castor::tape::tapebridge::ConfigParamAndSource<uint64_t>
maxBytesBeforeFlush("UNKNOWN NAME", 0, "UNKNOWN SOURCE");
CPPUNIT_ASSERT_EQUAL_MESSAGE("setenv TAPEBRIDGED_MAXBYTESBEFOREFLUSH",
CPPUNIT_ASSERT_EQUAL_MESSAGE("setenv TAPEBRIDGE_MAXBYTESBEFOREFLUSH",
0,
setenv("TAPEBRIDGED_MAXBYTESBEFOREFLUSH", "INVALID_UINT_VALUE", 1));
setenv("TAPEBRIDGE_MAXBYTESBEFOREFLUSH", "INVALID_UINT_VALUE", 1));
CPPUNIT_ASSERT_THROW_MESSAGE("Invalid environment variable",
maxBytesBeforeFlush = handler.getMaxBytesBeforeFlush(),
......@@ -290,7 +290,7 @@ public:
}
CPPUNIT_ASSERT_EQUAL_MESSAGE("exceptionMsg",
std::string("Configuration parameter is not a valid unsigned integer:"
" name=TAPEBRIDGED/MAXBYTESBEFOREFLUSH"
" name=TAPEBRIDGE/MAXBYTESBEFOREFLUSH"
" value=INVALID_UINT_VALUE"
" source=environment variable"),
exceptionMsg);
......@@ -302,16 +302,16 @@ public:
castor::tape::tapebridge::ConfigParamAndSource<uint64_t>
maxBytesBeforeFlush("UNKNOWN NAME", 0, "UNKNOWN SOURCE");
CPPUNIT_ASSERT_EQUAL_MESSAGE("setenv TAPEBRIDGED_MAXBYTESBEFOREFLUSH",
CPPUNIT_ASSERT_EQUAL_MESSAGE("setenv TAPEBRIDGE_MAXBYTESBEFOREFLUSH",
0,
setenv("TAPEBRIDGED_MAXBYTESBEFOREFLUSH", "11111", 1));
setenv("TAPEBRIDGE_MAXBYTESBEFOREFLUSH", "11111", 1));
CPPUNIT_ASSERT_NO_THROW_MESSAGE(
"getMaxBytesBeforeFlush",
maxBytesBeforeFlush = handler.getMaxBytesBeforeFlush());
CPPUNIT_ASSERT_EQUAL_MESSAGE("getMaxBytesBeforeFlush.name",
std::string("TAPEBRIDGED/MAXBYTESBEFOREFLUSH"),
std::string("TAPEBRIDGE/MAXBYTESBEFOREFLUSH"),
maxBytesBeforeFlush.name);
CPPUNIT_ASSERT_EQUAL_MESSAGE("maxBytesBeforeFlush.value",
......@@ -337,12 +337,12 @@ public:
maxBytesBeforeFlush = handler.getMaxBytesBeforeFlush());
CPPUNIT_ASSERT_EQUAL_MESSAGE("maxBytesBeforeFlush.name",
std::string("TAPEBRIDGED/MAXBYTESBEFOREFLUSH"),
std::string("TAPEBRIDGE/MAXBYTESBEFOREFLUSH"),
maxBytesBeforeFlush.name);
CPPUNIT_ASSERT_EQUAL_MESSAGE("maxBytesBeforeFlush.value",
castor::tape::tapebridge::
TAPEBRIDGED_MAXBYTESBEFOREFLUSH,
TAPEBRIDGE_MAXBYTESBEFOREFLUSH,
maxBytesBeforeFlush.value);
CPPUNIT_ASSERT_EQUAL_MESSAGE("maxBytesBeforeFlush.source",
......@@ -372,7 +372,7 @@ public:
}
CPPUNIT_ASSERT_EQUAL_MESSAGE("exceptionMsg",
std::string("Configuration parameter is not a valid unsigned integer:"
" name=TAPEBRIDGED/MAXBYTESBEFOREFLUSH"
" name=TAPEBRIDGE/MAXBYTESBEFOREFLUSH"
" value=INVALID_UINT_VALUE"
" source=castor.conf"),
exceptionMsg);
......@@ -393,7 +393,7 @@ public:
maxBytesBeforeFlush = handler.getMaxBytesBeforeFlush());
CPPUNIT_ASSERT_EQUAL_MESSAGE("maxBytesBeforeFlush.name",
std::string("TAPEBRIDGED/MAXBYTESBEFOREFLUSH"),
std::string("TAPEBRIDGE/MAXBYTESBEFOREFLUSH"),
maxBytesBeforeFlush.name);
CPPUNIT_ASSERT_EQUAL_MESSAGE("maxBytesBeforeFlush.value",
......@@ -411,9 +411,9 @@ public:
castor::tape::tapebridge::ConfigParamAndSource<uint64_t>
maxFilesBeforeFlush("UNKNOWN NAME", 0, "UNKNOWN SOURCE");
CPPUNIT_ASSERT_EQUAL_MESSAGE("setenv TAPEBRIDGED_MAXFILESBEFOREFLUSH",
CPPUNIT_ASSERT_EQUAL_MESSAGE("setenv TAPEBRIDGE_MAXFILESBEFOREFLUSH",
0,
setenv("TAPEBRIDGED_MAXFILESBEFOREFLUSH", "INVALID_UINT_VALUE", 1));
setenv("TAPEBRIDGE_MAXFILESBEFOREFLUSH", "INVALID_UINT_VALUE", 1));
CPPUNIT_ASSERT_THROW_MESSAGE("Invalid environment variable",
maxFilesBeforeFlush = handler.getMaxFilesBeforeFlush(),
......@@ -427,7 +427,7 @@ public:
}
CPPUNIT_ASSERT_EQUAL_MESSAGE("exceptionMsg",
std::string("Configuration parameter is not a valid unsigned integer:"
" name=TAPEBRIDGED/MAXFILESBEFOREFLUSH"
" name=TAPEBRIDGE/MAXFILESBEFOREFLUSH"
" value=INVALID_UINT_VALUE"
" source=environment variable"),
exceptionMsg);
......@@ -439,16 +439,16 @@ public:
castor::tape::tapebridge::ConfigParamAndSource<uint64_t>
maxFilesBeforeFlush("UNKNOWN NAME", 0, "UNKNOWN SOURCE");
CPPUNIT_ASSERT_EQUAL_MESSAGE("setenv TAPEBRIDGED_MAXFILESBEFOREFLUSH",
CPPUNIT_ASSERT_EQUAL_MESSAGE("setenv TAPEBRIDGE_MAXFILESBEFOREFLUSH",
0,
setenv("TAPEBRIDGED_MAXFILESBEFOREFLUSH", "11111", 1));
setenv("TAPEBRIDGE_MAXFILESBEFOREFLUSH", "11111", 1));
CPPUNIT_ASSERT_NO_THROW_MESSAGE(
"getMaxFilesBeforeFlush",
maxFilesBeforeFlush = handler.getMaxFilesBeforeFlush());
CPPUNIT_ASSERT_EQUAL_MESSAGE("getMaxFilesBeforeFlush.name",
std::string("TAPEBRIDGED/MAXFILESBEFOREFLUSH"),
std::string("TAPEBRIDGE/MAXFILESBEFOREFLUSH"),
maxFilesBeforeFlush.name);
CPPUNIT_ASSERT_EQUAL_MESSAGE("maxFilesBeforeFlush.value",
......@@ -474,12 +474,12 @@ public:
maxFilesBeforeFlush = handler.getMaxFilesBeforeFlush());
CPPUNIT_ASSERT_EQUAL_MESSAGE("maxFilesBeforeFlush.name",
std::string("TAPEBRIDGED/MAXFILESBEFOREFLUSH"),
std::string("TAPEBRIDGE/MAXFILESBEFOREFLUSH"),
maxFilesBeforeFlush.name);
CPPUNIT_ASSERT_EQUAL_MESSAGE("maxFilesBeforeFlush.value",
castor::tape::tapebridge::
TAPEBRIDGED_MAXFILESBEFOREFLUSH,
TAPEBRIDGE_MAXFILESBEFOREFLUSH,
maxFilesBeforeFlush.value);
CPPUNIT_ASSERT_EQUAL_MESSAGE("maxFilesBeforeFlush.source",
......@@ -509,7 +509,7 @@ public:
}
CPPUNIT_ASSERT_EQUAL_MESSAGE("exceptionMsg",
std::string("Configuration parameter is not a valid unsigned integer:"
" name=TAPEBRIDGED/MAXFILESBEFOREFLUSH"
" name=TAPEBRIDGE/MAXFILESBEFOREFLUSH"
" value=INVALID_UINT_VALUE"
" source=castor.conf"),
exceptionMsg);
......@@ -530,7 +530,7 @@ public:
maxFilesBeforeFlush = handler.getMaxFilesBeforeFlush());
CPPUNIT_ASSERT_EQUAL_MESSAGE("maxFilesBeforeFlush.name",
std::string("TAPEBRIDGED/MAXFILESBEFOREFLUSH"),
std::string("TAPEBRIDGE/MAXFILESBEFOREFLUSH"),
maxFilesBeforeFlush.name);
CPPUNIT_ASSERT_EQUAL_MESSAGE("maxFilesBeforeFlush.value",
......
TAPEBRIDGED MAXBYTESBEFOREFLUSH 33333
TAPEBRIDGE MAXBYTESBEFOREFLUSH 33333
TAPEBRIDGED MAXBYTESBEFOREFLUSH INVALID_UINT_VALUE
TAPEBRIDGE MAXBYTESBEFOREFLUSH INVALID_UINT_VALUE
TAPEBRIDGED MAXFILESBEFOREFLUSH 44444
TAPEBRIDGE MAXFILESBEFOREFLUSH 44444
TAPEBRIDGED MAXFILESBEFOREFLUSH INVALID_UINT_VALUE
TAPEBRIDGE MAXFILESBEFOREFLUSH INVALID_UINT_VALUE
TAPEBRIDGED USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES false
TAPEBRIDGE USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES false
TAPEBRIDGED USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES true
TAPEBRIDGE USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES true
TAPEBRIDGED USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES INVALID_BOOL_VALUE
TAPEBRIDGE USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES INVALID_BOOL_VALUE
......@@ -270,7 +270,7 @@ testrtcpdtape: \
tape_usrmsg.o \
tape_sendrep.o \
tape_getcompstat.o \
tapebridge_sendTapeBridgeAck.o \
tapebridge_sendTapeBridgeClientInfo2Ack.o \
tapebridge_marshall.o \
test_rtcpd_Tape.o \
upv_Cupv_check.o \
......@@ -737,8 +737,8 @@ rtcpd_TapeFileWaitingForFlushList.c: \
h/rtcpd_TapeFileWaitingForFlushList.h
touch $@
tapebridge_sendTapeBridgeAck.o: \
$(ROOT_DIR)/tapebridge/tapebridge_sendTapeBridgeAck.c
tapebridge_sendTapeBridgeClientInfo2Ack.o: \
$(ROOT_DIR)/tapebridge/tapebridge_sendTapeBridgeClientInfo2Ack.c
gcc $(COMMON_OPS) -c $(INCLUDE_OPS) -o $@ $^
tapebridge_marshall.o: $(ROOT_DIR)/tapebridge/tapebridge_marshall.c
......
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