diff options
author | Shubham Mishra <shivam828787@gmail.com> | 2020-10-23 15:15:53 +0530 |
---|---|---|
committer | Shubham Mishra <shivam828787@gmail.com> | 2020-10-24 00:37:50 +0530 |
commit | 49bb7680b18be1bcf869fa1d317a27f265a59469 (patch) | |
tree | d3c0f931d21f5af19cbe13b4cb39a5769af64ebf /hdv/redfish/hdv_redfish.py | |
parent | 98fd81e0c4e0f116c58bad8a8051f5e999af261e (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.py | 10 |
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 |