Skip to content

Commit

Permalink
[76] Add test showing rodsadmins do not need permission to start moni…
Browse files Browse the repository at this point in the history
…toring collections.
  • Loading branch information
korydraughn committed Apr 25, 2024
1 parent cd1bcd1 commit 574a6de
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions packaging/test_rule_engine_plugin_logical_quotas.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,35 @@ def test_data_objects_having_only_stale_replicas_can_be_removed__issue_111(self)
self.user.assert_icommand(['irm', '-f', data_object])
self.assert_quotas(col, expected_number_of_objects=0, expected_size_in_bytes=len(contents))

@unittest.skipIf(test.settings.RUN_IN_TOPOLOGY, "Skip for Topology Testing")
def test_rodsadmin_does_not_need_permission_on_the_collection_to_start_monitoring_it__issue_76(self):
config = IrodsConfig()

with lib.file_backed_up(config.server_config_path):
self.enable_rule_engine_plugin(config)

test_group = 'lq_group76'
self.admin1.assert_icommand(['iadmin', 'mkgroup', test_group])

test_collection = f'{self.admin1.session_collection}/lq_col76'
self.admin1.assert_icommand(['imkdir', test_collection])

try:
# Make it so that the group is the only entity that has permissions on the collection.
self.admin1.assert_icommand(['ichmod', 'own', test_group, test_collection])
self.admin1.assert_icommand(['ichmod', 'null', self.admin1.username, test_collection])
self.admin1.assert_icommand(['ils', '-A', test_collection], 'STDOUT') # Debugging.

# Show the rodsadmin is able to instruct the plugin to start monitoring the collection
# even though they don't have permissions set on the data object.
json_string = json.dumps({'operation': 'logical_quotas_start_monitoring_collection', 'collection': test_collection})
self.admin1.assert_icommand(['irule', '-r', 'irods_rule_engine_plugin-logical_quotas-instance', json_string, 'null', 'null'])

finally:
# Restore the rodsadmin's permission on their collection for clean-up.
self.admin1.run_icommand(['ichmod', 'own', self.admin1.username, test_collection])
self.admin1.run_icommand(['irmdir', test_collection])

#
# Utility Functions
#
Expand Down

0 comments on commit 574a6de

Please sign in to comment.