[PATCH] [Kimchi] Fix storage volume clone test case

Commit c9ea5072b changed the target_uri of a cloning storage volume to distinguish it from a storage volume creation by appeding '/clone' to the end of the target_uri. But the test case was not properly updated. So do that to avoid issues while running 'make check'. Without this patch a test case is failing: [alinefm@alinefm-TP440 tests]$ sudo ./run_tests.sh test_mock_storagevolume.MockStorageVolumeTests.test_storagevolume ***** Running unit test: test_mock_storagevolume.MockStorageVolumeTests.test_storagevolume... FAILED ====================================================================== FAIL: test_storagevolume (test_mock_storagevolume.MockStorageVolumeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_mock_storagevolume.py", line 99, in test_storagevolume _do_volume_test(self, model, host, ssl_port, pool_name) File "test_model_storagevolume.py", line 141, in _do_volume_test self.assertEquals(200, resp.status) AssertionError: 200 != 404 ---------------------------------------------------------------------- Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com> --- tests/test_model_storagevolume.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_model_storagevolume.py b/tests/test_model_storagevolume.py index 56dda8f..35cb51d 100644 --- a/tests/test_model_storagevolume.py +++ b/tests/test_model_storagevolume.py @@ -126,7 +126,7 @@ def _do_volume_test(self, model, host, ssl_port, pool_name): resp = self.request(vol_uri + '/clone', '{}', 'POST') self.assertEquals(202, resp.status) task = json.loads(resp.read()) - cloned_vol_name = task['target_uri'].split('/')[-1] + cloned_vol_name = task['target_uri'].split('/')[-2] rollback.prependDefer(model.storagevolume_delete, pool_name, cloned_vol_name) wait_task(_task_lookup, task['id']) -- 2.5.5

Reviewed-By: Lucio Correia <luciojhc@linux.vnet.ibm.com> On 07-06-2016 22:38, Aline Manera wrote:
Commit c9ea5072b changed the target_uri of a cloning storage volume to distinguish it from a storage volume creation by appeding '/clone' to the end of the target_uri. But the test case was not properly updated. So do that to avoid issues while running 'make check'.
Without this patch a test case is failing:
[alinefm@alinefm-TP440 tests]$ sudo ./run_tests.sh test_mock_storagevolume.MockStorageVolumeTests.test_storagevolume ***** Running unit test: test_mock_storagevolume.MockStorageVolumeTests.test_storagevolume... FAILED ====================================================================== FAIL: test_storagevolume (test_mock_storagevolume.MockStorageVolumeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_mock_storagevolume.py", line 99, in test_storagevolume _do_volume_test(self, model, host, ssl_port, pool_name) File "test_model_storagevolume.py", line 141, in _do_volume_test self.assertEquals(200, resp.status) AssertionError: 200 != 404
----------------------------------------------------------------------
Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com> --- tests/test_model_storagevolume.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test_model_storagevolume.py b/tests/test_model_storagevolume.py index 56dda8f..35cb51d 100644 --- a/tests/test_model_storagevolume.py +++ b/tests/test_model_storagevolume.py @@ -126,7 +126,7 @@ def _do_volume_test(self, model, host, ssl_port, pool_name): resp = self.request(vol_uri + '/clone', '{}', 'POST') self.assertEquals(202, resp.status) task = json.loads(resp.read()) - cloned_vol_name = task['target_uri'].split('/')[-1] + cloned_vol_name = task['target_uri'].split('/')[-2] rollback.prependDefer(model.storagevolume_delete, pool_name, cloned_vol_name) wait_task(_task_lookup, task['id'])
-- Lucio Correia Software Engineer IBM LTC Brazil
participants (2)
-
Aline Manera
-
Lucio Correia