summaryrefslogtreecommitdiffstats
path: root/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
diff options
context:
space:
mode:
authorArun Kumar <aanand01762@gmail.com>2020-06-23 09:48:01 +0530
committerArun Kumar <aanand01762@gmail.com>2020-07-06 15:33:41 +0530
commit3e780949ed3453ec45e75aba7114661d7ab74ac1 (patch)
treef21147bd5d83e789f248c5ade033599c0055665b /openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
parenteeb68e474a16c73798f8db916aa83af97ead4094 (diff)
[Test] Add TC fill arbiter brick, shutdown data brick node and run io
Change-Id: I36d44123db24154fe0aefc905ad2f5a5e5061558 Signed-off-by: Arun Kumar <aanand01762@gmail.com>
Diffstat (limited to 'openshift-storage-libs/openshiftstoragelibs/openshift_ops.py')
-rw-r--r--openshift-storage-libs/openshiftstoragelibs/openshift_ops.py59
1 files changed, 43 insertions, 16 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py b/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
index ccacfeb..cf1e342 100644
--- a/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
+++ b/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
@@ -345,25 +345,12 @@ def oc_create_pvc(hostname, sc_name=None, pvc_name_prefix="autotests-pvc",
return pvc_name
-def oc_create_app_dc_with_io(
- hostname, pvc_name, dc_name_prefix="autotests-dc-with-app-io",
- replicas=1, space_to_use=1048576, label=None):
- """Create DC with app PODs and attached PVC, constantly running I/O.
-
- Args:
- hostname (str): Node on which 'oc create' command will be executed.
- pvc_name (str): name of the Persistent Volume Claim to attach to
- the application PODs where constant I/O will run.
- dc_name_prefix (str): DC name will consist of this prefix and
- random str.
- replicas (int): amount of application POD replicas.
- space_to_use (int): value in bytes which will be used for I/O.
- label (dict): dict of keys and values to add labels in DC.
- """
+def _oc_create_app_dc_with_io_image(hostname, pvc_name, dc_name_prefix,
+ replicas, space_to_use, label, image):
dc_name = "%s-%s" % (dc_name_prefix, utils.get_random_str())
container_data = {
"name": dc_name,
- "image": "cirros",
+ "image": image,
"volumeMounts": [{"mountPath": "/mnt", "name": dc_name}],
"command": ["sh"],
"args": [
@@ -419,6 +406,46 @@ def oc_create_app_dc_with_io(
return dc_name
+def oc_create_app_dc_with_io(
+ hostname, pvc_name, dc_name_prefix="autotests-dc-with-app-io",
+ replicas=1, space_to_use=1048576, label=None):
+ """Create DC with app PODs and attached PVC, constantly running I/O.
+
+ Args:
+ hostname (str): Node on which 'oc create' command will be executed.
+ pvc_name (str): name of the Persistent Volume Claim to attach to
+ the application PODs where constant I/O will run.
+ dc_name_prefix (str): DC name will consist of this prefix and
+ random str.
+ replicas (int): amount of application POD replicas.
+ space_to_use (int): value in bytes which will be used for I/O.
+ label (dict): dict of keys and values to add labels in DC.
+ """
+ return _oc_create_app_dc_with_io_image(
+ hostname, pvc_name, dc_name_prefix, replicas, space_to_use,
+ label, "cirros")
+
+
+def oc_create_busybox_app_dc_with_io(
+ hostname, pvc_name, dc_name_prefix="autotests-dc-with-app-io",
+ replicas=1, space_to_use=1048576, label=None):
+ """Create DC with app PODs and attached PVC, constantly running I/O.
+
+ Args:
+ hostname (str): Node on which 'oc create' command will be executed.
+ pvc_name (str): name of the Persistent Volume Claim to attach to
+ the application PODs where constant I/O will run.
+ dc_name_prefix (str): DC name will consist of this prefix and
+ random str.
+ replicas (int): amount of application POD replicas.
+ space_to_use (int): value in bytes which will be used for I/O.
+ label (dict): dict of keys and values to add labels in DC.
+ """
+ return _oc_create_app_dc_with_io_image(
+ hostname, pvc_name, dc_name_prefix, replicas, space_to_use,
+ label, "busybox")
+
+
def oc_create_tiny_pod_with_volume(hostname, pvc_name, pod_name_prefix='',
mount_path='/mnt'):
"""Create tiny POD from image in 10Mb with attached volume at /mnt"""