diff options
author | Navya <navyax.bathula@intel.com> | 2017-10-16 07:26:41 -0700 |
---|---|---|
committer | Navya Bathula <navyax.bathula@intel.com> | 2017-10-25 11:20:20 +0000 |
commit | 5a1f65d3e7d67488ee6f558dccfa5ca5581ddb65 (patch) | |
tree | 73bbce88702907b83cf50a3ffdd76a82656c2beb | |
parent | 1ca9d52152d54b51b4d9dcd6c429f114ad4fe24c (diff) |
KVMFORNFV: To avoid livemigration result update to json
This patch is used to remove the livemigration testcase result loaded
to json as there is no dashboard implemented for the testcase
Change-Id: I7a9589a0bbc5f2a28587c2878da042fc50af18e0
Signed-off-by: Navya Bathula <navyax.bathula@intel.com>
-rw-r--r-- | tests/unit/benchmark/scenarios/compute/test_qemumigrate.py | 21 | ||||
-rw-r--r-- | yardstick/benchmark/scenarios/compute/qemu_migrate.py | 4 |
2 files changed, 13 insertions, 12 deletions
diff --git a/tests/unit/benchmark/scenarios/compute/test_qemumigrate.py b/tests/unit/benchmark/scenarios/compute/test_qemumigrate.py index 9514729ba..f163f1914 100644 --- a/tests/unit/benchmark/scenarios/compute/test_qemumigrate.py +++ b/tests/unit/benchmark/scenarios/compute/test_qemumigrate.py @@ -16,7 +16,6 @@ from __future__ import absolute_import import unittest import mock -from oslo_serialization import jsonutils from yardstick.benchmark.scenarios.compute import qemu_migrate @@ -84,7 +83,7 @@ class QemuMigrateTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '') q.run(result) - expected_result = jsonutils.loads(sample_output) + expected_result = {} self.assertEqual(result, expected_result) def test_qemu_migrate_successful_sla(self, mock_ssh): @@ -104,7 +103,7 @@ class QemuMigrateTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '') q.run(result) - expected_result = jsonutils.loads(sample_output) + expected_result = {} self.assertEqual(result, expected_result) def test_qemu_migrate_unsuccessful_sla_totaltime(self, mock_ssh): @@ -118,7 +117,8 @@ class QemuMigrateTestCase(unittest.TestCase): sample_output = '{"totaltime": 15, "downtime": 2, "setuptime": 1}' mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '') - self.assertRaises(AssertionError, q.run, result) + with self.assertRaises(AssertionError): + q.run(result) def test_qemu_migrate_unsuccessful_sla_downtime(self, mock_ssh): @@ -131,7 +131,8 @@ class QemuMigrateTestCase(unittest.TestCase): sample_output = '{"totaltime": 15, "downtime": 2, "setuptime": 1}' mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '') - self.assertRaises(AssertionError, q.run, result) + with self.assertRaises(AssertionError): + q.run(result) def test_qemu_migrate_unsuccessful_sla_setuptime(self, mock_ssh): @@ -142,9 +143,10 @@ class QemuMigrateTestCase(unittest.TestCase): q.setup() sample_output = '{"totaltime": 15, "downtime": 2, "setuptime": 1}' - + mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '') - self.assertRaises(AssertionError, q.run, result) + with self.assertRaises(AssertionError): + q.run(result) def test_qemu_migrate_unsuccessful_script_error(self, mock_ssh): @@ -154,10 +156,9 @@ class QemuMigrateTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (0, '', '') q.setup() - mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR') - self.assertRaises(RuntimeError, q.run, result) - + with self.assertRaises(RuntimeError): + q.run(result) def main(): unittest.main() diff --git a/yardstick/benchmark/scenarios/compute/qemu_migrate.py b/yardstick/benchmark/scenarios/compute/qemu_migrate.py index 2de1270ef..286d8cdaf 100644 --- a/yardstick/benchmark/scenarios/compute/qemu_migrate.py +++ b/yardstick/benchmark/scenarios/compute/qemu_migrate.py @@ -113,11 +113,11 @@ class QemuMigrate(base.Scenario): if status: raise RuntimeError(stderr) - result.update(jsonutils.loads(stdout)) + parsed_data = jsonutils.loads(stdout) if "sla" in self.scenario_cfg: sla_error = "" - for t, timevalue in result.items(): + for t, timevalue in parsed_data.items(): if 'max_%s' % t not in self.scenario_cfg['sla']: continue |