diff options
Diffstat (limited to 'tests/functional/provisioning')
4 files changed, 22 insertions, 24 deletions
diff --git a/tests/functional/provisioning/test_dynamic_provisioning_block.py b/tests/functional/provisioning/test_dynamic_provisioning_block.py index 0a587973..6b288fcb 100644 --- a/tests/functional/provisioning/test_dynamic_provisioning_block.py +++ b/tests/functional/provisioning/test_dynamic_provisioning_block.py @@ -255,8 +255,7 @@ class TestDynamicProvisioningBlockP0(GlusterBlockBaseClass): for pvc in self.pvc_name_list: with self.assertRaises(ExecutionError): wait_for_resource_absence( - self.ocp_client[0], 'pvc', pvc, - interval=3, timeout=30) + self.ocp_client[0], 'pvc', pvc, interval=3, timeout=30) finally: # bring back heketi-pod scale_dc_pod_amount_and_wait(self.ocp_client[0], @@ -309,11 +308,11 @@ class TestDynamicProvisioningBlockP0(GlusterBlockBaseClass): pv_name = get_pv_name_from_pvc(self.node, self.pvc_name) vol_name = oc_get_custom_resource( - self.node, 'pv', - ':.metadata.annotations.glusterBlockShare', pv_name)[0] + self.node, 'pv', + ':.metadata.annotations.glusterBlockShare', pv_name)[0] block_vol_list = heketi_blockvolume_list( - self.heketi_client_node, self.heketi_server_url) + self.heketi_client_node, self.heketi_server_url) self.assertIn(vol_name, block_vol_list) diff --git a/tests/functional/provisioning/test_dynamic_provisioning_file.py b/tests/functional/provisioning/test_dynamic_provisioning_file.py index 4b53d3c6..57c1e2e4 100644 --- a/tests/functional/provisioning/test_dynamic_provisioning_file.py +++ b/tests/functional/provisioning/test_dynamic_provisioning_file.py @@ -74,7 +74,7 @@ class TestDynamicProvisioningP0(BaseClass): r'"gluster\.kubernetes\.io\/heketi-volume-id"' ] pv_vol_name, vol_id = oc_get_custom_resource( - self.ocp_client[0], 'pv', custom, pv_name) + self.ocp_client[0], 'pv', custom, pv_name) # check if the pv_volume_name is present in heketi # Check if volume name is "vol_"+volumeid or not @@ -331,8 +331,7 @@ class TestDynamicProvisioningP0(BaseClass): for pvc in self.pvc_name_list: with self.assertRaises(ExecutionError): wait_for_resource_absence( - self.ocp_client[0], 'pvc', pvc, - interval=3, timeout=30) + self.ocp_client[0], 'pvc', pvc, interval=3, timeout=30) finally: # bring back heketi-pod scale_dc_pod_amount_and_wait(self.ocp_client[0], diff --git a/tests/functional/provisioning/test_pv_resize.py b/tests/functional/provisioning/test_pv_resize.py index 68730c6f..ebf31529 100644 --- a/tests/functional/provisioning/test_pv_resize.py +++ b/tests/functional/provisioning/test_pv_resize.py @@ -48,7 +48,7 @@ class TestPvResizeClass(BaseClass): (True, True), (False, True), (False, False), - ) + ) @ddt.unpack def test_pv_resize_with_prefix_for_name_and_size( self, create_vol_name_prefix=False, valid_size=True): @@ -79,8 +79,8 @@ class TestPvResizeClass(BaseClass): cmd = ("dd if=/dev/urandom of=%sfile " "bs=100K count=1000") % dir_path ret, out, err = oc_rsh(node, pod_name, cmd) - self.assertEqual(ret, 0, "failed to execute command %s on %s" % ( - cmd, node)) + self.assertEqual( + ret, 0, "Failed to execute command %s on %s" % (cmd, node)) pv_name = get_pv_name_from_pvc(node, pvc_name) # If resize size is invalid then size should not change @@ -111,8 +111,8 @@ class TestPvResizeClass(BaseClass): cmd = ("dd if=/dev/urandom of=%sfile_new " "bs=50K count=10000") % dir_path ret, out, err = oc_rsh(node, pod_name, cmd) - self.assertEqual(ret, 0, "failed to execute command %s on %s" % ( - cmd, node)) + self.assertEqual( + ret, 0, "Failed to execute command %s on %s" % (cmd, node)) def _pv_resize(self, exceed_free_space): dir_path = "/mnt" @@ -128,8 +128,8 @@ class TestPvResizeClass(BaseClass): for node_id in node_id_list: node_info = heketi_ops.heketi_node_info( self.heketi_client_node, heketi_url, node_id, json=True) - if (node_info['state'].lower() != 'online' or - not node_info['devices']): + if (node_info['state'].lower() != 'online' + or not node_info['devices']): continue if len(nodes) > 2: out = heketi_ops.heketi_node_disable( @@ -239,8 +239,8 @@ class TestPvResizeClass(BaseClass): cmd = ("dd if=/dev/urandom of=%sfile " "bs=100K count=3000") % dir_path ret, out, err = oc_rsh(node, pod_name, cmd) - self.assertEqual(ret, 0, "failed to execute command %s on %s" % ( - cmd, node)) + self.assertEqual( + ret, 0, "Failed to execute command %s on %s" % (cmd, node)) pvc_resize = 2 with self.assertRaises(AssertionError): resize_pvc(node, pvc_name, pvc_resize) @@ -250,8 +250,8 @@ class TestPvResizeClass(BaseClass): cmd = ("dd if=/dev/urandom of=%sfile_new " "bs=100K count=2000") % dir_path ret, out, err = oc_rsh(node, pod_name, cmd) - self.assertEqual(ret, 0, "failed to execute command %s on %s" % ( - cmd, node)) + self.assertEqual( + ret, 0, "Failed to execute command %s on %s" % (cmd, node)) def test_pv_resize_when_heketi_down(self): """Create a PVC and try to expand it when heketi is down, It should diff --git a/tests/functional/provisioning/test_storage_class_cases.py b/tests/functional/provisioning/test_storage_class_cases.py index 2e319f6c..cdf61d43 100644 --- a/tests/functional/provisioning/test_storage_class_cases.py +++ b/tests/functional/provisioning/test_storage_class_cases.py @@ -183,7 +183,7 @@ class TestStorageClassCases(BaseClass): {"restuser": "fakeuser"}, {"volumenameprefix": "dept_qe"}, {"clusterids": "123456789abcdefg"}, - ) + ) def test_sc_glusterfile_incorrect_parameter(self, parameter={}): """Validate glusterfile storage with different incorrect parameters""" self.create_sc_with_parameter("glusterfile", parameter=parameter) @@ -194,7 +194,7 @@ class TestStorageClassCases(BaseClass): "restsecretnamespace": "fakerestnamespace"}, {"restuser": "fakeuser"}, {"clusterids": "123456789abcdefg"}, - ) + ) def test_sc_glusterblock_incorrect_parameter(self, parameter={}): """Validate glusterblock storage with different incorrect parameters""" self.create_sc_with_parameter("glusterblock", parameter=parameter) @@ -341,6 +341,6 @@ class TestStorageClassCases(BaseClass): self.ocp_master_node[0], "pv", ":spec.glusterfs.endpoints", name=pv_name) self.assertTrue( - endpoint, - "Failed to read Endpoints of %s on %s " % ( - pv_name, self.ocp_master_node[0])) + endpoint, + "Failed to read Endpoints of %s on %s " % ( + pv_name, self.ocp_master_node[0])) |