Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
8f57e66f
Commit
8f57e66f
authored
8 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
Added RdbmsCatalogue::modifyTapePoolComment()
parent
abe5cb2c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
catalogue/CatalogueTest.cpp
+53
-0
53 additions, 0 deletions
catalogue/CatalogueTest.cpp
catalogue/RdbmsCatalogue.cpp
+21
-1
21 additions, 1 deletion
catalogue/RdbmsCatalogue.cpp
with
74 additions
and
1 deletion
catalogue/CatalogueTest.cpp
+
53
−
0
View file @
8f57e66f
...
...
@@ -1045,6 +1045,59 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapePoolNbPartialTapes) {
ASSERT_EQ
(
creationLog
,
lastModificationLog
);
}
}
TEST_P
(
cta_catalogue_CatalogueTest
,
modifyTapePoolComment
)
{
using
namespace
cta
;
ASSERT_TRUE
(
m_catalogue
->
getTapePools
().
empty
());
const
std
::
string
tapePoolName
=
"tape_pool"
;
const
uint64_t
nbPartialTapes
=
2
;
const
bool
is_encrypted
=
true
;
const
std
::
string
comment
=
"Create tape pool"
;
m_catalogue
->
createTapePool
(
m_cliSI
,
tapePoolName
,
nbPartialTapes
,
is_encrypted
,
comment
);
{
const
std
::
list
<
common
::
dataStructures
::
TapePool
>
pools
=
m_catalogue
->
getTapePools
();
ASSERT_EQ
(
1
,
pools
.
size
());
const
common
::
dataStructures
::
TapePool
pool
=
pools
.
front
();
ASSERT_EQ
(
tapePoolName
,
pool
.
name
);
ASSERT_EQ
(
nbPartialTapes
,
pool
.
nbPartialTapes
);
ASSERT_EQ
(
is_encrypted
,
pool
.
encryption
);
ASSERT_EQ
(
comment
,
pool
.
comment
);
const
common
::
dataStructures
::
EntryLog
creationLog
=
pool
.
creationLog
;
ASSERT_EQ
(
m_cliSI
.
username
,
creationLog
.
username
);
ASSERT_EQ
(
m_cliSI
.
host
,
creationLog
.
host
);
const
common
::
dataStructures
::
EntryLog
lastModificationLog
=
pool
.
lastModificationLog
;
ASSERT_EQ
(
creationLog
,
lastModificationLog
);
}
const
std
::
string
modifiedComment
=
"Modified comment"
;
m_catalogue
->
modifyTapePoolComment
(
m_cliSI
,
tapePoolName
,
modifiedComment
);
{
const
std
::
list
<
common
::
dataStructures
::
TapePool
>
pools
=
m_catalogue
->
getTapePools
();
ASSERT_EQ
(
1
,
pools
.
size
());
const
common
::
dataStructures
::
TapePool
pool
=
pools
.
front
();
ASSERT_EQ
(
tapePoolName
,
pool
.
name
);
ASSERT_EQ
(
nbPartialTapes
,
pool
.
nbPartialTapes
);
ASSERT_EQ
(
is_encrypted
,
pool
.
encryption
);
ASSERT_EQ
(
modifiedComment
,
pool
.
comment
);
const
common
::
dataStructures
::
EntryLog
creationLog
=
pool
.
creationLog
;
ASSERT_EQ
(
m_cliSI
.
username
,
creationLog
.
username
);
ASSERT_EQ
(
m_cliSI
.
host
,
creationLog
.
host
);
const
common
::
dataStructures
::
EntryLog
lastModificationLog
=
pool
.
lastModificationLog
;
ASSERT_EQ
(
creationLog
,
lastModificationLog
);
}
}
TEST_P
(
cta_catalogue_CatalogueTest
,
createArchiveRoute
)
{
using
namespace
cta
;
...
...
This diff is collapsed.
Click to expand it.
catalogue/RdbmsCatalogue.cpp
+
21
−
1
View file @
8f57e66f
...
...
@@ -841,7 +841,27 @@ void RdbmsCatalogue::modifyTapePoolNbPartialTapes(const common::dataStructures::
// modifyTapePoolComment
//------------------------------------------------------------------------------
void
RdbmsCatalogue
::
modifyTapePoolComment
(
const
common
::
dataStructures
::
SecurityIdentity
&
cliIdentity
,
const
std
::
string
&
name
,
const
std
::
string
&
comment
)
{
throw
exception
::
Exception
(
std
::
string
(
__FUNCTION__
)
+
" not implemented"
);
try
{
const
time_t
now
=
time
(
nullptr
);
const
char
*
const
sql
=
"UPDATE TAPE_POOL SET "
"USER_COMMENT = :USER_COMMENT,"
"LAST_UPDATE_USER_NAME = :LAST_UPDATE_USER_NAME,"
"LAST_UPDATE_HOST_NAME = :LAST_UPDATE_HOST_NAME,"
"LAST_UPDATE_TIME = :LAST_UPDATE_TIME "
"WHERE "
"TAPE_POOL_NAME = :TAPE_POOL_NAME"
;
auto
conn
=
m_connPool
.
getConn
();
auto
stmt
=
conn
->
createStmt
(
sql
,
rdbms
::
Stmt
::
AutocommitMode
::
ON
);
stmt
->
bindString
(
":USER_COMMENT"
,
comment
);
stmt
->
bindString
(
":LAST_UPDATE_USER_NAME"
,
cliIdentity
.
username
);
stmt
->
bindString
(
":LAST_UPDATE_HOST_NAME"
,
cliIdentity
.
host
);
stmt
->
bindUint64
(
":LAST_UPDATE_TIME"
,
now
);
stmt
->
bindString
(
":TAPE_POOL_NAME"
,
name
);
stmt
->
executeNonQuery
();
}
catch
(
exception
::
Exception
&
ex
)
{
throw
exception
::
Exception
(
std
::
string
(
__FUNCTION__
)
+
" failed: "
+
ex
.
getMessage
().
str
());
}
}
//------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment