diff options
author | Arun Kumar <aanand01762@gmail.com> | 2020-06-09 18:28:23 +0530 |
---|---|---|
committer | Arun Kumar <aanand01762@gmail.com> | 2020-06-15 17:35:25 +0530 |
commit | 3a876a608c605212902f89cd5e918d5a43c2736f (patch) | |
tree | a13a21cb926d4735e13aba6dcaf6dcf7e5311cc2 /tests/functional/heketi | |
parent | 3d78152f82d3987bab8fc004e29257d997444a80 (diff) |
[Test] Add TC's PVC expansion after setting zone check to stict inside dc
Change-Id: I0c9064c089872c218b5fc437c03b8de99820c12a
Signed-off-by: Arun Kumar <aanand01762@gmail.com>
Diffstat (limited to 'tests/functional/heketi')
-rw-r--r-- | tests/functional/heketi/test_heketi_zones.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/functional/heketi/test_heketi_zones.py b/tests/functional/heketi/test_heketi_zones.py index 79acf9d5..66a7e4e9 100644 --- a/tests/functional/heketi/test_heketi_zones.py +++ b/tests/functional/heketi/test_heketi_zones.py @@ -483,6 +483,48 @@ class TestHeketiZones(baseclass.BaseClass): # Create app DC with the above PVC self.create_dc_with_pvc(pvc_name, timeout=120, wait_step=3) + @ddt.data( + (1, False), + (1, True), + (2, False), + (2, True), + ) + @ddt.unpack + def test_pvc_placement_and_expansion_with_zone_check_set_in_dc( + self, zone_count, is_arbiter): + heketi_zone_checking, expand_size = "strict", 2 + + # Create storage class setting expansion and arbiter option up + sc_name = self.create_storage_class( + sc_name_prefix=self.prefix, vol_name_prefix=self.prefix, + allow_volume_expansion=True, is_arbiter_vol=True) + + # Create PVC using above storage class + pvc_name = self.create_and_wait_for_pvc( + pvc_name_prefix=self.prefix, sc_name=sc_name) + + # Check amount of available online heketi zones + self._check_for_available_zones(zone_count) + + # Set "user.heketi.zone-checking" to strict inside heketi dc + self._set_zone_check_env_in_heketi_dc(heketi_zone_checking) + + # Expand PVC + openshift_storage_libs.enable_pvc_resize(self.node) + openshift_ops.resize_pvc(self.node, pvc_name, expand_size) + openshift_ops.verify_pvc_size(self.node, pvc_name, expand_size) + + # Make sure that gluster vol has appropriate option set + vol_info = openshift_ops.get_gluster_vol_info_by_pvc_name( + self.node, pvc_name) + if is_arbiter: + self.assertIn('user.heketi.arbiter', vol_info['options']) + self.assertEqual( + vol_info['options']['user.heketi.arbiter'], 'true') + + # 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 |