Merge "Add 8 port topology file for agnostic vnf with ixia tg"
[yardstick.git] / yardstick / tests / unit / benchmark / scenarios / networking / test_vsperf_dpdk.py
index b305fc9..8bbe691 100644 (file)
@@ -116,15 +116,6 @@ class VsperfDPDKTestCase(unittest.TestCase):
         self.assertTrue(self.scenario._is_dpdk_setup())
         self.assertTrue(self.scenario.dpdk_setup_done)
 
-    @mock.patch.object(time, 'sleep')
-    def test_dpdk_setup_runtime_error(self, *args):
-        self.assertIsNotNone(self.scenario.client)
-        self.mock_ssh.from_node().execute.return_value = (1, '', '')
-        self.assertTrue(self.scenario.setup_done)
-
-        self.assertRaises(RuntimeError, self.scenario.dpdk_setup)
-
-    @mock.patch.object(time, 'sleep')
     @mock.patch.object(subprocess, 'check_output')
     def test_run_ok(self, *args):
         # run() specific mocks
@@ -135,17 +126,6 @@ class VsperfDPDKTestCase(unittest.TestCase):
         self.scenario.run(result)
         self.assertEqual(result['throughput_rx_fps'], '14797660.000')
 
-    def test_run_failed_vsperf_execution(self):
-        self.mock_ssh.from_node().execute.return_value = (1, '', '')
-
-        self.assertRaises(RuntimeError, self.scenario.run, {})
-
-    def test_run_falied_csv_report(self):
-        # run() specific mocks
-        self.mock_ssh.from_node().execute.return_value = (1, '', '')
-
-        self.assertRaises(RuntimeError, self.scenario.run, {})
-
     @mock.patch.object(time, 'sleep')
     @mock.patch.object(subprocess, 'check_output')
     def test_vsperf_run_sla_fail(self, *args):
@@ -171,6 +151,20 @@ class VsperfDPDKTestCase(unittest.TestCase):
         self.assertIn('throughput_rx_fps was not collected by VSPERF',
                       str(raised.exception))
 
+    @mock.patch.object(time, 'sleep')
+    @mock.patch.object(subprocess, 'check_output')
+    def test_vsperf_run_sla_fail_metric_not_collected_faulty_csv(self, *args):
+        self.scenario.setup()
+
+        self.mock_ssh.from_node().execute.return_value = (
+            0, 'faulty output not csv', '')
+
+        with self.assertRaises(y_exc.SLAValidationError) as raised:
+            self.scenario.run({})
+
+        self.assertIn('throughput_rx_fps was not collected by VSPERF',
+                      str(raised.exception))
+
     @mock.patch.object(time, 'sleep')
     @mock.patch.object(subprocess, 'check_output')
     def test_vsperf_run_sla_fail_sla_not_defined(self, *args):