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
9ac655b8
Commit
9ac655b8
authored
Jun 13, 2017
by
Eric Cano
Browse files
Fixed missing VID in existing mounts list.
parent
aea06d98
Changes
2
Hide whitespace changes
Inline
Side-by-side
scheduler/OStoreDB/OStoreDB.cpp
View file @
9ac655b8
...
...
@@ -170,12 +170,14 @@ std::unique_ptr<SchedulerDatabase::TapeMountDecisionInfo>
tmdi
.
existingOrNextMounts
.
back
().
type
=
d
->
mountType
;
tmdi
.
existingOrNextMounts
.
back
().
tapePool
=
d
->
currentTapePool
;
tmdi
.
existingOrNextMounts
.
back
().
driveName
=
d
->
driveName
;
tmdi
.
existingOrNextMounts
.
back
().
vid
=
d
->
currentVid
;
}
if
(
activeMountTypes
.
count
((
int
)
d
->
nextMountType
))
{
tmdi
.
existingOrNextMounts
.
push_back
(
ExistingMount
());
tmdi
.
existingOrNextMounts
.
back
().
type
=
d
->
nextMountType
;
tmdi
.
existingOrNextMounts
.
back
().
tapePool
=
d
->
nextTapepool
;
tmdi
.
existingOrNextMounts
.
back
().
driveName
=
d
->
driveName
;
tmdi
.
existingOrNextMounts
.
back
().
vid
=
d
->
nextVid
;
}
}
std
::
unique_ptr
<
SchedulerDatabase
::
TapeMountDecisionInfo
>
ret
(
std
::
move
(
privateRet
));
...
...
scheduler/SchedulerTest.cpp
View file @
9ac655b8
...
...
@@ -85,6 +85,13 @@ public:
return
"Failed to get scheduler"
;
}
};
class
FailedToGetSchedulerDB
:
public
std
::
exception
{
public:
const
char
*
what
()
const
throw
()
{
return
"Failed to get object store db."
;
}
};
virtual
void
SetUp
()
{
using
namespace
cta
;
...
...
@@ -119,6 +126,14 @@ public:
return
*
ptr
;
}
cta
::
SchedulerDatabase
&
getSchedulerDB
()
{
cta
::
SchedulerDatabase
*
const
ptr
=
m_db
.
get
();
if
(
NULL
==
ptr
)
{
throw
FailedToGetSchedulerDB
();
}
return
*
ptr
;
}
void
setupDefaultCatalogue
()
{
using
namespace
cta
;
auto
&
catalogue
=
getCatalogue
();
...
...
@@ -419,6 +434,11 @@ TEST_P(SchedulerTest, archive_and_retrieve_new_file) {
mount
.
reset
(
scheduler
.
getNextMount
(
s_libraryName
,
"drive0"
,
lc
).
release
());
ASSERT_NE
((
cta
::
TapeMount
*
)
NULL
,
mount
.
get
());
ASSERT_EQ
(
cta
::
common
::
dataStructures
::
MountType
::
Archive
,
mount
.
get
()
->
getMountType
());
auto
&
osdb
=
getSchedulerDB
();
auto
mi
=
osdb
.
getMountInfo
();
ASSERT_EQ
(
1
,
mi
->
existingOrNextMounts
.
size
());
ASSERT_EQ
(
"TestTapePool"
,
mi
->
existingOrNextMounts
.
front
().
tapePool
);
ASSERT_EQ
(
"TestVid"
,
mi
->
existingOrNextMounts
.
front
().
vid
);
std
::
unique_ptr
<
cta
::
ArchiveMount
>
archiveMount
;
archiveMount
.
reset
(
dynamic_cast
<
cta
::
ArchiveMount
*>
(
mount
.
release
()));
ASSERT_NE
((
cta
::
ArchiveMount
*
)
NULL
,
archiveMount
.
get
());
...
...
@@ -615,7 +635,6 @@ TEST_P(SchedulerTest, retrieve_non_existing_file) {
}
}
#undef TEST_MOCK_DB
#ifdef TEST_MOCK_DB
static
cta
::
MockSchedulerDatabaseFactory
mockDbFactory
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment