aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCatherine Lefevre <cl664y@att.com>2021-01-05 11:31:58 +0000
committerGerrit Code Review <gerrit@onap.org>2021-01-05 11:31:58 +0000
commita2da63228ee409830170239c7ad0d9c073793909 (patch)
tree2be868ae8e5415abbfd6c63db7fcb1a37577bb7f /src
parent6a19fe0a4bbf2319af52c34a21ceca88cadd84cd (diff)
parent5c0d148a26d3880484cc47c859b695414836c76c (diff)
Merge "Prepare basic_clamp use case"
Diffstat (limited to 'src')
-rw-r--r--src/onaptests/configuration/settings.py2
-rw-r--r--src/onaptests/steps/loop/clamp.py26
-rw-r--r--src/onaptests/templates/vnf-services/ubuntu18agent-service.yaml4
3 files changed, 29 insertions, 3 deletions
diff --git a/src/onaptests/configuration/settings.py b/src/onaptests/configuration/settings.py
index 7a9d7c9..a2a4b4a 100644
--- a/src/onaptests/configuration/settings.py
+++ b/src/onaptests/configuration/settings.py
@@ -43,4 +43,4 @@ REPORTING_FILE_PATH = "/tmp/reporting.html"
K8S_REGION_TYPE = "k8s"
K8S_CONFIG = None # None means it will use default config (~/.kube/config)
K8S_NAMESPACE = "onap" # Kubernetes namespace
-# SOCK_HTTP = "socks5h://127.0.0.1:8080"
+# SOCK_HTTP = "socks5h://127.0.0.1:8083"
diff --git a/src/onaptests/steps/loop/clamp.py b/src/onaptests/steps/loop/clamp.py
index 3a5c1ad..b46e723 100644
--- a/src/onaptests/steps/loop/clamp.py
+++ b/src/onaptests/steps/loop/clamp.py
@@ -12,6 +12,7 @@ import time
from onapsdk.clamp.clamp_element import Clamp
from onapsdk.sdc.service import Service
+import onaptests.utils.exceptions as onap_test_exceptions
from onapsdk.configuration import settings
from onaptests.steps.onboard.clamp import OnboardClampStep
from onaptests.steps.loop.instantiate_loop import InstantiateLoop
@@ -108,6 +109,31 @@ class ClampStep(YamlTemplateBaseStep):
@YamlTemplateBaseStep.store_state
def execute(self):
super().execute() # TODO work only the 1st time, not if already onboarded
+
+ # Before instantiating, be sure that the service has been distributed
+ service = Service(self.service_name)
+ 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)
+ raise onap_test_exceptions.ServiceDistributionException
+
# time to wait for template load in CLAMP
self._logger.info("Wait a little bit to give a chance to the distribution")
time.sleep(settings.CLAMP_DISTRIBUTION_TIMER)
diff --git a/src/onaptests/templates/vnf-services/ubuntu18agent-service.yaml b/src/onaptests/templates/vnf-services/ubuntu18agent-service.yaml
index baf804e..94f45fe 100644
--- a/src/onaptests/templates/vnf-services/ubuntu18agent-service.yaml
+++ b/src/onaptests/templates/vnf-services/ubuntu18agent-service.yaml
@@ -1,7 +1,7 @@
---
-basicclamp-1:
+basicclamp:
vnfs:
- - vnf_name: basicclamp-1
+ - vnf_name: basicclamp
heat_files_to_upload: onaptests/templates/heat-files/ubuntu18/ubuntu18agent.zip
vnf_parameters: [
{"name": "ubuntu18_image_name",