summaryrefslogtreecommitdiffstats
path: root/tests/functional/heketi
diff options
context:
space:
mode:
authorArun Kumar <aanand01762@gmail.com>2020-06-10 18:23:32 +0530
committerArun Kumar <aanand01762@gmail.com>2020-06-16 13:46:33 +0530
commitc6749dfe856dde677563f50dcd943bdad74d2474 (patch)
treed3f6c8b2392fe3d91c576fae8ade297ec3264054 /tests/functional/heketi
parentd832915383a19a3774be5b2f4ff4d401d9af6228 (diff)
[Test] Add TC's of PVC creation with zone check set in sc and dc both
Change-Id: I4c75528e7fba934a2f9dd28d8ce79d4cf0d472dd Signed-off-by: Arun Kumar <aanand01762@gmail.com>
Diffstat (limited to 'tests/functional/heketi')
-rw-r--r--tests/functional/heketi/test_heketi_zones.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/functional/heketi/test_heketi_zones.py b/tests/functional/heketi/test_heketi_zones.py
index 66a7e4e9..10646ae9 100644
--- a/tests/functional/heketi/test_heketi_zones.py
+++ b/tests/functional/heketi/test_heketi_zones.py
@@ -483,6 +483,7 @@ class TestHeketiZones(baseclass.BaseClass):
# Create app DC with the above PVC
self.create_dc_with_pvc(pvc_name, timeout=120, wait_step=3)
+ @pytest.mark.tier1
@ddt.data(
(1, False),
(1, True),
@@ -525,6 +526,46 @@ class TestHeketiZones(baseclass.BaseClass):
# Create app DC with the above PVC
self.create_dc_with_pvc(pvc_name, timeout=120, wait_step=3)
+ @pytest.mark.tier1
+ @ddt.data(
+ ("strict", "strict"),
+ ("none", "strict"),
+ ("strict", "none"),
+ )
+ @ddt.unpack
+ def test_check_pvc_placement_with_zone_check_in_sc_and_dc_both(
+ self, check_in_dc, check_in_sc):
+ zone_count = 3
+
+ # Check amount of available online heketi zones
+ self._check_for_available_zones(zone_count)
+
+ # Create storage class with arbiter option set
+ sc_name = self.create_storage_class(
+ sc_name_prefix=self.prefix, vol_name_prefix=self.prefix,
+ heketi_zone_checking=check_in_sc)
+
+ # Set "user.heketi.zone-checking" to strict inside heketi dc
+ self._set_zone_check_env_in_heketi_dc(check_in_dc)
+
+ # Create a PVC
+ pvc_name = self.create_and_wait_for_pvc(
+ pvc_name_prefix=self.prefix, sc_name=sc_name)
+
+ # Validate brick placement
+ self._validate_brick_placement_in_correct_zone_or_with_expand_pvc(
+ check_in_dc, pvc_name, zone_count)
+
+ # Make sure that gluster vol has appropriate option set
+ vol_info = openshift_ops.get_gluster_vol_info_by_pvc_name(
+ self.node, pvc_name)
+ self.assertIn('user.heketi.zone-checking', vol_info['options'])
+ self.assertEqual(vol_info['options']['user.heketi.zone-checking'],
+ check_in_dc)
+
+ # Create app DC with the above PVC
+ self.create_dc_with_pvc(pvc_name, timeout=120, wait_step=3)
+
def _get_online_devices_and_nodes_with_zone(self):
"""
This function returns the list of nodes and devices associated to zone