summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoradityaramteke <adityaramteke05icr@gmail.com>2019-09-25 14:47:09 +0530
committerVaibhav Mahajan <vamahaja@redhat.com>2020-06-10 06:44:19 +0000
commit063975143bc948b45c0ef63bc7fd1fe44ee41a3d (patch)
tree8a8e1153fe97fae9b6c1cc1a2f37a95a9a95234f /tests
parent13348013f1d3a9ddd4c015f6ef3d8434b3749e34 (diff)
[Test] Add TC to validate volume creation when heketidb volume is down
Change-Id: I626bb446e408f9f4bb461309831569e61215d3db Signed-off-by: Aditya Ramteke <adityaramteke05icr@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/heketi/test_heketi_create_volume.py35
1 files changed, 34 insertions, 1 deletions
diff --git a/tests/functional/heketi/test_heketi_create_volume.py b/tests/functional/heketi/test_heketi_create_volume.py
index 40d0ed6..b1f6490 100644
--- a/tests/functional/heketi/test_heketi_create_volume.py
+++ b/tests/functional/heketi/test_heketi_create_volume.py
@@ -7,7 +7,12 @@ except ImportError:
import ddt
from glusto.core import Glusto as g
-from glustolibs.gluster.volume_ops import get_volume_list, get_volume_info
+from glustolibs.gluster.volume_ops import (
+ get_volume_info,
+ get_volume_list,
+ volume_start,
+ volume_stop,
+)
import mock
import pytest
import six
@@ -801,3 +806,31 @@ class TestHeketiVolume(BaseClass):
h_db_check_bricks_after["total"],
h_db_check_bricks_before["total"] + (
len(total_bhvs) * 3)))
+
+ @pytest.mark.tier1
+ @podcmd.GlustoPod()
+ def test_volume_creation_after_stopping_heketidb_volume(self):
+ """Validate volume creation after stopping heketidb volume"""
+ # Stop heketidbstorage volume
+ ret, _, err = volume_stop(
+ "auto_get_gluster_endpoint", "heketidbstorage")
+ self.addCleanup(
+ podcmd.GlustoPod()(volume_start), "auto_get_gluster_endpoint",
+ "heketidbstorage")
+ self.assertFalse(
+ ret, "Failed to stop gluster volume "
+ "heketidbstorage. error: {}".format(err))
+
+ # Try to create heketi volume to make sure it fails
+ err_msg = (
+ "Unexpectedly: Volume has been created when gluster "
+ "volume heketidbstorage is stopped")
+ with self.assertRaises(AssertionError, msg=err_msg) as e:
+ volume_name = heketi_volume_create(
+ self.heketi_client_node, self.heketi_server_url,
+ self.volume_size, json=True)
+ self.addCleanup(
+ heketi_volume_delete, self.heketi_client_node,
+ self.heketi_server_url, volume_name["bricks"][0]["volume"])
+ self.assertIn(
+ "transport endpoint is not connected", six.text_type(e.exception))