diff options
author | Valerii Ponomarov <vponomar@redhat.com> | 2019-05-24 17:58:01 +0530 |
---|---|---|
committer | vponomar <vponomar@redhat.com> | 2019-05-29 09:54:03 +0000 |
commit | ffdc9f4ea59131de97f8c41784ee6c79d654662f (patch) | |
tree | 5a935f0ff3d97d218c773c8529fbaecf81754ab1 /tests/functional/provisioning | |
parent | 0e5dc8cd5053fd9fd3582221b1bd6c211a643778 (diff) |
Use 'cmd_run' func instead of 'g.run' func in openshift_ops.py
It will allow us to recreate SSH connections when it is broken.
Also, do following additional things:
- Fix 'podcmd' module, where 'user' argument for 'g.run' is missing in it's
wrapper.
- Use "g.log.error" command to log errors when they appear inside of
the 'cmd_run' func.
- Delete several unused commands, instead of fixing them.
- Update several test cases's logic due to the changes in the libraries.
Change-Id: I908e5adcff739b6ab3a4aefaebfe46abdee22655
Diffstat (limited to 'tests/functional/provisioning')
-rw-r--r-- | tests/functional/provisioning/test_pv_resize.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/functional/provisioning/test_pv_resize.py b/tests/functional/provisioning/test_pv_resize.py index a5b9d2c2..288355dd 100644 --- a/tests/functional/provisioning/test_pv_resize.py +++ b/tests/functional/provisioning/test_pv_resize.py @@ -78,9 +78,13 @@ class TestPvResizeClass(BaseClass): cmd, node)) cmd = ("dd if=/dev/urandom of=%sfile2 " "bs=100K count=10000") % dir_path - ret, out, err = oc_rsh(node, pod_name, cmd) - self.assertNotEqual(ret, 0, " This IO did not fail as expected " - "command %s on %s" % (cmd, node)) + with self.assertRaises(AssertionError): + ret, out, err = oc_rsh(node, pod_name, cmd) + msg = ("Command '%s' was expected to fail on '%s' node. " + "But it returned following: ret is '%s', err is '%s' " + "and out is '%s'" % (cmd, node, ret, err, out)) + raise ExecutionError(msg) + pvc_size = 2 resize_pvc(node, pvc_name, pvc_size) verify_pvc_size(node, pvc_name, pvc_size) @@ -224,7 +228,7 @@ class TestPvResizeClass(BaseClass): self.assertEqual(ret, 0, "failed to execute command %s on %s" % ( cmd, node)) pvc_resize = 2 - with self.assertRaises(ExecutionError): + with self.assertRaises(AssertionError): resize_pvc(node, pvc_name, pvc_resize) verify_pvc_size(node, pvc_name, pv_size) pv_name = get_pv_name_from_pvc(node, pvc_name) |