From 377c66747c71f5ef4eb8d3c1bbe69be92cf1d499 Mon Sep 17 00:00:00 2001 From: Keith James Date: Fri, 13 Oct 2023 12:53:37 +0100 Subject: [PATCH] Handle optional rodsadmin group --- t/lib/WTSI/NPG/iRODS/GroupAdminTest.pm | 7 ++++--- t/lib/WTSI/NPG/iRODSTest.pm | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/t/lib/WTSI/NPG/iRODS/GroupAdminTest.pm b/t/lib/WTSI/NPG/iRODS/GroupAdminTest.pm index 758312b0..6f2b61a8 100644 --- a/t/lib/WTSI/NPG/iRODS/GroupAdminTest.pm +++ b/t/lib/WTSI/NPG/iRODS/GroupAdminTest.pm @@ -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, @@ -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; diff --git a/t/lib/WTSI/NPG/iRODSTest.pm b/t/lib/WTSI/NPG/iRODSTest.pm index 6406ef26..d638f258 100644 --- a/t/lib/WTSI/NPG/iRODSTest.pm +++ b/t/lib/WTSI/NPG/iRODSTest.pm @@ -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'); }