DRAFT: model: remove vld_id not needed
[yardstick.git] / tests / unit / benchmark / contexts / test_standalone.py
index 1fc7403..b1402a1 100644 (file)
 # Unittest for yardstick.benchmark.contexts.standalone
 
 from __future__ import absolute_import
+
 import os
 import unittest
+
 import mock
 
 from yardstick.benchmark.contexts import standalone
-from yardstick.benchmark.contexts import sriov
-from yardstick.benchmark.contexts import ovsdpdk
+from yardstick.benchmark.contexts.standalone import ovsdpdk, sriov
 
 MOCKS = {
     'yardstick.benchmark.contexts': mock.MagicMock(),
-    'yardstick.benchmark.contexts.sriov': mock.MagicMock(),
-    'yardstick.benchmark.contexts.ovsdpdk': mock.MagicMock(),
+    'yardstick.benchmark.contexts.standalone.sriov': mock.MagicMock(),
+    'yardstick.benchmark.contexts.standalone.ovsdpdk': mock.MagicMock(),
     'yardstick.benchmark.contexts.standalone': mock.MagicMock(),
 }
 
 
-@mock.patch('yardstick.benchmark.contexts.ovsdpdk.time')
+@mock.patch('yardstick.benchmark.contexts.standalone.ovsdpdk.time')
 @mock.patch('yardstick.benchmark.contexts.standalone.time')
-@mock.patch('yardstick.benchmark.contexts.sriov.time')
+@mock.patch('yardstick.benchmark.contexts.standalone.sriov.time')
 class StandaloneContextTestCase(unittest.TestCase):
     NODES_SAMPLE = "nodes_sample_new.yaml"
     NODES_SAMPLE_SRIOV = "nodes_sample_new_sriov.yaml"
@@ -194,8 +195,6 @@ class StandaloneContextTestCase(unittest.TestCase):
         result = self.test_context._get_server(attr_name)
         self.assertEqual(result, None)
 
-
-
     def test__get_server_duplicate_sriov(self, mock_sriov_time, mock_standlalone_time,
                                          mock_ovsdpdk_time):
         attrs = {
@@ -244,6 +243,7 @@ class StandaloneContextTestCase(unittest.TestCase):
             ValueError,
             self.test_context._get_server,
             attr_name)
+
     def test__get_server_found_sriov(self, mock_sriov_time, mock_standlalone_time,
                                      mock_ovsdpdk_time):
         attrs = {
@@ -453,11 +453,6 @@ class StandaloneContextTestCase(unittest.TestCase):
         self.test_context.nfvi_obj.setup_ovs_bridge = mock.Mock()
         self.test_context.nfvi_obj.add_oflows = mock.Mock()
 
-        # self.test_context.nfvi_obj.setup_ovs(PORTS)
-        # self.test_context.nfvi_obj.start_ovs_serverswitch()
-        # self.test_context.nfvi_obj.setup_ovs_bridge()
-        # self.test_context.nfvi_obj.add_oflows()
-
         result = self.test_context.nfvi_obj.setup_ovs_context(
             PORTS,
             NIC_DETAILS,
@@ -570,7 +565,7 @@ class StandaloneContextTestCase(unittest.TestCase):
         self.assertIsNone(self.test_context.undeploy())
 
     def test_get_nfvi_obj_sriov(self, mock_sriov_time, mock_standlalone_time, mock_ovsdpdk_time):
-        with mock.patch('yardstick.benchmark.contexts.sriov'):
+        with mock.patch('yardstick.benchmark.contexts.standalone.sriov'):
             attrs = {
                 'name': 'sriov',
                 'file': self._get_file_abspath(self.NODES_SAMPLE)
@@ -595,7 +590,7 @@ class StandaloneContextTestCase(unittest.TestCase):
             self.assertIsNotNone(self.test_context.get_nfvi_obj())
 
     def test_get_nfvi_obj_ovs(self, mock_sriov_time, mock_standlalone_time, mock_ovsdpdk_time):
-        with mock.patch('yardstick.benchmark.contexts.ovsdpdk'):
+        with mock.patch('yardstick.benchmark.contexts.standalone.ovsdpdk'):
             attrs = {
                 'name': 'ovs',
                 'file': self._get_file_abspath(self.NODES_SAMPLE_OVSDPDK)
@@ -681,6 +676,7 @@ class StandaloneContextTestCase(unittest.TestCase):
         expected = network1
         result = self.test_context._get_network(attr_name)
         self.assertDictEqual(result, expected)
+
 if __name__ == '__main__':
     unittest.main()