Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
60b1fe88
Commit
60b1fe88
authored
Oct 06, 2014
by
Steven Murray
Browse files
Added castor::mediachanger::MediaChangerProxy
parent
85f0440c
Changes
36
Hide whitespace changes
Inline
Side-by-side
castor/CMakeLists.txt
View file @
60b1fe88
...
...
@@ -27,6 +27,7 @@ add_subdirectory (legacymsg)
if
(
${
COMPILE_SERVER
}
STREQUAL
"1"
)
add_subdirectory
(
db
)
add_subdirectory
(
gc
)
add_subdirectory
(
mediachanger
)
add_subdirectory
(
messages
)
add_subdirectory
(
rh
)
add_subdirectory
(
scheduler
)
...
...
castor/legacymsg/CMakeLists.txt
View file @
60b1fe88
...
...
@@ -83,6 +83,9 @@ set (CASTOR_LEGACYMSG_LIB_SRC_FILES
VmgrTapeMountedMsgBody.cpp
)
add_library
(
castorlegacymsg SHARED
${
CASTOR_LEGACYMSG_LIB_SRC_FILES
}
)
CastorSetLibraryVersions
(
castorlegacymsg
)
target_link_libraries
(
castorlegacymsg castorclient castorcommon
)
target_link_libraries
(
castorlegacymsg
castorclient
castorcommon
castormediachangerclient
)
install
(
TARGETS castorlegacymsg LIBRARY DESTINATION
${
CASTOR_DEST_LIB_DIR
}
NAMELINK_SKIP
)
castor/legacymsg/RmcProxy.hpp
View file @
60b1fe88
...
...
@@ -22,7 +22,7 @@
#pragma once
#include
"castor/exception/Exception.hpp"
#include
"castor/
tape/utils/TapeLibrarySlot
.hpp"
#include
"castor/
mediachanger/MediaChangerProxy
.hpp"
#include
<string>
...
...
@@ -32,54 +32,43 @@ namespace legacymsg {
/**
* Proxy class representing the remote media-changer daemon.
*/
class
RmcProxy
{
class
RmcProxy
:
public
mediachanger
::
MediaChangerProxy
{
public:
/**
* Enumeration of the possible mount access-modes.
*/
enum
MountMode
{
MOUNT_MODE_READONLY
,
MOUNT_MODE_READWRITE
};
/**
*
Returns the string representation of the specified mount access-mode
.
*
Destructor
.
*/
const
char
*
mountMode2Str
(
const
MountMode
m
)
throw
()
{
switch
(
m
)
{
case
MOUNT_MODE_READONLY
:
return
"read only"
;
case
MOUNT_MODE_READWRITE
:
return
"read/write"
;
default:
return
"unknown"
;
}
}
virtual
~
RmcProxy
()
throw
()
=
0
;
/**
* Destructor.
* Requests the media changer to mount of the specified tape for read-only
* access into the drive in the specified library slot.
*
* @param vid The volume identifier of the tape.
* @param librarySlot The library slot containing the tape drive.
*/
virtual
~
RmcProxy
()
throw
()
=
0
;
virtual
void
mountTapeReadOnly
(
const
std
::
string
&
vid
,
const
mediachanger
::
TapeLibrarySlot
&
librarySlot
)
=
0
;
/**
*
Asks the remot
e media
-
changer
daemon
to mount the specified tape
into th
e
* drive in the specified library slot.
*
Requests th
e media
changer to mount
of
the specified tape
for read/writ
e
*
access into the
drive in the specified library slot.
*
* @param vid The volume identifier of the tape.
* @param librarySlot The tape library slot containing the tape drive.
* @param mode The access mode in which the specified tape should be mounted.
* Please note that the value of this parameter is honored in a best effort
* fashion. If the library and drive combination do not support specifying
* the access mode, then this parameter will be ignored.
* @param librarySlot The library slot containing the tape drive.
*/
virtual
void
mountTape
(
const
std
::
string
&
vid
,
const
tape
::
utils
::
TapeLibrarySlot
&
librarySlot
,
const
MountMode
mode
)
=
0
;
virtual
void
mountTape
ReadWrite
(
const
std
::
string
&
vid
,
const
mediachanger
::
TapeLibrarySlot
&
librarySlot
)
=
0
;
/**
*
Asks the remot
e media
-
changer
daemon
to
un
mount the specified tape f
rom th
e
* drive in the specified library slot.
*
Requests th
e media
changer to mount
of
the specified tape f
or read/writ
e
*
access into the
drive in the specified library slot.
*
* @param vid The volume identifier of the tape.
* @param librarySlot The
tape
library slot containing the tape drive.
* @param librarySlot The library slot containing the tape drive.
*/
virtual
void
un
mountTape
(
const
std
::
string
&
vid
,
const
tape
::
utils
::
TapeLibrarySlot
&
librarySlot
)
=
0
;
virtual
void
dis
mountTape
(
const
std
::
string
&
vid
,
const
mediachanger
::
TapeLibrarySlot
&
librarySlot
)
=
0
;
};
// class RmcProxy
...
...
castor/legacymsg/RmcProxyTcpIp.cpp
View file @
60b1fe88
...
...
@@ -46,10 +46,19 @@ castor::legacymsg::RmcProxyTcpIp::~RmcProxyTcpIp() throw() {
}
//------------------------------------------------------------------------------
// mountTape
// mountTape
ReadOnly
//------------------------------------------------------------------------------
void
castor
::
legacymsg
::
RmcProxyTcpIp
::
mountTape
(
const
std
::
string
&
vid
,
const
tape
::
utils
::
TapeLibrarySlot
&
librarySlot
,
const
MountMode
mode
)
{
void
castor
::
legacymsg
::
RmcProxyTcpIp
::
mountTapeReadOnly
(
const
std
::
string
&
vid
,
const
mediachanger
::
TapeLibrarySlot
&
librarySlot
)
{
// SCSI does not support read-only mounts
mountTapeReadWrite
(
vid
,
librarySlot
);
}
//------------------------------------------------------------------------------
// mountTapeReadWrite
//------------------------------------------------------------------------------
void
castor
::
legacymsg
::
RmcProxyTcpIp
::
mountTapeReadWrite
(
const
std
::
string
&
vid
,
const
mediachanger
::
TapeLibrarySlot
&
librarySlot
)
{
// Verify parameters
if
(
vid
.
empty
())
{
castor
::
exception
::
Exception
ex
;
...
...
@@ -66,13 +75,13 @@ void castor::legacymsg::RmcProxyTcpIp::mountTape(const std::string &vid,
// Dispatch the appropriate helper method depending on library slot type
switch
(
librarySlot
.
getLibraryType
())
{
case
tape
::
utils
::
TAPE_LIBRARY_TYPE_ACS
:
case
mediachanger
::
TAPE_LIBRARY_TYPE_ACS
:
mountTapeAcs
(
vid
,
librarySlot
.
str
());
break
;
case
tape
::
utils
::
TAPE_LIBRARY_TYPE_MANUAL
:
case
mediachanger
::
TAPE_LIBRARY_TYPE_MANUAL
:
mountTapeManual
(
vid
);
break
;
case
tape
::
utils
::
TAPE_LIBRARY_TYPE_SCSI
:
case
mediachanger
::
TAPE_LIBRARY_TYPE_SCSI
:
mountTapeScsi
(
vid
,
librarySlot
.
str
());
break
;
default:
...
...
@@ -160,10 +169,10 @@ void castor::legacymsg::RmcProxyTcpIp::mountTapeScsi(const std::string &vid,
}
//------------------------------------------------------------------------------
//
un
mountTape
//
dis
mountTape
//------------------------------------------------------------------------------
void
castor
::
legacymsg
::
RmcProxyTcpIp
::
un
mountTape
(
const
std
::
string
&
vid
,
const
tape
::
utils
::
TapeLibrarySlot
&
librarySlot
)
{
void
castor
::
legacymsg
::
RmcProxyTcpIp
::
dis
mountTape
(
const
std
::
string
&
vid
,
const
mediachanger
::
TapeLibrarySlot
&
librarySlot
)
{
// Verify parameters
if
(
vid
.
empty
())
{
castor
::
exception
::
Exception
ex
;
...
...
@@ -179,13 +188,13 @@ void castor::legacymsg::RmcProxyTcpIp::unmountTape(const std::string &vid,
// Dispatch the appropriate helper method depending on library slot type
switch
(
librarySlot
.
getLibraryType
())
{
case
tape
::
utils
::
TAPE_LIBRARY_TYPE_ACS
:
case
mediachanger
::
TAPE_LIBRARY_TYPE_ACS
:
unmountTapeAcs
(
vid
,
librarySlot
.
str
());
break
;
case
tape
::
utils
::
TAPE_LIBRARY_TYPE_MANUAL
:
case
mediachanger
::
TAPE_LIBRARY_TYPE_MANUAL
:
unmountTapeManual
(
vid
);
break
;
case
tape
::
utils
::
TAPE_LIBRARY_TYPE_SCSI
:
case
mediachanger
::
TAPE_LIBRARY_TYPE_SCSI
:
unmountTapeScsi
(
vid
,
librarySlot
.
str
());
break
;
default:
...
...
castor/legacymsg/RmcProxyTcpIp.hpp
View file @
60b1fe88
...
...
@@ -56,28 +56,34 @@ public:
~
RmcProxyTcpIp
()
throw
();
/**
*
Asks the remot
e media
-
changer
daemon
to mount the specified tape
into the
* drive in the specified library slot.
*
Requests th
e media
changer to mount
of
the specified tape
for read-only
*
access into the
drive in the specified library slot.
*
* @param vid The volume identifier of the tape.
* @param librarySlot The tape library slot containing the tape drive.
* @param mode The access mode in which the specified tape should be mounted.
* Please note that the value of this parameter is honored in a best effort
* fashion. If the library and drive combination do not support specifying
* the access mode, then this parameter will be ignored.
* @param librarySlot The library slot containing the tape drive.
*/
void
mountTape
(
const
std
::
string
&
vid
,
const
tape
::
utils
::
TapeLibrarySlot
&
librarySlot
,
const
MountMode
mode
);
void
mountTape
ReadOnly
(
const
std
::
string
&
vid
,
const
mediachanger
::
TapeLibrarySlot
&
librarySlot
);
/**
* Asks the remote media-changer daemon to unmount the specified tape from the
* drive in the specified library slot.
* Requests the media changer to mount of the specified tape for read/write
* access into the drive in the specified library slot.
*
* @param vid The volume identifier of the tape.
* @param librarySlot The library slot containing the tape drive.
*/
void
mountTapeReadWrite
(
const
std
::
string
&
vid
,
const
mediachanger
::
TapeLibrarySlot
&
librarySlot
);
/**
* Requests the media changer to mount of the specified tape for read/write
* access into the drive in the specified library slot.
*
* @param vid The volume identifier of the tape.
* @param librarySlot The
tape
library slot containing the tape drive.
* @param librarySlot The library slot containing the tape drive.
*/
void
un
mountTape
(
const
std
::
string
&
vid
,
const
tape
::
utils
::
TapeLibrarySlot
&
librarySlot
);
void
dis
mountTape
(
const
std
::
string
&
vid
,
const
mediachanger
::
TapeLibrarySlot
&
librarySlot
);
protected:
...
...
castor/mediachanger/CMakeLists.txt
0 → 100644
View file @
60b1fe88
#
# castor/tape/rmc/CMakeLists.txt
#
# This file is part of the Castor project.
# See http://castor.web.cern.ch/castor
#
# Copyright (C) 2003 CERN
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
# @author Castor Dev team, castor-dev@cern.ch
#
cmake_minimum_required
(
VERSION 2.6
)
set
(
MEDIA_CHANGER_CLIENT_LIB_SRC_FILES
MediaChangerProxy.cpp
MediaChangerProxyDummy.cpp
TapeLibrarySlot.cpp
TapeLibraryType.cpp
)
add_library
(
castormediachangerclient
${
MEDIA_CHANGER_CLIENT_LIB_SRC_FILES
}
)
castor/
legacymsg/RmcProxyDummyFactor
y.cpp
→
castor/
mediachanger/MediaChangerProx
y.cpp
View file @
60b1fe88
...
...
@@ -19,18 +19,10 @@
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#include
"castor/legacymsg/RmcProxyDummy.hpp"
#include
"castor/legacymsg/RmcProxyDummyFactory.hpp"
#include
"castor/mediachanger/MediaChangerProxy.hpp"
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
castor
::
legacymsg
::
RmcProxyDummyFactory
::~
RmcProxyDummyFactory
()
throw
()
{
}
//------------------------------------------------------------------------------
// create
//------------------------------------------------------------------------------
castor
::
legacymsg
::
RmcProxy
*
castor
::
legacymsg
::
RmcProxyDummyFactory
::
create
()
{
return
new
RmcProxyDummy
();
castor
::
mediachanger
::
MediaChangerProxy
::~
MediaChangerProxy
()
{
}
castor/
legacymsg/RmcProxyDummyFactor
y.hpp
→
castor/
mediachanger/MediaChangerProx
y.hpp
View file @
60b1fe88
...
...
@@ -21,35 +21,56 @@
#pragma once
#include
"castor/legacymsg/RmcProxyFactory.hpp"
#include
"castor/mediachanger/TapeLibrarySlot.hpp"
#include
<string>
namespace
castor
{
namespace
legacymsg
{
namespace
mediachanger
{
/**
*
Concrete factory for creating objects of type RmcProxyDumm
y.
*
Abstract class that defines the inteface to a media-changer prox
y.
*/
class
RmcProxyDummyFactory
:
public
RmcProxyFactor
y
{
class
MediaChangerProx
y
{
public:
/**
* Destructor.
*/
~
RmcProxyDummyFactory
()
throw
();
virtual
~
MediaChangerProxy
()
=
0
;
/**
* Requests the media changer to mount of the specified tape for read-only
* access into the drive in the specified library slot.
*
* @param vid The volume identifier of the tape.
* @param librarySlot The library slot containing the tape drive.
*/
virtual
void
mountTapeReadOnly
(
const
std
::
string
&
vid
,
const
TapeLibrarySlot
&
librarySlot
)
=
0
;
/**
*
Creates an object of type RmcProxyDummy
o
n
the
heap and returns a poin
te
r
*
to i
t.
*
Requests the media changer to mount
o
f
the
specified tape for read/wri
te
*
access into the drive in the specified library slo
t.
*
* Please note that it is the responsibility of the caller to deallocate the
* proxy object from the heap.
* @param vid The volume identifier of the tape.
* @param librarySlot The library slot containing the tape drive.
*/
virtual
void
mountTapeReadWrite
(
const
std
::
string
&
vid
,
const
TapeLibrarySlot
&
librarySlot
)
=
0
;
/**
* Requests the media changer to mount of the specified tape for read/write
* access into the drive in the specified library slot.
*
* @return A pointer to the newly created object.
* @param vid The volume identifier of the tape.
* @param librarySlot The library slot containing the tape drive.
*/
RmcProxy
*
create
();
virtual
void
dismountTape
(
const
std
::
string
&
vid
,
const
TapeLibrarySlot
&
librarySlot
)
=
0
;
};
// class
RmcProxyDummyFactor
y
};
// class
MediaChangerProx
y
}
// namespace
legacymsg
}
// namespace
mediachanger
}
// namespace castor
castor/
legacymsg/Rmc
ProxyDummy.cpp
→
castor/
mediachanger/MediaChanger
ProxyDummy.cpp
View file @
60b1fe88
...
...
@@ -19,24 +19,31 @@
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#include
"castor/
legacymsg/Rmc
ProxyDummy.hpp"
#include
"castor/
mediachanger/MediaChanger
ProxyDummy.hpp"
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
castor
::
legacymsg
::
Rmc
ProxyDummy
::~
Rmc
ProxyDummy
()
throw
()
{
castor
::
mediachanger
::
MediaChanger
ProxyDummy
::~
MediaChanger
ProxyDummy
()
{
}
//------------------------------------------------------------------------------
// mountTape
// mountTape
ReadOnly
//------------------------------------------------------------------------------
void
castor
::
legacymsg
::
RmcProxyDummy
::
mountTape
(
const
std
::
string
&
vid
,
const
tape
::
utils
::
TapeLibrarySlot
&
librarySlot
,
const
MountMode
mode
)
{
void
castor
::
mediachanger
::
MediaChangerProxyDummy
::
mountTapeReadOnly
(
const
std
::
string
&
vid
,
const
TapeLibrarySlot
&
librarySlot
)
{
}
//------------------------------------------------------------------------------
//
un
mountTape
// mountTape
ReadWrite
//------------------------------------------------------------------------------
void
castor
::
legacymsg
::
RmcProxyDummy
::
unmountTape
(
const
std
::
string
&
vid
,
const
tape
::
utils
::
TapeLibrarySlot
&
librarySlot
)
{
void
castor
::
mediachanger
::
MediaChangerProxyDummy
::
mountTapeReadWrite
(
const
std
::
string
&
vid
,
const
TapeLibrarySlot
&
librarySlot
)
{
}
//------------------------------------------------------------------------------
// dismountTape
//------------------------------------------------------------------------------
void
castor
::
mediachanger
::
MediaChangerProxyDummy
::
dismountTape
(
const
std
::
string
&
vid
,
const
TapeLibrarySlot
&
librarySlot
)
{
}
castor/
legacymsg/Rmc
ProxyDummy.hpp
→
castor/
mediachanger/MediaChanger
ProxyDummy.hpp
View file @
60b1fe88
...
...
@@ -21,50 +21,54 @@
#pragma once
#include
"castor/legacymsg/RmcProxy.hpp"
#include
"castor/mediachanger/MediaChangerProxy.hpp"
#include
<string>
namespace
castor
{
namespace
legacymsg
{
namespace
mediachanger
{
/**
* A dummy rmc proxy.
*
* The main goal of this class is to facilitate the development of unit tests.
* Concrete class that implementd a dummy a media-changer proxy.
*/
class
Rmc
ProxyDummy
:
public
Rmc
Proxy
{
class
MediaChanger
ProxyDummy
:
public
MediaChanger
Proxy
{
public:
/**
* Destructor.
*/
~
RmcProxyDummy
()
throw
();
~
MediaChangerProxyDummy
();
/**
* Requests the media changer to mount of the specified tape for read-only
* access into the drive in the specified library slot.
*
* @param vid The volume identifier of the tape.
* @param librarySlot The library slot containing the tape drive.
*/
void
mountTapeReadOnly
(
const
std
::
string
&
vid
,
const
TapeLibrarySlot
&
librarySlot
);
/**
*
Asks the remot
e media
-
changer
daemon
to mount the specified tape
into th
e
* drive in the specified library slot.
*
Requests th
e media
changer to mount
of
the specified tape
for read/writ
e
*
access into the
drive in the specified library slot.
*
* @param vid The volume identifier of the tape.
* @param librarySlot The tape library slot containing the tape drive.
* @param mode The access mode in which the specified tape should be mounted.
* Please note that the value of this parameter is honored in a best effort
* fashion. If the library and drive combination do not support specifying
* the access mode, then this parameter will be ignored.
* @param librarySlot The library slot containing the tape drive.
*/
void
mountTape
(
const
std
::
string
&
vid
,
const
tape
::
utils
::
TapeLibrarySlot
&
librarySlot
,
const
MountMode
mode
);
void
mountTape
ReadWrite
(
const
std
::
string
&
vid
,
const
TapeLibrarySlot
&
librarySlot
);
/**
*
Asks the remot
e media
-
changer
daemon
to
un
mount the specified tape f
rom th
e
* drive in the specified library slot.
*
Requests th
e media
changer to mount
of
the specified tape f
or read/writ
e
*
access into the
drive in the specified library slot.
*
* @param vid The volume identifier of the tape.
* @param librarySlot The
tape
library slot containing the tape drive.
* @param librarySlot The library slot containing the tape drive.
*/
void
unmountTape
(
const
std
::
string
&
vid
,
const
tape
::
utils
::
TapeLibrarySlot
&
librarySlot
);
void
dismountTape
(
const
std
::
string
&
vid
,
const
TapeLibrarySlot
&
librarySlot
);
};
// class
RmcProxyDumm
y
};
// class
MediaChangerProx
y
}
// namespace
legacymsg
}
// namespace
mediachanger
}
// namespace castor
castor/
tape/utils
/TapeLibrarySlot.cpp
→
castor/
mediachanger
/TapeLibrarySlot.cpp
View file @
60b1fe88
...
...
@@ -22,19 +22,19 @@
*****************************************************************************/
#include
"castor/exception/Exception.hpp"
#include
"castor/
tape/utils
/TapeLibrarySlot.hpp"
#include
"castor/
mediachanger
/TapeLibrarySlot.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
castor
::
tape
::
utils
::
TapeLibrarySlot
::
TapeLibrarySlot
()
:
castor
::
mediachanger
::
TapeLibrarySlot
::
TapeLibrarySlot
()
:
m_libraryType
(
TAPE_LIBRARY_TYPE_NONE
)
{
}
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
castor
::
tape
::
utils
::
TapeLibrarySlot
::
TapeLibrarySlot
(
const
std
::
string
&
str
)
:
castor
::
mediachanger
::
TapeLibrarySlot
::
TapeLibrarySlot
(
const
std
::
string
&
str
)
:
m_str
(
str
),
m_libraryType
(
getLibraryTypeOfSlot
(
str
))
{
}
...
...
@@ -42,7 +42,7 @@ castor::tape::utils::TapeLibrarySlot::TapeLibrarySlot(const std::string &str):
//------------------------------------------------------------------------------
// getLibrarySlotType
//------------------------------------------------------------------------------
castor
::
tape
::
utils
::
TapeLibraryType
castor
::
tape
::
utils
::
TapeLibrarySlot
::
castor
::
mediachanger
::
TapeLibraryType
castor
::
mediachanger
::
TapeLibrarySlot
::
getLibraryTypeOfSlot
(
const
std
::
string
&
slot
)
{
if
(
0
==
slot
.
find
(
"acs@"
))
return
TAPE_LIBRARY_TYPE_ACS
;
if
(
0
==
slot
.
find
(
"manual@"
))
return
TAPE_LIBRARY_TYPE_MANUAL
;
...
...
@@ -57,14 +57,14 @@ castor::tape::utils::TapeLibraryType castor::tape::utils::TapeLibrarySlot::
//------------------------------------------------------------------------------
// str
//------------------------------------------------------------------------------
const
std
::
string
&
castor
::
tape
::
utils
::
TapeLibrarySlot
::
str
()
const
throw
()
{
const
std
::
string
&
castor
::
mediachanger
::
TapeLibrarySlot
::
str
()
const
throw
()
{
return
m_str
;
}
//------------------------------------------------------------------------------
// getLibraryType
//------------------------------------------------------------------------------
castor
::
tape
::
utils
::
TapeLibraryType
castor
::
tape
::
utils
::
TapeLibrarySlot
::
getLibraryType
()
const
throw
()
{
castor
::
mediachanger
::
TapeLibraryType
castor
::
mediachanger
::
TapeLibrarySlot
::
getLibraryType
()
const
throw
()
{
return
m_libraryType
;
}
castor/
tape/utils
/TapeLibrarySlot.hpp
→
castor/
mediachanger
/TapeLibrarySlot.hpp
View file @
60b1fe88
...
...
@@ -23,13 +23,12 @@
#pragma once
#include
"castor/
tape/utils
/TapeLibraryType.hpp"
#include
"castor/
mediachanger
/TapeLibraryType.hpp"
#include
<string>
namespace
castor
{
namespace
tape
{
namespace
utils
{
namespace
mediachanger
{
/**
* Class representing a slot in a tape library.
...
...
@@ -89,6 +88,5 @@ private:
};
// class TapeLibrarySlot
}
// namespace utils
}
// namespace tape
}
// namespace mediachanger
}
// namespace castor
castor/
tape/utils
/TapeLibrarySlotTest.cpp
→
castor/
mediachanger
/TapeLibrarySlotTest.cpp
View file @
60b1fe88
...
...
@@ -22,14 +22,14 @@
*****************************************************************************/
#include
"castor/exception/Exception.hpp"
#include
"castor/
tape/utils
/TapeLibrarySlot.hpp"
#include
"castor/
mediachanger
/TapeLibrarySlot.hpp"
#include
<gtest/gtest.h>
#include
<memory>
namespace
unitTests
{
class
castor_
tape_utils
_TapeLibrarySlotTest
:
public
::
testing
::
Test
{
class
castor_
mediachanger
_TapeLibrarySlotTest
:
public
::
testing
::
Test
{
protected:
virtual
void
SetUp
()
{
...
...
@@ -39,40 +39,40 @@ protected:
}
};
TEST_F
(
castor_
tape_utils
_TapeLibrarySlotTest
,
getLibraryTypeNone
)
{
using
namespace
castor
::
tape
::
utils
;
TEST_F
(
castor_
mediachanger
_TapeLibrarySlotTest
,
getLibraryTypeNone
)
{
using
namespace
castor
::
mediachanger
;
TapeLibrarySlot
slot
;
ASSERT_EQ
(
TAPE_LIBRARY_TYPE_NONE
,
slot
.
getLibraryType
());
}
TEST_F
(
castor_
tape_utils
_TapeLibrarySlotTest
,
getLibraryTypeAcs
)
{
using
namespace
castor
::
tape
::
utils
;
TEST_F
(
castor_
mediachanger
_TapeLibrarySlotTest
,
getLibraryTypeAcs
)
{
using
namespace
castor
::
mediachanger
;
TapeLibrarySlot
slot
(
"acs@rmc_host,1,2,3,4"
);
ASSERT_EQ
(
TAPE_LIBRARY_TYPE_ACS
,
slot
.
getLibraryType
());
}
TEST_F
(
castor_
tape_utils
_TapeLibrarySlotTest
,
getLibraryTypeManual
)
{
using
namespace
castor
::
tape
::
utils
;
TEST_F
(
castor_
mediachanger
_TapeLibrarySlotTest
,
getLibraryTypeManual
)
{
using
namespace
castor
::
mediachanger
;
TapeLibrarySlot
slot
(
"manual@opaque_drive_id"
);
ASSERT_EQ
(
TAPE_LIBRARY_TYPE_MANUAL
,
slot
.
getLibraryType
());
}
TEST_F
(
castor_
tape_utils
_TapeLibrarySlotTest
,
getLibraryTypeScsi
)
{
using
namespace
castor
::
tape
::
utils
;
TEST_F
(
castor_
mediachanger
_TapeLibrarySlotTest
,
getLibraryTypeScsi
)
{
using
namespace
castor
::
mediachanger
;
TapeLibrarySlot
slot
(
"smc@rmc_host,1"
);
ASSERT_EQ
(
TAPE_LIBRARY_TYPE_SCSI
,
slot
.
getLibraryType
());
}
TEST_F
(
castor_
tape_utils
_TapeLibrarySlotTest
,
getLibraryTypeNonsense
)
{
using
namespace
castor
::
tape
::
utils
;
TEST_F
(
castor_
mediachanger
_TapeLibrarySlotTest
,
getLibraryTypeNonsense
)
{