Commit 8dbdeb38 authored by Steven Murray's avatar Steven Murray
Browse files

Added $environment{svcclass}

parent 001f3129
......@@ -66,7 +66,6 @@ our @export = qw(
deleteAllStreamsTapeCopiesAndCastorFiles
executeSQLPlusScript
executeSQLPlusScriptNoError
wipeAndRecreateDefaultLxcastodev03
migrateToNewTapeGatewaySchema
stopAndSwitchToTapeGatewayd
stopAndSwitchToRtcpclientd
......@@ -160,7 +159,7 @@ sub read_config ( $ )
'migration_timeout', 'poll_interval', 'tapepool');
my @global_vars = ( 'dbDir' , 'tstDir', 'adminList', 'originalDbSchema',
'originalDropSchema', 'castor_single_subdirectory',
'castor_dual_subdirectory' );
'castor_dual_subdirectory', 'svcclass' );
for my $i ( @per_host_vars ) {
$environment{$i}=getConfParam('TAPETEST', $i.'_'.$local_host, $config_file );
}
......@@ -374,7 +373,7 @@ sub rfcp_localfile ( $$ )
} else {
die "Wrong file path in rfcp_localfile";
}
my $rfcp_ret=`su $environment{username} -c \"STAGE_SVCCLASS=dev rfcp $local $remote\" 2>&1`;
my $rfcp_ret=`su $environment{username} -c \"STAGE_SVCCLASS=$environment{svcclass} rfcp $local $remote\" 2>&1`;
my %remote_entry = ( 'name' => $remote,
'type' => "file",
'size' => $local_files[$local_index]->{size},
......@@ -408,7 +407,7 @@ sub stager_reget_from_tape ()
for ( my $i =0; $i < scalar (@remote_files); $i++ ) {
my %f = %{$remote_files[$i]};
if ( $f{type} eq "file" && $f{status} eq "on tape" ) {
`su $environment{username} -c \"STAGE_SVCCLASS=dev stager_get -M $f{name}\"`;
`su $environment{username} -c \"STAGE_SVCCLASS=$environment{svcclass} stager_get -M $f{name}\"`;
$remote_files[$i]->{status} = "being recalled";
print "t=".elapsed_time()."s. Initiated recall for $f{name}.\n";
}
......@@ -501,7 +500,7 @@ sub check_remote_entries ()
# hand over the file to the user
`chown $environment{username} $local_copy`;
# rfcp the recalled copy
`su $environment{username} -c \"STAGE_SVCCLASS=dev rfcp $entry{name} $local_copy\"`;
`su $environment{username} -c \"STAGE_SVCCLASS=$environment{svcclass} 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`;
......@@ -1348,22 +1347,22 @@ sub reinstall_stager_db()
# Fill database with the standard set-up for a dev-box
`nslistclass | grep NAME | awk '{print \$2}' | xargs -i enterFileClass --Name {} --GetFromCns`;
print `enterSvcClass --Name default --DiskPools default --DefaultFileSize 10485760 --FailJobsWhenNoSpace yes --NbDrives 1 --TapePool stager_dev03 --MigratorPolicy defaultMigrationPolicy --StreamPolicy streamPolicyAlwaysReturning1`;
print `enterSvcClass --Name dev --DiskPools extra --DefaultFileSize 10485760 --FailJobsWhenNoSpace yes`;
print `enterSvcClass --Name diskonly --DiskPools extra --ForcedFileClass temp --DefaultFileSize 10485760 --Disk1Behavior yes --FailJobsWhenNoSpace yes`;
`enterSvcClass --Name default --DiskPools default --DefaultFileSize 10485760 --FailJobsWhenNoSpace yes --NbDrives 1 --TapePool stager_dev03 --MigratorPolicy defaultMigrationPolicy --StreamPolicy streamPolicyAlwaysReturning1`;
`enterSvcClass --Name dev --DiskPools extra --DefaultFileSize 10485760 --FailJobsWhenNoSpace yes`;
`enterSvcClass --Name diskonly --DiskPools extra --ForcedFileClass temp --DefaultFileSize 10485760 --Disk1Behavior yes --FailJobsWhenNoSpace yes`;
print `moveDiskServer default $diskServers[0]`;
print `moveDiskServer extra $diskServers[1]`;
print `rmAdminNode -r -R -n $diskServers[0]`;
print `rmAdminNode -r -R -n $diskServers[1]`;
`moveDiskServer default $diskServers[0]`;
`moveDiskServer extra $diskServers[1]`;
`rmAdminNode -r -R -n $diskServers[0]`;
`rmAdminNode -r -R -n $diskServers[1]`;
# Add a tape-pool to dev service-class
my $tapePool = get_environment('tapepool');
print `modifySvcClass --Name dev --AddTapePool $tapePool --MigratorPolicy defaultMigrationPolicy --StreamPolicy streamPolicyAlwaysReturning1`;
`modifySvcClass --Name dev --AddTapePool $tapePool --MigratorPolicy defaultMigrationPolicy --StreamPolicy streamPolicyAlwaysReturning1`;
# Set the number of drives on the default and dev service-classes to desired number for each
print `modifySvcClass --Name default --NbDrives 1`;
print `modifySvcClass --Name dev --NbDrives 2`;
`modifySvcClass --Name default --NbDrives 1`;
`modifySvcClass --Name dev --NbDrives 2`;
}
......@@ -1457,7 +1456,7 @@ sub cleanup () {
#reverse order remotees removal to removes directories in the end.
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}\"`;
`su $environment{username} -c \"STAGE_SVCCLASS=$environment{svcclass} stager_rm -M $remote_files[$i]->{name}\"`;
}
`su $environment{username} -c \"nsrm $remote_files[$i]->{name}\"`;
}
......
......@@ -13,7 +13,7 @@ TAPETEST tapepool_lxcastordev03 stager_dev03_2
TAPETEST username_lxcastordev04 murrayc3
TAPETEST checkout_location_lxcastordev04 /afs/cern.ch/user/m/murrayc3/castor/checkout/v2_1_9_7_gateway
TAPETEST file_size_lxcastordev04 10485760
TAPETEST file_number_lxcastordev04 10
TAPETEST file_number_lxcastordev04 2
TAPETEST castor_directory_lxcastordev04 /castor/cern.ch/dev/m/murrayc3/
TAPETEST migration_timeout_lxcastordev04 600
TAPETEST poll_interval_lxcastordev04 5
......@@ -28,3 +28,4 @@ TAPETEST originalDbSchema stager_oracle_create.sql
TAPETEST originalDropSchema drop_oracle_schema.sql
TAPETEST castor_single_subdirectory migrate_and_recall_10_single_tape_copy_files
TAPETEST castor_dual_subdirectory migrate_and_recall_10_dual_tape_copy_files
TAPETEST svcclass default
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