Commit 975c3912 authored by Steven Murray's avatar 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
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment