Commit 8776a9a7 authored by Eric Cano's avatar Eric Cano
Browse files

bug #72215: Remove the TAPEGATEWAYREQUEST table from the schema, and drop the...

bug #72215: Remove the TAPEGATEWAYREQUEST table from the schema, and drop the triggers that populate it.

Updated the test script (most meat moved to the module).
parent 0df660fe
......@@ -30,8 +30,6 @@
package CastorTapeTests;
my $package_name="CastorTapeTests";
use strict;
# Imports
use strict;
use POSIX;
......@@ -52,11 +50,21 @@ my @local_files;
my @remote_files;
# keep track of the test environement (and definition of the defaults).
my %environment = {
'uid' => 'canoc3';
my %environemnt = {
'name' => 'invalid';
'allowed_stagers' => [ 'lxcastordev03', 'lxcastordev04' ];
};
# Set the user name in the environment
sub set_test_user ( $ )
{
my $uname = shift;
if (!defined (getpwnam($uname))) {
}
$environment{'uname'} = $uanme;
}
# create a local seed file, returning the index to the file.
# Take 1 parameter: the size in
sub make_seed ( $ )
......@@ -91,19 +99,39 @@ sub make_seed ( $ )
if (! (-s $file_name) == $size) {
die "In $package_name::make_seed: file $file_name created with wrong size";
}
$endtime = `date +%s`;
print "Seed file created in ".($endtime - $starttime)."s. Speed=".
($size/(1024*1024)/($endtime - $starttime);
# Hand over the file to the user
print `chown $environment{'uid'} $file_name`;
# We call is good enough
# We call it good enough
my %file_entry = { 'name' => $file_name,
'size' => $size };
'size' => $size
'adler32' => `adler32 $file_name`};
my $file_index = push @local_files, \%file_entry;
$file_index --;
return $file_index;
}
# Create a local file from seed, with its name prepended, and recompute the checksum
# return index to the file in the local files array.
#
sub make_localfile ( $$ )
{
my ($file_name, $seed_index) = ( shift, shift );
open NEW_FILE, "$file_name >" or die "In $package_name::make_localfile: failed to open $file_name for writing: $!";
print NEW_FILE, "$file_name";
close NEW_FILE;
`dd if=$local_files[$seed_index]->{'name'} of=$file_name bs=1M`;
my %file_entry = { 'name' => $file_name,
'size' => ( -s $file_name ),
'adler32' => `adler32 $file_name`};
}
# open_db : find connection parameters and open db connection
sub open_db()
{
......@@ -814,6 +842,12 @@ sub getLdLibraryPathFromSrcPath ( $ ) {
return $ldLibraryPath;
}
# Final cleanup of the library.
# So far, get rid of leftover local files
END {
if (@local_files) {
unlink $_{'name'};
}
}
# # create a local
1; # this should be your last line
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