|
11 | 11 |
|
12 | 12 | import zipfile
|
13 | 13 | import subprocess
|
14 |
| -from time import sleep |
| 14 | +from time import sleep, time |
15 | 15 | from textwrap import dedent
|
16 | 16 | from datetime import datetime as _datetime
|
17 | 17 |
|
@@ -932,6 +932,29 @@ def logical_filesystem_for_indexing(self,objects,session):
|
932 | 932 | for p in collections_to_delete:
|
933 | 933 | session.assert_icommand(['irm', '-rf', p],'STDOUT','')
|
934 | 934 |
|
| 935 | + def test_indexing_with_atomic_acl_ops__81(self): |
| 936 | + with indexing_plugin__installed(): |
| 937 | + test_coll = self.test_coll_name() |
| 938 | + INDEX = DEFAULT_METADATA_INDEX + "__81_{:%s.%f}".format(_datetime.now()) |
| 939 | + create_metadata_index (INDEX) |
| 940 | + try: |
| 941 | + with session.make_session_for_existing_admin() as admin_session: |
| 942 | + admin_session.assert_icommand("""imeta set -C {0} irods::indexing::index {1}::metadata elasticsearch""".format(test_coll, INDEX)) |
| 943 | + admin_session.assert_icommand("itouch {0}/testobj".format(test_coll)) |
| 944 | + sleep(5) |
| 945 | + # hit the apply_atomic_acl api |
| 946 | + self.assertIsNotNone (repeat_until (operator.eq, True) (self.delay_queue_is_empty) (admin_session)) |
| 947 | + admin_session.assert_icommand("""cd ${{HOME}} ; python3 ~/scripts/irods/test/atomic_acl_ops.py -v {self.venv_dir} """ |
| 948 | + """ '/{0.zone_name}/home/{0.username}'/{test_coll}/testobj {self.user0.username} write """ |
| 949 | + """ {self.user1.username} read """.format(admin_session, **locals()), use_unsafe_shell=True) |
| 950 | + # Check new permissions are reflected in the index |
| 951 | + self.assertIsNotNone( repeat_until(operator.eq, 1, transform=number_of_hits, |
| 952 | + ) (search_index_for_userPermissions_user_name) (INDEX, self.user0.username)) |
| 953 | + self.assertEqual(1, number_of_hits(search_index_for_userPermissions_user_name (INDEX, self.user1.username))) |
| 954 | + finally: |
| 955 | + delete_metadata_index (INDEX) |
| 956 | + admin_session.assert_icommand("irm -fr {0}".format(test_coll)) |
| 957 | + |
935 | 958 | def test_indexing_with_atomic_metadata_ops_66(self):
|
936 | 959 | with indexing_plugin__installed():
|
937 | 960 | test_coll = 'testcoll_66'
|
|
0 commit comments