diff options
author | 2018-03-09 17:44:34 +0100 | |
---|---|---|
committer | 2018-03-15 13:45:50 +0100 | |
commit | b071b23b024a07b5e0d9f1c915468384369e26af (patch) | |
tree | ac1ca80e07e1bf2bdffb79d26c37931348dd297a /ice-server/heat_test/heat_validator.py | |
parent | dd79a38607c40db86de950b4c1ecdff443fe68f4 (diff) |
Dockerize rest API for ICE tests
Change-Id: I8928203bb76a20fb7d10fd05d06151e2c6b7a934
Issue-ID: VNFSDK-214
Signed-off-by: Mickael JEZEQUEL <mickael.jezequel@orange.com>
Diffstat (limited to 'ice-server/heat_test/heat_validator.py')
-rw-r--r-- | ice-server/heat_test/heat_validator.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ice-server/heat_test/heat_validator.py b/ice-server/heat_test/heat_validator.py index 0cc32a1..d76d275 100644 --- a/ice-server/heat_test/heat_validator.py +++ b/ice-server/heat_test/heat_validator.py @@ -7,7 +7,7 @@ import zipfile from io import StringIO import pytest -from flask import (request, jsonify, abort) +from flask import (request, jsonify, abort, current_app) class HeatValidator(object): @@ -49,7 +49,8 @@ class HeatValidator(object): original_output = sys.stdout # Assign StringIO so the output is not sent anymore to the console sys.stdout = StringIO() - exit_code = pytest.main(['../../validation-scripts/ice_validator', + script_path = current_app.config['ICE_SCRIPT_PATH'] + exit_code = pytest.main([script_path, '--resultlog=' + tmp_dir + '/result.txt', '--template-dir', tmp_dir]) with open(tmp_dir + '/result.txt', 'r') as result_file: @@ -62,7 +63,7 @@ class HeatValidator(object): except zipfile.BadZipFile: logging.exception("invalid file") abort(422, {'status': 4, 'message': 'invalid file'}) - except: + except Exception as e: logging.exception("server error on file") abort(500, {'status': 3, 'message': 'server error'}) finally: |