From 56e6bfe5edf420c1bd4645ee659c68766e96b538 Mon Sep 17 00:00:00 2001 From: Dalton Bohning Date: Tue, 20 Jun 2023 10:32:01 -0700 Subject: [PATCH] DAOS-13555 test: remove ftest/pool,container/global_handle (#12434) Test-tag: test_always_passes,vm Skip-unit-tests: true Skip-fault-injection-test: true Remove ftest/pool/global_handle.py Remove ftest/container/global_handle.py There is already coverage for these API functions in the cmocka framework. Required-githooks: true Signed-off-by: Dalton Bohning --- src/tests/ftest/container/global_handle.py | 119 ------------------- src/tests/ftest/container/global_handle.yaml | 20 ---- src/tests/ftest/pool/global_handle.py | 85 ------------- src/tests/ftest/pool/global_handle.yaml | 20 ---- 4 files changed, 244 deletions(-) delete mode 100644 src/tests/ftest/container/global_handle.py delete mode 100644 src/tests/ftest/container/global_handle.yaml delete mode 100644 src/tests/ftest/pool/global_handle.py delete mode 100644 src/tests/ftest/pool/global_handle.yaml diff --git a/src/tests/ftest/container/global_handle.py b/src/tests/ftest/container/global_handle.py deleted file mode 100644 index 00df09cadf5..00000000000 --- a/src/tests/ftest/container/global_handle.py +++ /dev/null @@ -1,119 +0,0 @@ -''' - (C) Copyright 2018-2023 Intel Corporation. - - SPDX-License-Identifier: BSD-2-Clause-Patent -''' -import ctypes -import traceback -from multiprocessing import sharedctypes - -from pydaos.raw import DaosPool, DaosContainer, DaosApiError, IOV -from avocado import fail_on - -from apricot import TestWithServers - - -class GlobalHandle(TestWithServers): - """Test the ability to share container handles among processes. - - :avocado: recursive - """ - - @fail_on(DaosApiError) - def check_handle(self, pool_glob_handle, uuidstr, cont_glob_handle, rank): - """Verify that the global handles can be turned into local handles. - - This gets run in a child process and verifies the global handles can be - turned into local handles in another process. - - Args: - pool_glob_handle (sharedctypes.RawValue): pool handle - uuidstr (sharedctypes.RawArray): pool uuid - cont_glob_handle (sharedctypes.RawValue): container handle - rank (int): pool svc rank - - Raises: - DaosApiError: if there was an error converting the pool handle or - using the local pool handle to create a container. - - """ - # setup the pool and connect using global handle - pool = DaosPool(self.context) - pool.uuid = uuidstr - pool.set_svc(rank) - buf = ctypes.cast( - pool_glob_handle.iov_buf, - ctypes.POINTER(ctypes.c_byte * pool_glob_handle.iov_buf_len)) - buf2 = bytearray() - buf2.extend(buf.contents) - pool_handle = pool.global2local( - self.context, pool_glob_handle.iov_len, - pool_glob_handle.iov_buf_len, buf2) - - # perform an operation that will use the new handle, if it - # doesn't throw an exception, then all is well. - pool.pool_query() - - # setup the container and then connect using the global handle - container = DaosContainer(self.context) - container.poh = pool_handle - buf = ctypes.cast( - cont_glob_handle.iov_buf, - ctypes.POINTER(ctypes.c_byte * cont_glob_handle.iov_buf_len)) - buf2 = bytearray() - buf2.extend(buf.contents) - _ = container.global2local( - self.context, cont_glob_handle.iov_len, - cont_glob_handle.iov_buf_len, buf2) - # just try one thing to make sure handle is good - container.query() - - def test_global_handle(self): - """Test Description: Use a pool handle in another process. - - :avocado: tags=all,daily_regression - :avocado: tags=vm - :avocado: tags=container - :avocado: tags=global_handle,container_global_handle,test_global_handle - """ - # initialize a python pool object then create the underlying - # daos storage and connect to it - self.add_pool(create=True, connect=True) - - # create a pool global handle - iov_len, buf_len, buf = self.pool.pool.local2global() - buftype = ctypes.c_byte * buf_len - c_buf = buftype.from_buffer(buf) - sct_pool_handle = ( - sharedctypes.RawValue( - IOV, ctypes.cast(c_buf, ctypes.c_void_p), buf_len, iov_len)) - - # create a container - self.add_container(self.pool) - self.container.open() - - try: - # create a container global handle - iov_len, buf_len, buf = self.container.container.local2global() - buftype = ctypes.c_byte * buf_len - c_buf = buftype.from_buffer(buf) - sct_cont_handle = ( - sharedctypes.RawValue( - IOV, ctypes.cast(c_buf, ctypes.c_void_p), buf_len, iov_len)) - - sct_pool_uuid = sharedctypes.RawArray( - ctypes.c_byte, self.pool.pool.uuid) - # this should work in the future but need on-line server addition - # arg_list = ( - # p = Process(target=check_handle, args=arg_list) - # p.start() - # p.join() - # for now verifying global handle in the same process which is not - # the intended use case - self.check_handle( - sct_pool_handle, sct_pool_uuid, sct_cont_handle, 0) - - except DaosApiError as error: - self.log.error(error) - self.log.error(traceback.format_exc()) - self.fail("Expecting to pass but test has failed.\n") diff --git a/src/tests/ftest/container/global_handle.yaml b/src/tests/ftest/container/global_handle.yaml deleted file mode 100644 index f38a0d2c013..00000000000 --- a/src/tests/ftest/container/global_handle.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# change host names to your reserved nodes, the -# required quantity is indicated by the placeholders -hosts: - test_servers: 1 -timeout: 60 -server_config: - name: daos_server - engines_per_host: 1 - engines: - 0: - targets: 4 - nr_xs_helpers: 0 - storage: - 0: - class: ram - scm_mount: /mnt/daos - system_ram_reserved: 1 -pool: - control_method: dmg - scm_size: 1073741824 diff --git a/src/tests/ftest/pool/global_handle.py b/src/tests/ftest/pool/global_handle.py deleted file mode 100644 index 306412bdc3f..00000000000 --- a/src/tests/ftest/pool/global_handle.py +++ /dev/null @@ -1,85 +0,0 @@ -''' - (C) Copyright 2018-2023 Intel Corporation. - - SPDX-License-Identifier: BSD-2-Clause-Patent -''' -import traceback - -from pydaos.raw import DaosPool, DaosContainer, DaosApiError - -from apricot import TestWithServers - - -class GlobalHandle(TestWithServers): - """Test the ability to share pool handles among processes. - - :avocado: recursive - """ - - def check_handle(self, buf_len, iov_len, buf, uuidstr, rank): - """Verify that the global handle can be turned into a local handle. - - This gets run in a child process and verifies the global handle can be - turned into a local handle in another process. - - Args: - buf_len (object): buffer length; 1st return value from - DaosPool.local2global() - iov_len (object): iov length; 2nd return value from - DaosPool.local2global() - buf (object): buffer; 3rd return value from DaosPool.local2global() - uuidstr (str): pool UUID - rank (int): pool svc rank - - Raises: - DaosApiError: if there was an error converting the pool handle or - using the local pool handle to create a container. - - """ - pool = DaosPool(self.context) - pool.set_uuid_str(uuidstr) - pool.set_svc(rank) - - # note that the handle is stored inside the pool as well - pool.global2local(self.context, iov_len, buf_len, buf) - - # perform some operations that will use the new handle - pool.pool_query() - container = DaosContainer(self.context) - container.create(pool.handle) - - def test_global_handle(self): - """Test ID: Jira-XXXX. - - Test Description: Use a pool handle in another process. - - :avocado: tags=all,daily_regression - :avocado: tags=vm - :avocado: tags=pool,global_handle - :avocado: tags=GlobalHandle,test_global_handle - """ - # initialize a python pool object then create the underlying - # daos storage - self.add_pool() - - # create a container just to make sure handle is good - self.add_container(self.pool) - - try: - # create a global handle - iov_len, buf_len, buf = self.pool.pool.local2global() - - # this should work in the future but need on-line server addition - # arg_list = (buf_len, iov_len, buf, pool.get_uuid_str(), 0) - # p = Process(target=check_handle, args=arg_list) - # p.start() - # p.join() - # for now verifying global handle in the same process which is not - # the intended use case - self.check_handle( - buf_len, iov_len, buf, self.pool.pool.get_uuid_str(), 0) - - except DaosApiError as error: - self.log.error(error) - self.log.error(traceback.format_exc()) - self.fail("Expecting to pass but test has failed.\n") diff --git a/src/tests/ftest/pool/global_handle.yaml b/src/tests/ftest/pool/global_handle.yaml deleted file mode 100644 index f38a0d2c013..00000000000 --- a/src/tests/ftest/pool/global_handle.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# change host names to your reserved nodes, the -# required quantity is indicated by the placeholders -hosts: - test_servers: 1 -timeout: 60 -server_config: - name: daos_server - engines_per_host: 1 - engines: - 0: - targets: 4 - nr_xs_helpers: 0 - storage: - 0: - class: ram - scm_mount: /mnt/daos - system_ram_reserved: 1 -pool: - control_method: dmg - scm_size: 1073741824