summaryrefslogtreecommitdiffstats
path: root/tests/functional/heketi
diff options
context:
space:
mode:
authorArun Kumar <aanand01762@gmail.com>2020-05-09 18:18:55 +0530
committerVaibhav Mahajan <vamahaja@redhat.com>2020-05-15 07:57:12 +0000
commit1973d754eea4e1d2c56deb42d9fbcdfb1d1892c3 (patch)
tree7f8bca590009507cb4298aa7a31c96eff77294c0 /tests/functional/heketi
parent1dcc07e28bbead6a32d22b0abdde3a33de27dbcf (diff)
[Test] Add TC to validate heketidb cleanup on idle setup
Change-Id: I718fd893ddb16bd1ce86a63a732e02db3c72a160 Signed-off-by: Arun Kumar <aanand01762@gmail.com>
Diffstat (limited to 'tests/functional/heketi')
-rw-r--r--tests/functional/heketi/test_heketi_cluster_operations.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/functional/heketi/test_heketi_cluster_operations.py b/tests/functional/heketi/test_heketi_cluster_operations.py
index e776914f..d5c6801d 100644
--- a/tests/functional/heketi/test_heketi_cluster_operations.py
+++ b/tests/functional/heketi/test_heketi_cluster_operations.py
@@ -5,6 +5,7 @@ import pytest
from openshiftstoragelibs import baseclass
from openshiftstoragelibs import exceptions
from openshiftstoragelibs import heketi_ops
+from openshiftstoragelibs.waiter import Waiter
@ddt.ddt
@@ -210,3 +211,27 @@ class TestClusterOperationsTestCases(baseclass.BaseClass):
zone = node_details[0]["zone"]
self.assertEqual(
zone, storage_zone, err_msg % ("zone", zone, storage_zone))
+
+ @pytest.mark.tier1
+ def test_heketi_server_operations_cleanup_on_idle_setup(self):
+ """Run heketi db clean up on an idle setup"""
+ h_node, h_url = self.heketi_client_node, self.heketi_server_url
+ err_msg = "There should not be any pending operations list {}"
+
+ # Verify the server operations
+ for waiter_add in Waiter(300, 20):
+ initial_ops = heketi_ops.heketi_server_operations_list(
+ h_node, h_url)
+ if not initial_ops:
+ break
+ if waiter_add.expired:
+ self.assertFalse(initial_ops, err_msg.format(initial_ops))
+
+ # Run cleanup
+ cleanup = heketi_ops.heketi_server_operation_cleanup(h_node, h_url)
+ self.assertFalse(
+ cleanup, "Cleanup command failed with message {}".format(cleanup))
+
+ # Verify the server operations
+ final_ops = heketi_ops.heketi_server_operations_list(h_node, h_url)
+ self.assertFalse(final_ops, err_msg.format(final_ops))