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
ba3088ac
Commit
ba3088ac
authored
8 years ago
by
Eric Cano
Browse files
Options
Downloads
Patches
Plain Diff
Changed the input data of tpconfig related test as library slots should be pareable now.
parent
927fcd8b
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
tapeserver/daemon/TapedConfigurationTests.cpp
+3
-3
3 additions, 3 deletions
tapeserver/daemon/TapedConfigurationTests.cpp
tapeserver/daemon/TpconfigTests.cpp
+16
-17
16 additions, 17 deletions
tapeserver/daemon/TpconfigTests.cpp
with
19 additions
and
20 deletions
tapeserver/daemon/TapedConfigurationTests.cpp
+
3
−
3
View file @
ba3088ac
...
...
@@ -61,9 +61,9 @@ TEST(cta_Daemon, TapedConfigurationFull) {
"taped BufferCount 1
\n
"
"taped TpConfigPath "
);
TempFile
TpConfig
;
TpConfig
.
stringFill
(
"drive0 lib0 /dev/tape0
lib0slot
0
\n
"
"drive1 lib0 /dev/tape1
lib0slot
1
\n
"
"drive2 lib0 /dev/tape2
lib0slot
2"
);
TpConfig
.
stringFill
(
"drive0 lib0 /dev/tape0
smc
0
\n
"
"drive1 lib0 /dev/tape1
smc
1
\n
"
"drive2 lib0 /dev/tape2
smc
2"
);
completeConfFile
.
stringAppend
(
TpConfig
.
path
());
// The log parameter can be uncommented to inspect the result on the output.
auto
completeConfig
=
...
...
This diff is collapsed.
Click to expand it.
tapeserver/daemon/TpconfigTests.cpp
+
16
−
17
View file @
ba3088ac
...
...
@@ -68,9 +68,9 @@ TEST(cta_Daemon, Tpconfig_base) {
}
// Test with several entries (valid file with various extra blanks)
tf
.
stringFill
(
" drive0 lib0
\t\t\t
/dev/tape0
lib0slot
0
\n
"
"drive1 lib0 /dev/tape1
lib0slot
1
\n
"
"drive2 lib0 /dev/tape2
lib0slot
2"
);
tf
.
stringFill
(
" drive0 lib0
\t\t\t
/dev/tape0
smc
0
\n
"
"drive1 lib0 /dev/tape1
smc
1
\n
"
"drive2 lib0 /dev/tape2
smc
2"
);
tpc
=
cta
::
tape
::
daemon
::
Tpconfig
::
parseFile
(
tf
.
path
());
ASSERT_EQ
(
3
,
tpc
.
size
());
int
i
=
0
;
...
...
@@ -78,7 +78,7 @@ TEST(cta_Daemon, Tpconfig_base) {
ASSERT_EQ
(
"drive"
,
t
.
second
.
value
().
unitName
.
substr
(
0
,
5
));
ASSERT_EQ
(
"lib0"
,
t
.
second
.
value
().
logicalLibrary
);
ASSERT_EQ
(
"/dev/tape"
,
t
.
second
.
value
().
devFilename
.
substr
(
0
,
9
));
ASSERT_EQ
(
"
lib0slot
"
,
t
.
second
.
value
().
rawLibrarySlot
.
substr
(
0
,
8
));
ASSERT_EQ
(
"
smc
"
,
t
.
second
.
value
().
rawLibrarySlot
.
substr
(
0
,
3
));
ASSERT_EQ
(
'0'
+
i
,
t
.
second
.
value
().
unitName
.
back
());
ASSERT_EQ
(
'0'
+
i
,
t
.
second
.
value
().
devFilename
.
back
());
ASSERT_EQ
(
'0'
+
i
,
t
.
second
.
value
().
rawLibrarySlot
.
back
());
...
...
@@ -89,25 +89,24 @@ TEST(cta_Daemon, Tpconfig_base) {
TEST
(
cta_Daemon
,
Tpconfig_duplicates
)
{
TempFile
tf
;
// Test duplicate unit name
tf
.
stringFill
(
"drive0 lib0 /dev/tape0
lib0slot
0
\n
"
"drive1 lib0 /dev/tape1
lib0slot
1
\n
"
"drive0 lib0 /dev/tape2
lib0slot
2"
);
tf
.
stringFill
(
"drive0 lib0 /dev/tape0
smc
0
\n
"
"drive1 lib0 /dev/tape1
smc
1
\n
"
"drive0 lib0 /dev/tape2
smc
2"
);
ASSERT_THROW
(
cta
::
tape
::
daemon
::
Tpconfig
::
parseFile
(
tf
.
path
()),
cta
::
exception
::
Exception
);
// Test duplicate path
tf
.
stringFill
(
"drive0 lib0 /dev/tape0
lib0slot
0
\n
"
"drive1 lib0 /dev/tape1
lib0slot
1
\n
"
"drive2 lib0 /dev/tape0
lib0slot
2"
);
tf
.
stringFill
(
"drive0 lib0 /dev/tape0
smc
0
\n
"
"drive1 lib0 /dev/tape1
smc
1
\n
"
"drive2 lib0 /dev/tape0
smc
2"
);
ASSERT_THROW
(
cta
::
tape
::
daemon
::
Tpconfig
::
parseFile
(
tf
.
path
()),
cta
::
exception
::
Exception
);
// Test duplicate slot
tf
.
stringFill
(
"drive0 lib0 /dev/tape0
lib0slot
0
\n
"
"drive1 lib0 /dev/tape1
lib0slot
1
\n
"
"drive2 lib0 /dev/tape2
lib0slot
0"
);
tf
.
stringFill
(
"drive0 lib0 /dev/tape0
smc
0
\n
"
"drive1 lib0 /dev/tape1
smc
1
\n
"
"drive2 lib0 /dev/tape2
smc
0"
);
ASSERT_THROW
(
cta
::
tape
::
daemon
::
Tpconfig
::
parseFile
(
tf
.
path
()),
cta
::
exception
::
Exception
);
// No duplication.
// Test duplicate slot
tf
.
stringFill
(
"drive0 lib0 /dev/tape0 lib0slot0
\n
"
"drive1 lib0 /dev/tape1 lib0slot1
\n
"
"drive2 lib0 /dev/tape2 lib0slot2"
);
tf
.
stringFill
(
"drive0 lib0 /dev/tape0 smc0
\n
"
"drive1 lib0 /dev/tape1 smc1
\n
"
"drive2 lib0 /dev/tape2 smc2"
);
cta
::
tape
::
daemon
::
Tpconfig
::
parseFile
(
tf
.
path
());
}
...
...
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