summaryrefslogtreecommitdiffstats
path: root/dovetail/testcase.py
diff options
context:
space:
mode:
authorMatthewLi <matthew.lijun@huawei.com>2017-03-22 02:39:25 -0400
committerJun Li <matthew.lijun@huawei.com>2017-03-30 07:25:47 +0000
commitd2a04a76f9f03ca4c34cfed335c14d7c3319c634 (patch)
tree236429b66a2e41f922f5da3e645c44221ea06c51 /dovetail/testcase.py
parente0f4b3a6f279e8e3f4bc05307d60d6983cc60735 (diff)
dovetail tool: refstack testcase integration
JIRA: DOVETAIL-370 Change-Id: I60c9f431358f848e24abcb865c4b2ca8c3b2d843 Signed-off-by: MatthewLi <matthew.lijun@huawei.com>
Diffstat (limited to 'dovetail/testcase.py')
-rw-r--r--dovetail/testcase.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/dovetail/testcase.py b/dovetail/testcase.py
index aeeeee68..7f218c47 100644
--- a/dovetail/testcase.py
+++ b/dovetail/testcase.py
@@ -115,6 +115,14 @@ class Testcase(object):
self.name())
return pre_condition
+ def pre_copy_dest_path(self):
+ try:
+ pre_copy_dest_path = \
+ self.testcase['validate']['pre_copy']['dest_path']
+ except KeyError:
+ pre_copy_dest_path = ''
+ return pre_copy_dest_path
+
def post_condition(self):
try:
post_condition = self.testcase['validate']['post_condition']
@@ -128,6 +136,23 @@ class Testcase(object):
self.name())
return post_condition
+ def mk_src_file(self):
+ testcase_src_file = self.testcase['validate']['pre_copy']['src_file']
+ try:
+ with open(os.path.join(dt_cfg.dovetail_config['result_dir'],
+ testcase_src_file), 'w+') as src_file:
+ if self.sub_testcase() is not None:
+ for sub_test in self.sub_testcase():
+ self.logger.info('save testcases %s', sub_test)
+ src_file.write(sub_test + '\n')
+ self.logger.info('save testcases to %s', src_file)
+ except Exception:
+ self.logger.error('Failed to save: %s', src_file)
+
+ src_file_path = os.path.join(dt_cfg.dovetail_config['result_dir'],
+ testcase_src_file)
+ return src_file_path
+
def run(self):
runner = TestRunnerFactory.create(self)
try: