Skip to content

Commit deaf9f4

Browse files
committed
test and CMake line for atomic acls
1 parent c35efc7 commit deaf9f4

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

indexing.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ install(
6666
FILES
6767
${CMAKE_SOURCE_DIR}/packaging/test_plugin_indexing.py
6868
${CMAKE_SOURCE_DIR}/packaging/atomic_metadata_ops.py
69+
${CMAKE_SOURCE_DIR}/packaging/atomic_acl_ops.py
6970
DESTINATION ${IRODS_HOME_DIRECTORY}/scripts/irods/test
7071
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
7172
COMPONENT ${IRODS_PACKAGE_COMPONENT_POLICY_NAME}

packaging/test_plugin_indexing.py

+24-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import zipfile
1313
import subprocess
14-
from time import sleep
14+
from time import sleep, time
1515
from textwrap import dedent
1616
from datetime import datetime as _datetime
1717

@@ -932,6 +932,29 @@ def logical_filesystem_for_indexing(self,objects,session):
932932
for p in collections_to_delete:
933933
session.assert_icommand(['irm', '-rf', p],'STDOUT','')
934934

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+
935958
def test_indexing_with_atomic_metadata_ops_66(self):
936959
with indexing_plugin__installed():
937960
test_coll = 'testcoll_66'

0 commit comments

Comments
 (0)