Commit 6c46c59c 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.

Fixed wrong syntax calling a command via su, plus comsmetic changes.
parent 697c0b9a
......@@ -348,7 +348,7 @@ sub cleanup_migrated ()
for ( my $i =0; $i < scalar (@remote_files); $i++ ) {
my %f = %{$remote_files[$i]};
if ( $f{type} eq "file" && $f{status} eq "migrated" ) {
print `su $environment{username} -c \"STAGE_SVCCLASS=dev stager_rm -M $f{name}\"`;
`su $environment{username} -c \"STAGE_SVCCLASS=dev stager_rm -M $f{name}\"`;
$remote_files[$i]->{status} = "invalidation requested";
print "t=".elapsed_time()."s. Removed $f{name} (was migrated) from stager.\n";
}
......@@ -454,7 +454,7 @@ sub check_remote_entries ()
# hand over the file to the user
`chown $environment{username} $local_copy`;
# rfcp the recalled copy
`su -c $environment{username} \"STAGE_SVCCLASS=dev rfcp $entry{name} $local_copy\"`;
`su $environment{username} -c \"STAGE_SVCCLASS=dev rfcp $entry{name} $local_copy\"`;
# compute checksum, get size and get rid of file
my $local_size = ( -s $local_copy );
my $local_checksum_string = `adler32 $local_copy 2>&1`;
......@@ -475,6 +475,7 @@ sub check_remote_entries ()
"$local_size != ".$entry{size}."\n";
}
unlink $local_copy;
print "t=".elapsed_time()."s. rfcped ".$entry{name}." back and checked it.\n";
$changed_entries ++;
}
}
......@@ -1508,16 +1509,16 @@ sub getLdLibraryPathFromSrcPath ( $ ) {
}
sub cleanup () {
print "In CastorTapeTests::cleanup: cleaning up files\n";
print "t=".elapsed_time()."s. In CastorTapeTests::cleanup: cleaning up files\n";
for (@local_files) {
print "Cleanup: removing ".$_->{name}."\n";
print "t=".elapsed_time()."s. Cleanup: removing ".$_->{name}."\n";
unlink $_->{name};
}
#use Data::Dumper;
#print Dumper \@remote_files;
for ( my $i =scalar ( @remote_files ) - 1 ; $i >= 0; $i-- ) {
#reverse order remotees removal to removes directories in the end.
print "Cleanup: removing ".$remote_files[$i]->{name}."\n";
print "t=".elapsed_time()."s. Cleanup: removing ".$remote_files[$i]->{name}."\n";
if ($remote_files[$i]->{type} eq "file") {
`su $environment{username} -c \"STAGE_SVCCLASS=dev stager_rm -M $remote_files[$i]->{name}\"`;
}
......@@ -1528,13 +1529,13 @@ sub cleanup () {
# Final cleanup of the library.
# So far, get rid of leftover local files
END {
print "In CastorTapeTests::END: calling cleanup\n";
print "t=".elapsed_time()."s. In CastorTapeTests::END: calling cleanup\n";
cleanup();
print "Cleanup complete. Printing leftovers.\n";
print "t=".elapsed_time()."s. Cleanup complete. Printing leftovers.\n";
my $dbh = open_db();
print_leftovers ($dbh);
$dbh->disconnect();
print "End of leftovers\n";
print "t=".elapsed_time()."s. End of leftovers\n";
}
# # create a local
1; # this should be your last line
......@@ -76,7 +76,7 @@ sub main ()
my $userless; # workaround to prevent emacs from fscking the indentation.
#CastorTapeTests::print_leftovers ( $dbh );
$dbh->disconnect();
die "Leftovers found in the database. Aborting test.";
die "FATAL: Leftovers found in the database. Aborting test.";
}
$dbh->disconnect();
# Nuke and start clean
......
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