Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
castor
CASTOR
Commits
001f3129
Commit
001f3129
authored
Nov 01, 2010
by
Steven Murray
Browse files
Stage id and group now obtained using 'id stage'. There is no longer a need to
configure this.
parent
b6a74ed1
Changes
2
Hide whitespace changes
Inline
Side-by-side
test/tapegateway_release_tests/CastorTapeTests.pm
View file @
001f3129
...
...
@@ -40,6 +40,8 @@ our $VERSION = 1.00;
our
@ISA
=
qw(Exporter)
;
our
@export
=
qw(
get_uid_for_username
get_gid_for_username
get_disk_servers
read_config
check_environment
...
...
@@ -73,6 +75,7 @@ our @export = qw(
check_leftovers_poll_timeout
nullize_arrays_undefs
print_leftovers
reinstall_stager_db
getOrastagerconfigParam
cleanup
elapsed_time
...
...
@@ -91,6 +94,39 @@ my %environment = (
my
$time_reference
;
# Returns the numeric user ID of the user with given name
sub
get_uid_for_username
(
$
)
{
my
$username
=
shift
;
my
$id_result
=
`
id
$username
`;
chomp
(
$id_result
);
if
(
$id_result
=~
m/uid=(\d+)/
)
{
return
$
1
;
}
else
{
die
("
Failed to get uid for username
\"
$username
\"\n
");
}
}
# Returns the numeric group ID of the user with given name
sub
get_gid_for_username
(
$
)
{
my
$username
=
shift
;
my
$id_result
=
`
id
$username
`;
chomp
(
$id_result
);
if
(
$id_result
=~
m/gid=(\d+)/
)
{
return
$
1
;
}
else
{
die
("
Failed to get uid for username
\"
$username
\"\n
");
}
}
# Based on the output of bhosts, this subroutine returns the hostnames of the
# disk-servers sorted alphabetically.
sub
get_disk_servers
()
...
...
@@ -122,8 +158,8 @@ sub read_config ( $ )
$environment
{
hostname
}
=
$local_host
;
my
@per_host_vars
=
(
'
username
',
'
checkout_location
',
'
file_size
',
'
file_number
',
'
castor_directory
',
'
migration_timeout
',
'
poll_interval
',
'
tapepool
');
my
@global_vars
=
(
'
dbDir
'
,
'
tstDir
',
'
stageUid
',
'
stageGid
',
'
adminList
',
'
originalDbSchema
',
'
originalDropSchema
',
'
castor_single_subdirectory
',
my
@global_vars
=
(
'
dbDir
'
,
'
tstDir
',
'
adminList
',
'
originalDbSchema
',
'
originalDropSchema
',
'
castor_single_subdirectory
',
'
castor_dual_subdirectory
'
);
for
my
$i
(
@per_host_vars
)
{
$environment
{
$i
}
=
getConfParam
('
TAPETEST
',
$i
.
'
_
'
.
$local_host
,
$config_file
);
...
...
@@ -1272,8 +1308,8 @@ sub reinstall_stager_db()
$originalDropSchemaFullpath
,
"
Dropping schema
");
my
$stage
G
id
=
$environment
{
stage
Gid
}
;
my
$stage
U
id
=
$environment
{
stage
Uid
}
;
my
$stage
U
id
=
&get_uid_for_username
('
stage
')
;
my
$stage
G
id
=
&get_gid_for_username
('
stage
')
;
my
$adminList
=
$environment
{
adminList
};
my
$hacked_creation
=
`
mktemp
`;
...
...
test/tapegateway_release_tests/tapetests-lxcastordev.conf
View file @
001f3129
...
...
@@ -23,8 +23,6 @@ TAPETEST tapepool_lxcastordev04 stager_dev04
# 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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment