diff options
author | Vincenzo Riccobene <vincenzox.m.riccobene@intel.com> | 2015-12-16 15:14:21 +0000 |
---|---|---|
committer | Jörgen Karlsson <jorgen.w.karlsson@ericsson.com> | 2015-12-18 07:56:53 +0000 |
commit | 10594c003a2bc2e2b1ff45a2dff28911b9c2c8f5 (patch) | |
tree | e1aeb492eb8b592121e010f880f71e9b2f568810 /yardstick/vTC/apexlake/tests/generates_template_test.py | |
parent | a49a2474e96234da6dcd6ba7128664c62c345490 (diff) |
Add utility tools to ApexLake
Add utility tools and related tests to ApexLake
Fix also small things in all tests
JIRA: YARDSTICK-35
Change-Id: I76ab79b3b7ba3b48633517477b262f5bcdc743f0
Signed-off-by: Vincenzo Riccobene <vincenzox.m.riccobene@intel.com>
Diffstat (limited to 'yardstick/vTC/apexlake/tests/generates_template_test.py')
-rw-r--r-- | yardstick/vTC/apexlake/tests/generates_template_test.py | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/yardstick/vTC/apexlake/tests/generates_template_test.py b/yardstick/vTC/apexlake/tests/generates_template_test.py index 85435db6a..67e17cd37 100644 --- a/yardstick/vTC/apexlake/tests/generates_template_test.py +++ b/yardstick/vTC/apexlake/tests/generates_template_test.py @@ -19,6 +19,29 @@ import os import experimental_framework.common as common +def reset_common(): + common.LOG = None + common.CONF_FILE = None + common.DEPLOYMENT_UNIT = None + common.ITERATIONS = None + common.BASE_DIR = None + common.RESULT_DIR = None + common.TEMPLATE_DIR = None + common.TEMPLATE_NAME = None + common.TEMPLATE_FILE_EXTENSION = None + common.PKTGEN = None + common.PKTGEN_DIR = None + common.PKTGEN_DPDK_DIRECTORY = None + common.PKTGEN_PROGRAM = None + common.PKTGEN_COREMASK = None + common.PKTGEN_MEMCHANNEL = None + common.PKTGEN_BUS_SLOT_NIC_1 = None + common.PKTGEN_BUS_SLOT_NIC_2 = None + common.INFLUXDB_IP = None + common.INFLUXDB_PORT = None + common.INFLUXDB_DB_NAME = None + + class TestGeneratesTemplate(unittest.TestCase): def setUp(self): self.deployment_configuration = { @@ -27,16 +50,15 @@ class TestGeneratesTemplate(unittest.TestCase): 'vcpus': ['2'] } self.template_name = 'VTC_base_single_vm_wait.tmp' - common.init() - - def test_dummy(self): - self.assertTrue(True) + # common.init() def tearDown(self): - pass + reset_common() + @mock.patch('experimental_framework.common.LOG') @mock.patch('experimental_framework.common.get_template_dir') - def test_generates_template_for_success(self, mock_template_dir): + def test_generates_template_for_success(self, mock_template_dir, + mock_log): generated_templates_dir = 'tests/data/generated_templates/' mock_template_dir.return_value = generated_templates_dir test_templates = 'tests/data/test_templates/' @@ -50,7 +72,7 @@ class TestGeneratesTemplate(unittest.TestCase): generated.readlines()) t_name = '/tests/data/generated_templates/VTC_base_single_vm_wait.tmp' - self.template_name = os.getcwd() + t_name + self.template_name = "{}{}".format(os.getcwd(), t_name) heat_gen.generates_templates(self.template_name, self.deployment_configuration) for dirname, dirnames, filenames in os.walk(test_templates): |