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
d630b330
Commit
d630b330
authored
9 years ago
by
Eric Cano
Browse files
Options
Downloads
Patches
Plain Diff
Fixed system tests as the behavior of cta-taped changed.
parent
58e24fd4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tapeserver/CMakeLists.txt
+1
-0
1 addition, 0 deletions
tapeserver/CMakeLists.txt
tapeserver/cta-tapedSystemtests.cpp
+32
-16
32 additions, 16 deletions
tapeserver/cta-tapedSystemtests.cpp
with
33 additions
and
16 deletions
tapeserver/CMakeLists.txt
+
1
−
0
View file @
d630b330
...
...
@@ -18,6 +18,7 @@ add_library(cta-tapedSystemTests SHARED
target_link_libraries
(
cta-tapedSystemTests
systemTestHelper
unitTestHelper
ctacommon
)
install
(
TARGETS cta-tapedSystemTests DESTINATION usr/
${
CMAKE_INSTALL_LIBDIR
}
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tapeserver/cta-tapedSystemtests.cpp
+
32
−
16
View file @
d630b330
...
...
@@ -17,28 +17,44 @@
*/
#include
"tests/Subprocess.hpp"
#include
"tests/TempFile.hpp"
#include
<gtest/gtest.h>
namespace
systemTests
{
TEST
(
cta_taped
,
InvocationTests
)
{
// Do we get help with -h or --help?
Subprocess
spHelpShort
(
"cta-taped"
,
std
::
list
<
std
::
string
>
({
"cta-taped"
,
"-h"
}));
spHelpShort
.
wait
();
ASSERT_NE
(
std
::
string
::
npos
,
spHelpShort
.
stdout
().
find
(
"Usage"
));
ASSERT_TRUE
(
spHelpShort
.
stderr
().
empty
());
ASSERT_EQ
(
EXIT_SUCCESS
,
spHelpShort
.
exitValue
());
Subprocess
spHelpLong
(
"cta-taped"
,
std
::
list
<
std
::
string
>
({
"cta-taped"
,
"--help"
}));
spHelpLong
.
wait
();
ASSERT_NE
(
std
::
string
::
npos
,
spHelpLong
.
stdout
().
find
(
"Usage: cta-taped [options]"
));
ASSERT_TRUE
(
spHelpLong
.
stderr
().
empty
());
ASSERT_EQ
(
EXIT_SUCCESS
,
spHelpLong
.
exitValue
());
{
// Do we get help with -h or --help?
Subprocess
spHelpShort
(
"cta-taped"
,
std
::
list
<
std
::
string
>
({
"cta-taped"
,
"-h"
}));
spHelpShort
.
wait
();
ASSERT_NE
(
std
::
string
::
npos
,
spHelpShort
.
stdout
().
find
(
"Usage"
));
ASSERT_TRUE
(
spHelpShort
.
stderr
().
empty
());
ASSERT_EQ
(
EXIT_SUCCESS
,
spHelpShort
.
exitValue
());
Subprocess
spHelpLong
(
"cta-taped"
,
std
::
list
<
std
::
string
>
({
"cta-taped"
,
"--help"
}));
spHelpLong
.
wait
();
ASSERT_NE
(
std
::
string
::
npos
,
spHelpLong
.
stdout
().
find
(
"Usage: cta-taped [options]"
));
ASSERT_TRUE
(
spHelpLong
.
stderr
().
empty
());
ASSERT_EQ
(
EXIT_SUCCESS
,
spHelpLong
.
exitValue
());
}
{
// Do we get proper complaint when the configuration file is not there?
Subprocess
spNoConfigFile
(
"cta-taped"
,
std
::
list
<
std
::
string
>
({
"cta-taped"
,
"-f"
,
"-s"
,
"-c"
,
"/no/such/file"
}));
spNoConfigFile
.
wait
();
ASSERT_NE
(
std
::
string
::
npos
,
spNoConfigFile
.
stdout
().
find
(
"Failed to open configuration file"
));
ASSERT_TRUE
(
spNoConfigFile
.
stderr
().
empty
());
ASSERT_EQ
(
EXIT_FAILURE
,
spNoConfigFile
.
exitValue
());
}
// Does the tape server complain about absence of drive configuration?
Subprocess
spNoDrive
(
"cta-taped"
,
std
::
list
<
std
::
string
>
({
"cta-taped"
,
"-f"
,
"-s"
}));
spNoDrive
.
wait
();
ASSERT_NE
(
std
::
string
::
npos
,
spNoDrive
.
stdout
().
find
(
"MSG=
\"
Aborting
\"
Message=
\"
No drive found in configuration
\"
"
));
ASSERT_TRUE
(
spNoDrive
.
stderr
().
empty
());
ASSERT_EQ
(
EXIT_FAILURE
,
spNoDrive
.
exitValue
());
{
// We provide le daemon with an existing (but empty) configuration file
unitTests
::
TempFile
tf
;
Subprocess
spNoDrive
(
"cta-taped"
,
std
::
list
<
std
::
string
>
({
"cta-taped"
,
"-f"
,
"-s"
,
"-c"
,
tf
.
path
()}));
spNoDrive
.
wait
();
ASSERT_NE
(
std
::
string
::
npos
,
spNoDrive
.
stdout
().
find
(
"MSG=
\"
Aborting
\"
Message=
\"
No drive found in configuration
\"
"
));
ASSERT_TRUE
(
spNoDrive
.
stderr
().
empty
());
ASSERT_EQ
(
EXIT_FAILURE
,
spNoDrive
.
exitValue
());
}
}
}
\ No newline at end of file
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