diff options
author | Valerii Ponomarov <vponomar@redhat.com> | 2019-12-05 23:50:48 +0530 |
---|---|---|
committer | vponomar <vponomar@redhat.com> | 2019-12-11 12:27:00 +0000 |
commit | 0cd073fdd42ed19186719862ed78006738d89f3e (patch) | |
tree | 079b8a740d4146c58cb59e83c5a66bc86168d606 /tests | |
parent | e3d38114d334fa99f574a37ee8b5af7f60291be7 (diff) |
[py2to3] Fix various py3 incompatibilities
Change-Id: I6c517278c3f8bf6f374ab60bc27768e503161278
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/arbiter/test_arbiter.py | 4 | ||||
-rw-r--r-- | tests/functional/gluster_stability/test_gluster_block_stability.py | 8 | ||||
-rw-r--r-- | tests/functional/test_node_restart.py | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/tests/functional/arbiter/test_arbiter.py b/tests/functional/arbiter/test_arbiter.py index ea61c1f0..fb284e0c 100644 --- a/tests/functional/arbiter/test_arbiter.py +++ b/tests/functional/arbiter/test_arbiter.py @@ -351,9 +351,9 @@ class TestArbiterVolumeCreateExpandDelete(baseclass.BaseClass): self.verify_amount_and_proportion_of_arbiter_and_data_bricks( vol_info)) - expected_file_amount = pvc_size_gb * 1024**2 / (avg_file_size or 64) + expected_file_amount = pvc_size_gb * 1024**2 // (avg_file_size or 64) expected_file_amount = ( - expected_file_amount / bricks_info['arbiter_amount']) + expected_file_amount // bricks_info['arbiter_amount']) # Try to create expected amount of files on arbiter brick mount passed_arbiter_bricks = [] diff --git a/tests/functional/gluster_stability/test_gluster_block_stability.py b/tests/functional/gluster_stability/test_gluster_block_stability.py index 8f31fd24..15393bf4 100644 --- a/tests/functional/gluster_stability/test_gluster_block_stability.py +++ b/tests/functional/gluster_stability/test_gluster_block_stability.py @@ -672,12 +672,12 @@ class TestGlusterBlockStability(GlusterBlockBaseClass): target_portal_list = sorted(set(target_portal_list)) unmatched_gips = (set(host_ips) ^ set(gluster_ips_bv_flattend)) unmatched_tpips = (set(host_ips) ^ set(target_portal_list)) - self.assertEqual( - cmp(host_ips, gluster_ips_bv_flattend), 0, + self.assertFalse( + unmatched_gips, "Could not match glusterips in blockvolumes, difference is %s " % unmatched_gips) - self.assertEqual( - cmp(host_ips, target_portal_list), 0, + self.assertFalse( + unmatched_tpips, "Could not match glusterips in pv describe, difference is %s " % unmatched_tpips) diff --git a/tests/functional/test_node_restart.py b/tests/functional/test_node_restart.py index 8bf70f7c..6a718cbe 100644 --- a/tests/functional/test_node_restart.py +++ b/tests/functional/test_node_restart.py @@ -76,9 +76,9 @@ class TestNodeRestart(BaseClass): def reboot_gluster_node_and_wait_for_services(self): gluster_node_ip = ( g.config["gluster_servers"][self.gluster_servers[0]]["storage"]) - gluster_pod = filter( + gluster_pod = list(filter( lambda pod: (pod["pod_host_ip"] == gluster_node_ip), - get_ocp_gluster_pod_details(self.oc_node)) + get_ocp_gluster_pod_details(self.oc_node))) if not gluster_pod: raise ExecutionError( "Gluster pod Host IP '%s' not matched." % gluster_node_ip) |