aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrichomme <morgan.richomme@orange.com>2020-09-25 17:21:38 +0200
committermrichomme <morgan.richomme@orange.com>2020-09-25 17:30:37 +0200
commit5c0bd7d165c18aabe3234cbd605e50e71c9d1f50 (patch)
tree910123f7e21176642c280c354fd23811e68b75bb
parent576fa380d748395c1d8188dfa816d110dab8f146 (diff)
Wait for distribution before launching the instantiation
Issue-ID: TEST-240 Signed-off-by: mrichomme <morgan.richomme@orange.com> Change-Id: Ib4fbd3d6b8eb870afd45ae88206ae57d142cf8e0 Signed-off-by: mrichomme <morgan.richomme@orange.com>
-rw-r--r--src/onaptests/steps/instantiate/service_ala_carte.py24
-rw-r--r--src/onaptests/templates/vnf-services/ubuntu16test-service.yaml1
2 files changed, 24 insertions, 1 deletions
diff --git a/src/onaptests/steps/instantiate/service_ala_carte.py b/src/onaptests/steps/instantiate/service_ala_carte.py
index 84d8208..eb98f19 100644
--- a/src/onaptests/steps/instantiate/service_ala_carte.py
+++ b/src/onaptests/steps/instantiate/service_ala_carte.py
@@ -168,6 +168,30 @@ class YamlTemplateServiceAlaCarteInstantiateStep(YamlTemplateBaseStep):
self._logger.info("Owning entity not found, create it")
owning_entity = AaiOwningEntity.create(settings.OWNING_ENTITY)
vid_project = Project.create(settings.PROJECT)
+
+ # Before instantiating, be sure that the service has been distributed
+ self._logger.info("******** Check Service Distribution *******")
+ distribution_completed = False
+ nb_try = 0
+ nb_try_max = 10
+ while distribution_completed is False and nb_try < nb_try_max:
+ distribution_completed = service.distributed
+ if distribution_completed is True:
+ self._logger.info(
+ "Service Distribution for %s is sucessfully finished",
+ service.name)
+ break
+ self._logger.info(
+ "Service Distribution for %s ongoing, Wait for 60 s",
+ service.name)
+ time.sleep(60)
+ nb_try += 1
+
+ if distribution_completed is False:
+ self._logger.error(
+ "Service Distribution for %s failed !!",service.name)
+ exit(1)
+
service_instantiation = ServiceInstantiation.instantiate_so_ala_carte(
service,
cloud_region,
diff --git a/src/onaptests/templates/vnf-services/ubuntu16test-service.yaml b/src/onaptests/templates/vnf-services/ubuntu16test-service.yaml
index 7e865ca..08485c9 100644
--- a/src/onaptests/templates/vnf-services/ubuntu16test-service.yaml
+++ b/src/onaptests/templates/vnf-services/ubuntu16test-service.yaml
@@ -2,7 +2,6 @@
ubuntu16test:
tosca_file_from_SDC: service-Ubuntu16tha-template
version: "1.0"
- subscription_type: "ubuntu16test"
vnfs:
- vnf_name: ubuntu16test
heat_files_to_upload: src/onaptests/templates/heat_files/ubuntu16/ubuntu16.zip