aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/scenarios/compute
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/benchmark/scenarios/compute')
-rw-r--r--tests/unit/benchmark/scenarios/compute/test_lmbench.py13
-rw-r--r--tests/unit/benchmark/scenarios/compute/test_ramspeed.py9
2 files changed, 14 insertions, 8 deletions
diff --git a/tests/unit/benchmark/scenarios/compute/test_lmbench.py b/tests/unit/benchmark/scenarios/compute/test_lmbench.py
index 08f5da332..65939c6ba 100644
--- a/tests/unit/benchmark/scenarios/compute/test_lmbench.py
+++ b/tests/unit/benchmark/scenarios/compute/test_lmbench.py
@@ -68,8 +68,7 @@ class LmbenchTestCase(unittest.TestCase):
sample_output = '[{"latency": 4.944, "size": 0.00049}]'
mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
l.run(self.result)
- expected_result = jsonutils.loads(
- '{"latencies": ' + sample_output + "}")
+ expected_result = {"latencies0.latency": 4.944, "latencies0.size": 0.00049}
self.assertEqual(self.result, expected_result)
def test_successful_bandwidth_run_no_sla(self, mock_ssh):
@@ -105,8 +104,7 @@ class LmbenchTestCase(unittest.TestCase):
sample_output = '[{"latency": 4.944, "size": 0.00049}]'
mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
l.run(self.result)
- expected_result = jsonutils.loads(
- '{"latencies": ' + sample_output + "}")
+ expected_result = {"latencies0.latency": 4.944, "latencies0.size": 0.00049}
self.assertEqual(self.result, expected_result)
def test_successful_bandwidth_run_sla(self, mock_ssh):
@@ -191,3 +189,10 @@ class LmbenchTestCase(unittest.TestCase):
mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR')
self.assertRaises(RuntimeError, l.run, self.result)
+
+
+def main():
+ unittest.main()
+
+if __name__ == '__main__':
+ main()
diff --git a/tests/unit/benchmark/scenarios/compute/test_ramspeed.py b/tests/unit/benchmark/scenarios/compute/test_ramspeed.py
index 85d49641e..4f71fbb36 100644
--- a/tests/unit/benchmark/scenarios/compute/test_ramspeed.py
+++ b/tests/unit/benchmark/scenarios/compute/test_ramspeed.py
@@ -18,6 +18,7 @@ import unittest
import mock
from oslo_serialization import jsonutils
+from yardstick.common import utils
from yardstick.benchmark.scenarios.compute import ramspeed
@@ -77,7 +78,7 @@ class RamspeedTestCase(unittest.TestCase):
"Block_size(kb)": 32768, "Bandwidth(MBps)": 8340.85}]}'
mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
r.run(self.result)
- expected_result = jsonutils.loads(sample_output)
+ expected_result = utils.flatten_dict_key(jsonutils.loads(sample_output))
self.assertEqual(self.result, expected_result)
def test_ramspeed_successful_run_sla(self, mock_ssh):
@@ -113,7 +114,7 @@ class RamspeedTestCase(unittest.TestCase):
"Block_size(kb)": 32768, "Bandwidth(MBps)": 8340.85}]}'
mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
r.run(self.result)
- expected_result = jsonutils.loads(sample_output)
+ expected_result = utils.flatten_dict_key(jsonutils.loads(sample_output))
self.assertEqual(self.result, expected_result)
def test_ramspeed_unsuccessful_run_sla(self, mock_ssh):
@@ -179,7 +180,7 @@ class RamspeedTestCase(unittest.TestCase):
"Bandwidth(MBps)": 9401.58}]}'
mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
r.run(self.result)
- expected_result = jsonutils.loads(sample_output)
+ expected_result = utils.flatten_dict_key(jsonutils.loads(sample_output))
self.assertEqual(self.result, expected_result)
def test_ramspeed_mem_successful_run_sla(self, mock_ssh):
@@ -200,7 +201,7 @@ class RamspeedTestCase(unittest.TestCase):
"Bandwidth(MBps)": 9401.58}]}'
mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
r.run(self.result)
- expected_result = jsonutils.loads(sample_output)
+ expected_result = utils.flatten_dict_key(jsonutils.loads(sample_output))
self.assertEqual(self.result, expected_result)
def test_ramspeed_mem_unsuccessful_run_sla(self, mock_ssh):
gt; <div id="wrapper"> <!-- Header --> <header id="header"> <div class="inner"> <!-- Logo --> <a href="index.html" class="logo"> <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span> </a> </div> </header> <!-- Menu --> <!-- Main --> <div id="main"> <div class="inner"> <header> <h1>Fraser reporting</h1> </header> <section class="tiles"> <article class="style3"> <span class="image"> <img src="img/projectIcon_functest_250x250.png" alt="" /> </span> <a href="fraser/functest/functest.html"> <h2>Functest</h2> <div class="content"> <p>Functional testing</p> </div> </a> </article> <article class="style2"> <span class="image"> <img src="img/projectIcon_yardstick_250x250.png" alt="" /> </span> <a href="fraser/yardstick/status-apex.html"> <h2>Yardstick</h2> <div class="content"> <p>Qualification and performance testing</p> </div> </a> </article> <article class="style4"> <span class="image"> <img src="img/projectIcon_storperf_250x250.png" alt="" /> </span> <a href="fraser/storperf/status-apex.html"> <h2>Storperf</h2> <div class="content"> <p>Storage testing</p> </div> </a> </article> <article class="style5"> <span class="image"> <img src="img/projectIcon_vsperf_250x250.png" alt="" /> </span> <a href="fraser/vsperf/reporting.html"> <h2>Vsperf</h2> <div class="content"> <p>Virtual switch testing</p> </div> </a> </article> <article class="style1"> <span class="image"> <img src="img/projectIcon_qtip_250x250.png" alt="" /> </span> <a href="fraser/qtip/status-apex.html"> <h2>Qtip</h2> <div class="content"> <p>Benchmark as a service</p> </div> </a> </article> <article class="style6"> <span class="image"> <img src="img/projectIcon_bottlenecks_250x250.png" alt="" /> </span> <a href="fraser/bottlenecks/status-apex.html"> <h2>Bottlenecks</h2> <div class="content"> <p>Bottleneck finder</p> </div> </a> </article> </section> </div> </div> <!-- Footer --> <footer id="footer"> <div class="inner"> <section> <h2>OPNFV Testing Working group</h2> </section> <section> <h2>Follow</h2> <ul class="icons"> <li><a href="https://twitter.com/opnfv" class="icon style2 fa-twitter"><span class="label">Twitter</span></a></li> <li><a href="http://git.opnfv.org" class="icon style2 fa-github"><span class="label">GitHub</span></a></li> <li><a href="mailto:test-wg@list.opnfv.org" class="icon style2 fa-envelope-o"><span class="label">Email</span></a></li> </ul> </section> <ul class="copyright"> <li>&copy; Untitled. All rights reserved</li><li>Design: <a href="http://html5up.net">HTML5 UP</a></li> </ul> </div> </footer> </div> <!-- Scripts --> <script src="3rd_party/js/jquery.min.js"></script> <script src="3rd_party/js/skel.min.js"></script> <script src="3rd_party/js/util.js"></script> <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]--> <script src="3rd_party/js/main.js"></script> </body> </html>