- Set global settings configuration files with all required input datas
including the dynamic forwarding port for ssh tunnel in
- src/onaptests/configuration/settings.py
+ src/onaptests/configuration/settings.py. You can customize the path for your
+ logs and reporting the page. Note that the reporting page assumes that the
+ logs are put in the same directory than the html page (relative path).
- Set OpenStack configuration: there are 2 ways to provide the cloud information
If you got the clouds.yaml, you need to reference your cloud with the env
import logging.config
import time
+import onaptests.utils.exceptions as onap_test_exceptions
from onapsdk.configuration import settings
from onaptests.steps.instantiate.vf_module_ala_carte import YamlTemplateVfModuleAlaCarteInstantiateStep
basic_vm_instantiate = YamlTemplateVfModuleAlaCarteInstantiateStep(
cleanup=settings.CLEANUP_FLAG)
- basic_vm_instantiate.execute()
- if settings.CLEANUP_FLAG:
- time.sleep(settings.CLEANUP_ACTIVITY_TIMER)
- try:
+ try:
+ basic_vm_instantiate.execute()
+ if settings.CLEANUP_FLAG:
+ time.sleep(settings.CLEANUP_ACTIVITY_TIMER)
basic_vm_instantiate.cleanup()
- except ValueError as error:
- logger.info("service instance deleted as expected {0}".format(error))
+ except onap_test_exceptions.TestConfigurationException:
+ logger.error("Basic VM configuration error")
+ except onap_test_exceptions.ServiceInstantiateException:
+ logger.error("Basic VM instantiation error")
+ except onap_test_exceptions.ServiceCleanupException:
+ logger.error("Basic VM instance cleanup error")
+ except onap_test_exceptions.VnfInstantiateException:
+ logger.error("Basic VM Vnf instantiation error")
+ except onap_test_exceptions.VnfCleanupException:
+ logger.error("Basic VM Vnf instance cleanup error")
+ except onap_test_exceptions.VfModuleInstantiateException:
+ logger.error("Basic VM Module instantiation error")
+ except onap_test_exceptions.VfModuleCleanupException:
+ logger.error("Basic VM Module cleanup error")
+
basic_vm_instantiate.reports_collection.generate_report()
def generate_report(self) -> None:
step_list = self.report
- failing_steps = []
+ failing_steps = {}
for step,status in step_list.items():
if 'FAIL' in status:
failing_steps[step] = status
except NameError:
components = ""
- log_path = settings.LOG_CONFIG['handlers']['file']['filename']
jinja_env = Environment(
autoescape=select_autoescape(['html']),
loader=FileSystemLoader(sys.path[-1] + '/onaptests/templates/reporting'))
usecase=usecase,
details=details,
components=components,
- log_path=log_path).dump(
+ log_path="./pythonsdk.debug.log").dump(
settings.REPORTING_FILE_PATH)