summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorValerii Ponomarov <vponomar@redhat.com>2019-09-20 21:41:55 +0530
committerValerii Ponomarov <vponomar@redhat.com>2019-09-20 21:41:55 +0530
commit8b1408de6738d83147925788f66bb8145eaf823f (patch)
tree8f87b7be160876adc14e7652b5beb3a896e3d9c6 /tests
parentc81a8792c89318e1598dd8edfbecf9ec14aa40ee (diff)
Fix two heketi zones test cases where we have 4 unique zones
By default, we create replica-3 file volumes. And when we have more than 3 Heketi nodes located in unique zones, we should check that our file volume is located in 3 unique zones, not bigger. So, fix this bug. Change-Id: Id82626425473f5e480ad73b0e17b7a0d675ba8ba
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/heketi/test_heketi_zones.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/functional/heketi/test_heketi_zones.py b/tests/functional/heketi/test_heketi_zones.py
index d948c0e1..5f6876ed 100644
--- a/tests/functional/heketi/test_heketi_zones.py
+++ b/tests/functional/heketi/test_heketi_zones.py
@@ -179,11 +179,16 @@ class TestHeketiZones(baseclass.BaseClass):
continue
placement_zones.add(node_zone)
break
+ actual_zone_count = len(placement_zones)
+ # NOTE(vponomar): '3' is default amount of volume replicas.
+ # And it is just impossible to find more actual zones than amount
+ # of replicas/bricks.
+ expected_zone_count = 3 if zone_count > 3 else zone_count
self.assertEqual(
- zone_count, len(placement_zones),
+ expected_zone_count, actual_zone_count,
"PVC '%s' is incorrectly placed on the Heketi nodes "
"according to their zones. Expected '%s' unique zones, got "
- "'%s'." % (pvc_name, zone_count, len(placement_zones)))
+ "'%s'." % (pvc_name, zone_count, actual_zone_count))
# Make sure that gluster vol has appropriate option set
vol_info = openshift_ops.get_gluster_vol_info_by_pvc_name(