Skip to content

Commit

Permalink
DAOS-15776 test: remove DataMoverTestBase.create_pool (#15079) (#15254)
Browse files Browse the repository at this point in the history
Replace DataMoverTestBase.create_pool with self.get_pool

Signed-off-by: Dalton Bohning <dalton.bohning@intel.com>
  • Loading branch information
daltonbohning authored Oct 7, 2024
1 parent 9c8746e commit b116591
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 54 deletions.
4 changes: 2 additions & 2 deletions src/tests/ftest/datamover/copy_procs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
(C) Copyright 2020-2022 Intel Corporation.
(C) Copyright 2020-2024 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -46,7 +46,7 @@ def test_copy_procs(self):
:avocado: tags=DmvrCopyProcs,test_copy_procs
"""
# Create pool and containers
pool1 = self.create_pool()
pool1 = self.get_pool()
cont1 = self.get_container(pool1)
cont2 = self.get_container(pool1)

Expand Down
6 changes: 2 additions & 4 deletions src/tests/ftest/datamover/dst_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ def run_dm_dst_create(self, tool, cont_type, api, check_props):
self.set_api(api)

# Create 1 pool
pool1 = self.create_pool()
pool1.connect(2)
pool1 = self.get_pool()

# Create a source cont
cont1 = self.get_container(pool1, type=cont_type)
Expand Down Expand Up @@ -98,8 +97,7 @@ def run_dm_dst_create(self, tool, cont_type, api, check_props):
self.verify_cont(cont3, api, check_props, src_props)

# Create another pool
pool2 = self.create_pool()
pool2.connect(2)
pool2 = self.get_pool()

result = self.run_datamover(
self.test_id + " cont1 to cont4 (different pool) (empty cont)",
Expand Down
4 changes: 2 additions & 2 deletions src/tests/ftest/datamover/large_dir.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
(C) Copyright 2020-2022 Intel Corporation.
(C) Copyright 2020-2024 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -46,7 +46,7 @@ def run_dm_large_dir(self, tool):
file_size = self.params.get("bytes", self.mdtest_cmd.namespace)

# create pool and cont1
pool = self.create_pool()
pool = self.get_pool()
cont1 = self.get_container(pool)

# run mdtest to create data in cont1
Expand Down
4 changes: 2 additions & 2 deletions src/tests/ftest/datamover/large_file.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
(C) Copyright 2020-2023 Intel Corporation.
(C) Copyright 2020-2024 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -43,7 +43,7 @@ def run_dm_large_file(self, tool):
self.fail("Failed to get ior processes for {}".format(self.tool))

# create pool and cont
pool = self.create_pool()
pool = self.get_pool()
cont1 = self.get_container(pool)

# create initial data in cont1
Expand Down
4 changes: 2 additions & 2 deletions src/tests/ftest/datamover/negative.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_dm_bad_params_dcp(self):
start_dfuse(self, dfuse)

# Create a test pool
pool1 = self.create_pool()
pool1 = self.get_pool()

# Create a special container to hold UNS entries
uns_cont = self.get_container(pool1)
Expand Down Expand Up @@ -215,7 +215,7 @@ def test_dm_bad_params_fs_copy(self):
start_dfuse(self, dfuse)

# Create a test pool
pool1 = self.create_pool()
pool1 = self.get_pool()

# Create a special container to hold UNS entries
uns_cont = self.get_container(pool1)
Expand Down
4 changes: 2 additions & 2 deletions src/tests/ftest/datamover/obj_large_posix.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
(C) Copyright 2020-2022 Intel Corporation.
(C) Copyright 2020-2024 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -37,7 +37,7 @@ def run_dm_obj_large_posix(self, tool):
file_size = self.params.get("bytes", "/run/mdtest/*")

# Create pool1 and cont1
pool1 = self.create_pool()
pool1 = self.get_pool()
cont1 = self.get_container(pool1)

# Create a large directory in cont1
Expand Down
8 changes: 3 additions & 5 deletions src/tests/ftest/datamover/obj_small.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
(C) Copyright 2020-2023 Intel Corporation.
(C) Copyright 2020-2024 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -58,8 +58,7 @@ def run_dm_obj_small(self, tool):
self.set_tool(tool)

# Create pool1
pool1 = self.create_pool()
pool1.connect(2)
pool1 = self.get_pool()

# Create cont1
cont1 = self.get_container(pool1)
Expand All @@ -85,8 +84,7 @@ def run_dm_obj_small(self, tool):
self.num_akeys_array, self.akey_sizes, self.akey_extents)

# Create pool2
pool2 = self.create_pool()
pool2.connect(2)
pool2 = self.get_pool()

# Clone cont1 to a new cont3 in pool2
result = self.run_datamover(
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/datamover/posix_meta_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def run_dm_posix_meta_entry(self, tool):
start_dfuse(self, dfuse)

# Create 1 pool
pool1 = self.create_pool()
pool1 = self.get_pool()

# Create 1 source container with test data
cont1 = self.get_container(pool1)
Expand Down
5 changes: 2 additions & 3 deletions src/tests/ftest/datamover/posix_preserve_props.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
(C) Copyright 2020-2023 Intel Corporation.
(C) Copyright 2020-2024 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -56,8 +56,7 @@ def run_dm_preserve_props(self, tool, cont_type, api):
self.set_api(api)

# Create 1 pool
pool1 = self.create_pool()
pool1.connect(2)
pool1 = self.get_pool()

# set the path to read and write container properties
self.preserve_props_path = join(self.tmp, "cont_props.h5")
Expand Down
4 changes: 2 additions & 2 deletions src/tests/ftest/datamover/posix_subsets.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
(C) Copyright 2020-2023 Intel Corporation.
(C) Copyright 2020-2024 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -54,7 +54,7 @@ def run_dm_posix_subsets(self, tool):
start_dfuse(self, dfuse)

# Create 1 pool
pool1 = self.create_pool()
pool1 = self.get_pool()

# create dfuse containers to test copying to dfuse subdirectories
dfuse_cont1 = self.get_container(pool1)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/datamover/posix_symlinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def run_dm_posix_symlinks(self, tool):
start_dfuse(self, dfuse)

# Create 1 pool
pool1 = self.create_pool()
pool1 = self.get_pool()

# Create a special container to hold UNS entries
uns_cont = self.get_container(pool1)
Expand Down
6 changes: 3 additions & 3 deletions src/tests/ftest/datamover/posix_types.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
(C) Copyright 2020-2023 Intel Corporation.
(C) Copyright 2020-2024 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -68,8 +68,8 @@ def run_dm_posix_types(self, tool):
start_dfuse(self, dfuse)

# Create 2 pools
pool1 = self.create_pool(label='pool1')
pool2 = self.create_pool(label='pool2')
pool1 = self.get_pool(label='pool1')
pool2 = self.get_pool(label='pool2')

# Create a special container to hold UNS entries
uns_cont = self.get_container(pool1)
Expand Down
6 changes: 3 additions & 3 deletions src/tests/ftest/datamover/serial_large_posix.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
(C) Copyright 2020-2022 Intel Corporation.
(C) Copyright 2020-2024 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -43,15 +43,15 @@ def run_dm_serial_large_posix(self, tool):
file_size = self.params.get("bytes", "/run/mdtest/*")

# Create pool1 and cont1
pool1 = self.create_pool()
pool1 = self.get_pool()
cont1 = self.get_container(pool1)

# Create a large directory in cont1
self.mdtest_cmd.write_bytes.update(file_size)
self.run_mdtest_with_params("DAOS", "/", pool1, cont1, flags=mdtest_flags[0])

# Create pool2
pool2 = self.create_pool()
pool2 = self.get_pool()

# Use dfuse as a shared intermediate for serialize + deserialize
dfuse_cont = self.get_container(pool1)
Expand Down
8 changes: 3 additions & 5 deletions src/tests/ftest/datamover/serial_small.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
(C) Copyright 2020-2022 Intel Corporation.
(C) Copyright 2020-2024 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -56,8 +56,7 @@ def run_dm_serial_small(self, tool):
self.set_tool(tool)

# Create pool1
pool1 = self.create_pool()
pool1.connect(2)
pool1 = self.get_pool()

# Create cont1
cont1 = self.get_container(pool1)
Expand All @@ -69,8 +68,7 @@ def run_dm_serial_small(self, tool):
self.num_akeys_array, self.akey_sizes, self.akey_extents)

# Create pool2
pool2 = self.create_pool()
pool2.connect(2)
pool2 = self.get_pool()

# Serialize/Deserialize cont1 to a new cont2 in pool2
result = self.run_datamover(
Expand Down
4 changes: 2 additions & 2 deletions src/tests/ftest/deployment/basic_checkout.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
(C) Copyright 2018-2023 Intel Corporation.
(C) Copyright 2018-2024 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
Expand Down Expand Up @@ -120,7 +120,7 @@ def test_basic_checkout_dm(self):
self.ior_ppn = self.ppn

# create pool and container
pool = self.create_pool()
pool = self.get_pool()
cont = self.get_container(pool, oclass=self.ior_cmd.dfs_oclass.value)

# run datamover
Expand Down
15 changes: 0 additions & 15 deletions src/tests/ftest/util/data_mover_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ def __init__(self, *args, **kwargs):
self.ddeserialize_cmd = None
self.fs_copy_cmd = None
self.cont_clone_cmd = None
self.pool = []
self.dfuse_hosts = None
self.num_run_datamover = 0 # Number of times run_datamover was called

Expand Down Expand Up @@ -306,20 +305,6 @@ def _validate_param_type(self, param_type):
self.fail("Invalid param_type: {}".format(_type))
return None

def create_pool(self, **params):
"""Create a TestPool object and adds to self.pool.
Returns:
TestPool: the created pool
"""
pool = self.get_pool(connect=False, **params)

# Save the pool
self.pool.append(pool)

return pool

def parse_create_cont_label(self, output):
"""Parse a uuid or label from create container output.
Expand Down

0 comments on commit b116591

Please sign in to comment.