summaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/contexts/standalone/test_model.py
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-01-11 12:08:30 +0000
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-01-24 18:51:06 +0000
commitfe4945b2091d0bba8d86797e9c2acb62328dfb7e (patch)
treef449fd898e1e80a493da98b3ed28a01a21809dfc /tests/unit/benchmark/contexts/standalone/test_model.py
parent810f91e242a5d1a562712df72a9ec95605ed1bab (diff)
Remove generated file in 'test_build_vm_xml'
Change I22e95c488e27d6e2a8fdf6c1a07faab275fa6bba introduced a change in test case 'test_build_vm_xml' [1]. This test case generates a file which is stored locally but never removed. [1]https://github.com/opnfv/yardstick/blob/80dc9034edeb05f66bfa6264ae0adf0f6aea60da/tests/unit/benchmark/contexts/standalone/test_model.py JIRA: YARDSTICK-918 Change-Id: I91d39bb37c3d8a273fe68155bb308c5a3bc1ca9d Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Diffstat (limited to 'tests/unit/benchmark/contexts/standalone/test_model.py')
-rw-r--r--tests/unit/benchmark/contexts/standalone/test_model.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unit/benchmark/contexts/standalone/test_model.py b/tests/unit/benchmark/contexts/standalone/test_model.py
index 021c18860..6090356b6 100644
--- a/tests/unit/benchmark/contexts/standalone/test_model.py
+++ b/tests/unit/benchmark/contexts/standalone/test_model.py
@@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Unittest for yardstick.benchmark.contexts.standalone.model
-
import copy
import os
import unittest
@@ -182,6 +180,8 @@ class ModelLibvirtTestCase(unittest.TestCase):
*args):
# NOTE(ralonsoh): this test doesn't cover function execution. This test
# should also check mocked function calls.
+ cfg_file = 'test_config_file.cfg'
+ self.addCleanup(os.remove, cfg_file)
result = [4]
with mock.patch("yardstick.ssh.SSH") as ssh:
ssh_mock = mock.Mock(autospec=ssh.SSH)
@@ -190,7 +190,7 @@ class ModelLibvirtTestCase(unittest.TestCase):
ssh.return_value = ssh_mock
mock_create_snapshot_qemu.return_value = "0.img"
- status = model.Libvirt.build_vm_xml(ssh_mock, {}, "test", "vm_0", 0)
+ status = model.Libvirt.build_vm_xml(ssh_mock, {}, cfg_file, 'vm_0', 0)
self.assertEqual(status[0], result[0])
def test_update_interrupts_hugepages_perf(self):