From fe4945b2091d0bba8d86797e9c2acb62328dfb7e Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Thu, 11 Jan 2018 12:08:30 +0000 Subject: 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 --- tests/unit/benchmark/contexts/standalone/test_model.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/unit/benchmark') 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): -- cgit 1.2.3-korg