Skip to content

Commit

Permalink
Handle optional rodsadmin group
Browse files Browse the repository at this point in the history
  • Loading branch information
kjsanger committed Oct 13, 2023
1 parent f954f8d commit 377c667
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions t/lib/WTSI/NPG/iRODS/GroupAdminTest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ my $have_admin_rights =
my $group_prefix = 'ss_';

# Groups to be added to the test iRODS
my @irods_groups = map { $group_prefix . $_ } (0 .. 100);
my @irods_groups = map { $group_prefix . $_ } (0 .. 5);
my @irods_users = qw(user_foo user_bar);

my $test_irods = WTSI::NPG::iRODS->new(environment => \%ENV,
Expand Down Expand Up @@ -76,8 +76,9 @@ sub lg : Test(5) {
skip 'No admin rights to create test groups', 2;
}

my @observed_groups = sort $iga->lg;
my @expected_groups = sort ('public', 'rodsadmin', @irods_groups);
# Ignore the rodsadmin group as it is not present in iRODS >4.3.0
my @observed_groups = sort grep { $_ ne 'rodsadmin' } $iga->lg;
my @expected_groups = sort ('public', @irods_groups);
is_deeply(\@observed_groups, \@expected_groups, 'Expected groups found') or
diag explain \@observed_groups;

Expand Down
4 changes: 2 additions & 2 deletions t/lib/WTSI/NPG/iRODSTest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ sub list_groups : Test(1) {
my $irods = WTSI::NPG::iRODS->new(environment => \%ENV,
strict_baton_version => 0);

ok(grep { /^rodsadmin$/ } $irods->list_groups, 'Listed the rodsadmin group');
ok(grep { /^public/ } $irods->list_groups, 'Listed the public group');
}

sub group_exists : Test(2) {
my $irods = WTSI::NPG::iRODS->new(environment => \%ENV,
strict_baton_version => 0);

ok($irods->group_exists('rodsadmin'), 'The rodsadmin group exists');
ok($irods->group_exists('public'), 'The public group exists');
ok(!$irods->group_exists('no_such_group'), 'An absent group does not exist');
}

Expand Down

0 comments on commit 377c667

Please sign in to comment.