Skip to content

Commit

Permalink
[irods#7476] Update tests for new replication rules
Browse files Browse the repository at this point in the history
Also, skip a bunch of redundant tests in the replication-to/from-hierarchy
cases. This also allows a few non-deterministic tests in the same suite to
be run because we can determine the behavior and write a test for it now.
  • Loading branch information
alanking committed Feb 13, 2024
1 parent 702d062 commit 3d7f487
Show file tree
Hide file tree
Showing 3 changed files with 377 additions and 389 deletions.
17 changes: 12 additions & 5 deletions scripts/irods/test/resource_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,11 +923,14 @@ def test_irepl_over_existing_second_replica__ticket_1705(self):
self.admin.assert_icommand("irepl " + filename) # replicate to default resource
self.admin.assert_icommand("ils -L " + filename, 'STDOUT_SINGLELINE', filename) # for debugging
# replicate overtop default resource
self.admin.assert_icommand(['irepl', filename], 'STDERR', 'SYS_NOT_ALLOWED')
# This is allowed, but will result in a no-op because default resource already has good replicas and should not
# have any stale or missing replicas.
self.admin.assert_icommand(['irepl', '-S', self.testresc, '-R', self.admin.default_resource, filename])
# should not have a replica 2
self.admin.assert_icommand_fail("ils -L " + filename, 'STDOUT_SINGLELINE', [" 2 ", " & " + filename])
# replicate overtop test resource
self.admin.assert_icommand(['irepl', '-R', self.testresc, filename], 'STDERR', 'SYS_NOT_ALLOWED')
# This is allowed, but will result in a no-op because testresc already has a good replica.
self.admin.assert_icommand(['irepl', '-S', self.admin.default_resource, '-R', self.testresc, filename])
# should not have a replica 2
self.admin.assert_icommand_fail("ils -L " + filename, 'STDOUT_SINGLELINE', [" 2 ", " & " + filename])
# local cleanup
Expand All @@ -947,13 +950,17 @@ def test_irepl_over_existing_third_replica__ticket_1705(self):
self.admin.assert_icommand("irepl -R " + self.testresc + " " + filename) # replicate to test resource
self.admin.assert_icommand("irepl -R thirdresc " + filename) # replicate to third resource
# replicate overtop default resource
self.admin.assert_icommand(['irepl', filename], 'STDERR', 'SYS_NOT_ALLOWED')
# This is allowed, but will result in a no-op because default resource already has good replicas and should not
# have any stale or missing replicas.
self.admin.assert_icommand(['irepl', '-S', self.testresc, '-R', self.admin.default_resource, filename])
self.admin.assert_icommand("ils -L " + filename, 'STDOUT_SINGLELINE', filename) # for debugging
# replicate overtop test resource
self.admin.assert_icommand(['irepl', '-R', self.testresc, filename], 'STDERR', 'SYS_NOT_ALLOWED')
# This is allowed, but will result in a no-op because testresc already has a good replica.
self.admin.assert_icommand(['irepl', '-S', self.admin.default_resource, '-R', self.testresc, filename])
self.admin.assert_icommand("ils -L " + filename, 'STDOUT_SINGLELINE', filename) # for debugging
# replicate overtop third resource
self.admin.assert_icommand(['irepl', '-R', 'thirdresc', filename], 'STDERR', 'SYS_NOT_ALLOWED')
# This is allowed, but will result in a no-op because thirdresc already has a good replica.
self.admin.assert_icommand(['irepl', '-S', self.admin.default_resource, '-R', 'thirdresc', filename])
self.admin.assert_icommand("ils -L " + filename, 'STDOUT_SINGLELINE', filename) # for debugging
# should not have a replica 3
self.admin.assert_icommand_fail("ils -L " + filename, 'STDOUT_SINGLELINE', [" 3 ", " & " + filename])
Expand Down
Loading

0 comments on commit 3d7f487

Please sign in to comment.