aboutsummaryrefslogtreecommitdiffstats
path: root/run_basic_cnf_macro.py
diff options
context:
space:
mode:
authorLukasz Rajewski <lukasz.rajewski@orange.com>2021-12-23 13:40:11 +0100
committerMichal Jagiello <michal.jagiello@t-mobile.pl>2022-01-12 22:09:13 +0000
commit22664610f99038223f996ef1c1661872a92e4ee4 (patch)
tree081ea2904008e25718f4bf5cf4ed17f73d3a4782 /run_basic_cnf_macro.py
parent2bd16f8898e6fd74e64b1500eb5fbc4448517d1a (diff)
[TEST] Basic CNF macro
Basic CNF macro added with refactoring that enables debugging under IDE Also SDK upgraded to 9.2 what required adaptation in existing tests Issue-ID: TEST-376 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com> Change-Id: I697857bc0c13e86b88b71c3b46e0c4b59751939c Signed-off-by: mrichomme <morgan.richomme@orange.com>
Diffstat (limited to 'run_basic_cnf_macro.py')
-rw-r--r--run_basic_cnf_macro.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/run_basic_cnf_macro.py b/run_basic_cnf_macro.py
new file mode 100644
index 0000000..e6c1823
--- /dev/null
+++ b/run_basic_cnf_macro.py
@@ -0,0 +1,32 @@
+import logging.config
+import time
+import onaptests.utils.exceptions as onap_test_exceptions
+from onapsdk.configuration import settings
+from onaptests.scenario.basic_cnf_macro import BasicCnfMacro
+
+if __name__ == "__main__":
+ # logging configuration for onapsdk, it is not requested for onaptests
+ # Correction requested in onapsdk to avoid having this duplicate code
+ logging.config.dictConfig(settings.LOG_CONFIG)
+ logger = logging.getLogger("Instantiate Apache CNF with macro procedure")
+ step = BasicCnfMacro(cleanup=settings.CLEANUP_FLAG)
+ try:
+ step.execute()
+ if settings.CLEANUP_FLAG:
+ logger.info("Starting to clean up in {} seconds".format(settings.CLEANUP_ACTIVITY_TIMER))
+ time.sleep(settings.CLEANUP_ACTIVITY_TIMER)
+ step.cleanup()
+ except onap_test_exceptions.TestConfigurationException:
+ logger.error("Ubuntu NSO VM configuration error")
+ except onap_test_exceptions.ServiceInstantiateException:
+ logger.error("Ubuntu NSO VM instantiation error")
+ except onap_test_exceptions.ServiceCleanupException:
+ logger.error("Ubuntu NSO VM instance cleanup error")
+ except onap_test_exceptions.VnfInstantiateException:
+ logger.error("Ubuntu NSO VM Vnf instantiation error")
+ except onap_test_exceptions.VnfCleanupException:
+ logger.error("Ubuntu NSO VM Vnf instance cleanup error")
+ except onap_test_exceptions.VfModuleInstantiateException:
+ logger.error("Ubuntu NSO VM Module instantiation error")
+ except onap_test_exceptions.VfModuleCleanupException:
+ logger.error("Ubuntu NSO VM Module cleanup error")