summaryrefslogtreecommitdiffstats
path: root/vnftest/dispatcher/file.py
diff options
context:
space:
mode:
authorMoshe <moshehoa@amdocs.com>2019-01-17 18:04:54 +0200
committerMoshe <moshehoa@amdocs.com>2019-01-17 18:05:01 +0200
commit6ed81bdf24927a0900d4857d7652ae48cc8c78b1 (patch)
tree821fff9c7ef18e7ce57ce353e75420900c896948 /vnftest/dispatcher/file.py
parent1112c6e3e6eae3aa10680b2d7b0d653de1a4bc0b (diff)
Refactor test reporting
Issue-ID: VNFSDK-350 Change-Id: I66a82ab56dd6702903e4d1edf776a6d29cb4e836 Signed-off-by: Moshe <moshehoa@amdocs.com>
Diffstat (limited to 'vnftest/dispatcher/file.py')
-rw-r--r--vnftest/dispatcher/file.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/vnftest/dispatcher/file.py b/vnftest/dispatcher/file.py
index 83d0fee..2504457 100644
--- a/vnftest/dispatcher/file.py
+++ b/vnftest/dispatcher/file.py
@@ -16,6 +16,8 @@
from __future__ import absolute_import
+import os
+
from vnftest.dispatcher.base import Base as DispatchBase
from vnftest.common import constants as consts
from vnftest.common import utils
@@ -29,8 +31,8 @@ class FileDispatcher(DispatchBase):
def __init__(self, conf):
super(FileDispatcher, self).__init__(conf)
- self.target = conf['dispatcher_file'].get('file_path',
- consts.DEFAULT_OUTPUT_FILE)
- def flush_result_data(self, data):
- utils.write_json_to_file(self.target, data)
+ def flush_result_data(self, id, data):
+ file_name = 'vnftest_' + str(id) + '.out'
+ target = self.conf['dispatcher_file'].get('file_path', os.path.join(consts.REPORT_DIR, file_name))
+ utils.write_json_to_file(target, data)