Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
castor
CASTOR
Commits
975c3912
Commit
975c3912
authored
Oct 28, 2010
by
Steven Murray
Browse files
Improved environment checks of the CASTOR tape test scripts so that they give
more meaningful error messages when they fail.
parent
728390aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/tapegateway_release_tests/CastorTapeTests.pm
View file @
975c3912
...
...
@@ -107,6 +107,15 @@ sub read_config ( $ )
}
}
# Dies with an appropriate message if the specfied file or directory does not
# exist
sub
check_file_exists
(
$$
)
{
my
(
$descriptive_name
,
$filename
)
=
(
shift
,
shift
);
die
("
$descriptive_name
\"
$filename
\"
does not exist
\n
")
if
!
-
e
$filename
;
}
# Check the sanity of the environment, die if anything is wrong
sub
check_environment
(
)
{
...
...
@@ -117,12 +126,11 @@ sub check_environment ( )
}
}
if
(
!
$pass
)
{
die
"
Wrong host
";
}
if
(
(
!
-
e
$environment
{
checkout_location
}
.
'
/
'
.
$environment
{
dbDir
}
)
||
(
!
-
e
$environment
{
checkout_location
}
.
'
/
'
.
$environment
{
dbDir
}
.
'
/
'
.
$environment
{
originalDbSchema
}
)
||
(
!
-
e
$environment
{
checkout_location
}
.
'
/
'
.
$environment
{
dbDir
}
.
'
/
'
.
$environment
{
originalDropSchema
}
)
||
(
!
-
e
$environment
{
checkout_location
}
.
'
/
'
.
$environment
{
tstDir
}
)
)
{
die
"
Necessary file or directory not found
";
}
check_file_exists
("
Database schema directory
",
$environment
{
checkout_location
}
.
'
/
'
.
$environment
{
dbDir
});
check_file_exists
("
Stager schema
",
$environment
{
checkout_location
}
.
'
/
'
.
$environment
{
dbDir
}
.
'
/
'
.
$environment
{
originalDbSchema
});
check_file_exists
("
Drop stager-database script
",
$environment
{
checkout_location
}
.
'
/
'
.
$environment
{
dbDir
}
.
'
/
'
.
$environment
{
originalDropSchema
});
check_file_exists
("
Test-script directory
",
$environment
{
checkout_location
}
.
'
/
'
.
$environment
{
tstDir
});
}
# Extract enviroment variable (mainly for client application)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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