diff options
| author | Ashmitha Ambastha <Ashmitha7@localhost.localdomain> | 2018-10-05 11:11:38 +0530 |
|---|---|---|
| committer | Ashmitha <asambast@redhat.com> | 2018-11-07 02:39:19 +0530 |
| commit | e6786fde162d88c73d4070db415ee245c98f06fd (patch) | |
| tree | 05519a3dd72060f73b449283c963f42a15c73493 /cns-libs | |
| parent | 384cb369f256162606190e4df4767500668d3a7c (diff) | |
Add test cases for gluster-block
Change-Id: I5ce399b39201dfb09d4ad459a039d938596a71e4
Signed-off-by: Ashmitha <asambast@redhat.com>
Diffstat (limited to 'cns-libs')
| -rw-r--r-- | cns-libs/cnslibs/common/heketi_libs.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/cns-libs/cnslibs/common/heketi_libs.py b/cns-libs/cnslibs/common/heketi_libs.py index 29e21cd8..4a001adc 100644 --- a/cns-libs/cnslibs/common/heketi_libs.py +++ b/cns-libs/cnslibs/common/heketi_libs.py @@ -13,7 +13,8 @@ from cnslibs.common.heketi_ops import (setup_heketi_ssh_key, modify_heketi_executor, export_heketi_cli_server, hello_heketi, - heketi_volume_delete) + heketi_volume_delete, + heketi_blockvolume_delete) from cnslibs.common.openshift_ops import (oc_login, switch_oc_project, get_ocp_gluster_pod_names) @@ -130,6 +131,24 @@ class HeketiBaseClass(unittest.TestCase): "Failed to delete following heketi volumes: " "%s" % ',\n'.join(errored_ids)) + def delete_block_volumes(self, volume_ids): + """ + Delete block volumes by their volume IDs and raise an error on failures + Args: + volume_ids (str) : Volume ID of the block volume + """ + if not isinstance(volume_ids, (list, set, tuple)): + volume_ids = [volume_ids] + + fail = False + for volume_id in volume_ids: + block_out = heketi_blockvolume_delete( + self.heketi_client_node, self.heketi_server_url, volume_id) + if block_out is False: + g.log.error("Block volume delete failed %s " % volume_id) + fail = True + self.assertFalse(fail, "Failed to delete blockvolumes") + def tearDown(self): super(HeketiBaseClass, self).tearDown() msg = "Ending Test: %s : %s" % (self.id(), self.glustotest_run_id) |
