Commit 6a4459d7 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 many synthax problems, moved hardcoded pathes into a configuration file.
Added config file.
Re-added perl function which were lost in the copying to the perl module.
parent 8776a9a7
# Config file for tests
# Host-dependant parameters
TAPETEST username_lxcastordev03 canoc3
TAPETEST checkout_location_lxcastordev03 /var/scratch/canoc3/test_gateway_r21263
# General parameters
TAPETEST dbDir castor/db
TAPETEST tstDir test/tapegateway_release_tests
TAPETEST stageUid 14029
TAPETEST stageGid 1474
TAPETEST adminList :1028
TAPETEST originalDbSchema stager_oracle_create.sql
TAPETEST originalDropSchema drop_oracle_schema.sql
\ No newline at end of file
......@@ -32,6 +32,7 @@ use strict;
use POSIX;
use DBI;
use DBD::Oracle qw(:ora_types);
use CastorTapeTests;
# Constants
......@@ -49,7 +50,7 @@ my $dbDir = 'castor/db';
my $tstDir = 'test/tapegateway_release_tests';
sub goodDaySingleAndDualCopyTest ( $$ );
sub main ();
# Hook for main.
main();
......@@ -57,21 +58,25 @@ main();
# Main: check for leftovers in DB, print out, return exit code accordingly
sub main ()
{
my $dbh = open_db();
# Initialize: setup the environment
CastorTapeTests::read_config ("./tapetests-lxcastordev.conf" );
CastorTapeTests::check_environment ();
my $dbh = CastorTapeTests::open_db();
my $ret = 0;
if (check_leftovers ( $dbh )) {
print_leftovers ( $dbh );
if (CastorTapeTests::check_leftovers ( $dbh )) {
CastorTapeTests::print_leftovers ( $dbh );
$dbh->disconnect();
exit 1;
}
$dbh->disconnect();
# Nuke and start clean
CastorTapeTest::wipeAndRecreateDefaultLxcastodev03();
my $seed_index = CastorTapeTest::make_seed (100*1024*1024);
CastorTapeTests::wipeAndRecreateDefaultLxcastodev03();
my $seed_index = CastorTapeTests::make_seed (100*1024*1024);
# Test with the old system
CastorTapeTest::startDaemons();
CastorTapeTests::startDaemons();
# On first run, clean house
print "Cleaning up test directories /castor/cern.ch/dev/c/canoc3/migrate_and_recall_10_{single,dual}_tape_copy_files\n";
......@@ -88,17 +93,17 @@ sub main ()
goodDaySingleAndDualCopyTest ($seed_index, 10);
# Migrate to the new system, with tape gateway, still running rtcpclientd
$dbh=CastorTapeTest::open_db();
CastorTapeTest::migrateToNewTapeGatewaySchema ();
CastorTapeTest::stopAndSwitchToTapeGatewayd ( $dbh );
CastorTapeTest::startDaemons();
$dbh=CastorTapeTests::open_db();
CastorTapeTests::migrateToNewTapeGatewaySchema ();
CastorTapeTests::stopAndSwitchToTapeGatewayd ( $dbh );
CastorTapeTests::startDaemons();
# Second iteration of the test
goodDaySingleAndDualCopyTest ($seed_index, 10);
# Switch to tape gateway
CastorTapeTest::stopAndSwitchToTapeGatewayd ( $dbh );
CastorTapeTest::startDaemons();
CastorTapeTests::stopAndSwitchToTapeGatewayd ( $dbh );
CastorTapeTests::startDaemons();
# Third iteration of the test
goodDaySingleAndDualCopyTest ($seed_index, 10);
......@@ -116,12 +121,13 @@ sub goodDaySingleAndDualCopyTest ( $$ )
for my $sd ('single', 'dual') {
for my $i (0 .. ($file_number - 1) ) {
my $file_name="/tmp/".`uuidgen`;
CastorTapeTest::make_localfile( $seed_index, $file_name );
chomp $file_name;
CastorTapeTests::make_localfile( $seed_index, $file_name );
`su canoc3 -c \"rfcp $file_name /castor/cern.ch/dev/c/canoc3/migrate_and_recall_10_${sd}_tape_copy_files\"`;
}
}
my $dbh=CastorTapeTest::open_db();
if ( check_leftovers_poll_timeout ( $dbh, 2, 60 )) {
my $dbh=CastorTapeTests::open_db();
if ( CastorTapeTests::check_leftovers_poll_timeout ( $dbh, 2, 60 )) {
print "Timeout expired for initial cleanup of files.";
print_leftovers ($dbh);
die;
......
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