summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNitin Goyal <nigoyal@redhat.com>2020-02-07 21:59:50 +0530
committerNitin Goyal <nigoyal@redhat.com>2020-02-20 15:09:46 +0530
commitb99a12c2b8b73efb71c2c83c52878fcb4fda6bec (patch)
treec869fa0969f6be81478bf32d57df74290f0e2f29
parent6de6312070b5705fac73f5e834c158f62a51dcd3 (diff)
[Lib] Add paramter for custom prefix in lib create_dcs_with_pvcHEADmaster
Change-Id: Ifb9c582c18d9e7a8bfd01d3b6a45e105c9ad8db4
-rw-r--r--openshift-storage-libs/openshiftstoragelibs/baseclass.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/baseclass.py b/openshift-storage-libs/openshiftstoragelibs/baseclass.py
index f30c2ba..fd2c393 100644
--- a/openshift-storage-libs/openshiftstoragelibs/baseclass.py
+++ b/openshift-storage-libs/openshiftstoragelibs/baseclass.py
@@ -387,7 +387,8 @@ class BaseClass(unittest.TestCase):
skip_cleanup=skip_cleanup)
def create_dcs_with_pvc(
- self, pvc_names, timeout=600, wait_step=5, skip_cleanup=False):
+ self, pvc_names, timeout=600, wait_step=5,
+ dc_name_prefix='autotests-dc', skip_cleanup=False):
"""Create bunch of DCs with app PODs which use unique PVCs.
Args:
@@ -395,6 +396,7 @@ class BaseClass(unittest.TestCase):
to attach to app PODs as part of DCs.
timeout (int): timeout value, default value is 600 seconds.
wait_step( int): wait step, default value is 5 seconds.
+ dc_name_prefix(str): name prefix for deployement config.
Returns: dictionary with following structure:
{
"pvc_name_1": ("dc_name_1", "pod_name_1"),
@@ -408,7 +410,8 @@ class BaseClass(unittest.TestCase):
if isinstance(pvc_names, (list, set, tuple)) else [pvc_names])
dc_and_pod_names, dc_names = {}, {}
for pvc_name in pvc_names:
- dc_name = oc_create_app_dc_with_io(self.ocp_client[0], pvc_name)
+ dc_name = oc_create_app_dc_with_io(
+ self.ocp_client[0], pvc_name, dc_name_prefix=dc_name_prefix)
dc_names[pvc_name] = dc_name
if not skip_cleanup:
self.addCleanup(oc_delete, self.ocp_client[0], 'dc', dc_name)
@@ -427,9 +430,11 @@ class BaseClass(unittest.TestCase):
return dc_and_pod_names
def create_dc_with_pvc(
- self, pvc_name, timeout=300, wait_step=10, skip_cleanup=False):
+ self, pvc_name, timeout=300, wait_step=10,
+ dc_name_prefix='autotests-dc', skip_cleanup=False):
return self.create_dcs_with_pvc(
- pvc_name, timeout, wait_step, skip_cleanup=skip_cleanup)[pvc_name]
+ pvc_name, timeout, wait_step,
+ dc_name_prefix=dc_name_prefix, skip_cleanup=skip_cleanup)[pvc_name]
def create_heketi_volume_with_name_and_wait(
self, name, size, raise_on_cleanup_error=True,