aboutsummaryrefslogtreecommitdiffstats
path: root/hdv/redfish/hdv_redfish.py
diff options
context:
space:
mode:
authorShubham Mishra <shivam828787@gmail.com>2020-10-23 15:15:53 +0530
committerShubham Mishra <shivam828787@gmail.com>2020-10-24 00:37:50 +0530
commit49bb7680b18be1bcf869fa1d317a27f265a59469 (patch)
treed3c0f931d21f5af19cbe13b4cb39a5769af64ebf /hdv/redfish/hdv_redfish.py
parent98fd81e0c4e0f116c58bad8a8051f5e999af261e (diff)
improved reporting file naming
Signed-off-by: Shubham Mishra <shivam828787@gmail.com> Change-Id: I8e65e67f4a5bb9a0119634d9068bded38e5ff839
Diffstat (limited to 'hdv/redfish/hdv_redfish.py')
-rw-r--r--hdv/redfish/hdv_redfish.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/hdv/redfish/hdv_redfish.py b/hdv/redfish/hdv_redfish.py
index 38a1347..aa791d2 100644
--- a/hdv/redfish/hdv_redfish.py
+++ b/hdv/redfish/hdv_redfish.py
@@ -516,9 +516,13 @@ def write_result_2_yaml(result, bmc_ip):
'''
write test result to new report.yaml
'''
- LOGGER.info("writing to yaml file")
+ if not os.path.exists('result'):
+ os.makedirs('result')
- yaml.safe_dump(result, open("./result/"+bmc_ip+time.ctime()+"_report.yaml", "w"),
+ report_file = "./result/"+bmc_ip+"_"+str(time.time())+"_report.yaml"
+ LOGGER.info("writing to yaml file %s", report_file)
+
+ yaml.safe_dump(result, open(report_file, "w"),
explicit_start=True)
def generate_testapi_result(cases_result):
@@ -534,7 +538,7 @@ def generate_testapi_result(cases_result):
return testapi_result
-@pytest.fixture('session')
+@pytest.fixture(scope='session')
def config_list(request):
return request.param