Commit cfaa9532 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.

Started a perl modules to factorize together all the utilities for testing.
parent e42bbbe4
# CastorTapeTests package
#
# Not in a directory structure yet...
# Intended to contain all the utilities to run tape tests.
package CastorTapeTests;
my $package_name="CastorTapeTests";
use strict;
$VERSION = 1.00;
@ISA = qw(Exporter);
@export = qw(func1,
fund2,
); # Symbols to autoexport (:DEFAULT tag)
# keep track of the locally created files and of the recalled and locally rfcped files.
my @local_files;
# keep track of the files migrated in castor.
my @remote_files;
# keep track of the test environement (and definition of the defaults).
my %environemnt = {
'uid' => 'canoc3';
'allowed_stagers' => [ 'lxcastordev03', 'lxcastordev04' ];
};
# create a local seed file, returning the index to the file.
# Take 1 parameter: the size in
sub make_seed ( $ )
{
my $size = shift;
((defined $size) || ($size < 0)) or die "In $package_name::make_seed: size not defined";
my $file_name = `mktemp`;
my $megs = int ($size/(1024*1024));
my $kilos = int (($size%(1024*1024))/1024);
my $bytes = $size % 1024;
my $kflags="";
my $bflags="";
my $starttime = `date +%s`;
if ($megs != 0) {
print `dd if=/dev/urandom of=$file_name bs=1M count=$megs`;
$kflags=" oflags=append";
$bflags=" oflags=append";
}
if ($kbytes != 0) {
print `dd if=/dev/urandom of=$file_name bs=1K count=$kbytes $kflags`;
$bflags=" oflags=append";
}
if ($bytes != 0) {
print `dd if=/dev/urandom of=$file_name bs=1 count=$bytes $bflags`;
}
# Check that everything went fine
if (!-e $file_name) {
die "In $package_name::make_seed: file $file_name not created";
}
if (! (-s $file_name) == $size) {
die "In $package_name::make_seed: file $file_name created with wrong size";
}
# Hand over the file to the user
print `chown $environment{'uid'} $file_name`;
# We call is good enough
my %file_entry = { 'name' => $file_name,
'size' => $size };
my $file_index = push @local_files, \%file_entry;
return $file_index;
}
# # 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