summaryrefslogtreecommitdiffstats
path: root/kud
diff options
context:
space:
mode:
Diffstat (limited to 'kud')
-rwxr-xr-xkud/tests/plugin_collection_v2.sh74
-rw-r--r--kud/tests/vnfs/comp-app/collection/app1/profile/override_values.yaml3
-rw-r--r--kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/service.yaml4
-rw-r--r--kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/values.yaml6
-rw-r--r--kud/tests/vnfs/comp-app/collection/app2/profile/override_values.yaml2
5 files changed, 47 insertions, 42 deletions
diff --git a/kud/tests/plugin_collection_v2.sh b/kud/tests/plugin_collection_v2.sh
index 068864d7..3351d8fc 100755
--- a/kud/tests/plugin_collection_v2.sh
+++ b/kud/tests/plugin_collection_v2.sh
@@ -60,10 +60,16 @@ sub_composite_profile_name1="test_composite_profile1"
sub_composite_profile_name2="test_composite_profile2"
composite_profile_description="test_composite_profile_description"
-genericPlacementIntentName1="test_gen_placement_intent1"
-genericPlacementIntentName2="test_gen_placement_intent2"
+genericPlacementIntentName="test_gen_placement_intent1"
genericPlacementIntentDesc="test_gen_placement_intent_desc"
logicalCloud="logical_cloud_name"
+
+appIntentNameForApp1="appIntentForApp1"
+appIntentForApp1Desc="AppIntentForApp1Desc"
+appIntentNameForApp2="appIntentForApp2"
+appIntentForApp2Desc="AppIntentForApp2Desc"
+providerName1="aws"
+providerName2="azure"
clusterName1="edge1"
clusterName2="edge2"
clusterLabelName1="east-us1"
@@ -71,6 +77,9 @@ clusterLabelName2="east-us2"
deploymentIntentGroupName="test_deployment_intent_group"
deploymentIntentGroupNameDesc="test_deployment_intent_group_desc"
+releaseName="test"
+intentToBeAddedinDeploymentIntentGroup="name_of_intent_to_be_added_in_deployment_group"
+intentToBeAddedinDeploymentIntentGroupDesc="desc_of_intent_to_be_added_in_deployment_group"
chart_name="edgex"
profile_name="test_profile"
@@ -224,25 +233,7 @@ print_msg "Registering GenericPlacementIntent for app1"
payload="$(cat <<EOF
{
"metadata":{
- "name":"${genericPlacementIntentName1}",
- "description":"${genericPlacementIntentDesc}",
- "userData1":"${userData1}",
- "userData2":"${userData2}"
- },
- "spec":{
- "logical-cloud":"${logicalCloud}"
- }
-}
-EOF
-)"
-call_api -d "${payload}" "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/generic-placement-intents"
-
-
-print_msg "Registering GenericPlacementIntent for app2"
-payload="$(cat <<EOF
-{
- "metadata":{
- "name":"${genericPlacementIntentName2}",
+ "name":"${genericPlacementIntentName}",
"description":"${genericPlacementIntentDesc}",
"userData1":"${userData1}",
"userData2":"${userData2}"
@@ -261,8 +252,8 @@ print_msg "Adding placement intent for app1(collectd)"
payload="$(cat <<EOF
{
"metadata":{
- "name":"${genericPlacementIntentName1}",
- "description":"${genericPlacementIntentDesc}",
+ "name":"${appIntentNameForApp1}",
+ "description":"${appIntentForApp1Desc}",
"userData1":"${userData1}",
"userData2":"${userData2}"
},
@@ -270,18 +261,21 @@ payload="$(cat <<EOF
"app-name":"${app1_name}",
"intent":{
"allOf":[
- {
+ { "provider-name":"${providerName1}",
"cluster-name":"${clusterName1}"
},
{
+ "provider-name":"${providerName2}",
"cluster-name":"${clusterName2}"
},
{
"anyOf":[
{
+ "provider-name":"${providerName1}",
"cluster-label-name":"${clusterLabelName1}"
},
{
+ "provider-name":"${providerName2}",
"cluster-label-name":"${clusterLabelName2}"
}
]
@@ -292,14 +286,14 @@ payload="$(cat <<EOF
}
EOF
)"
-call_api -d "${payload}" "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/generic-placement-intents/${genericPlacementIntentName1}/app-intents"
+call_api -d "${payload}" "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/generic-placement-intents/${genericPlacementIntentName}/app-intents"
print_msg "Adding placement intent for app2(prometheus)"
payload="$(cat <<EOF
{
"metadata":{
- "name":"${genericPlacementIntentName2}",
- "description":"${genericPlacementIntentDesc}",
+ "name":"${appIntentNameForApp2}",
+ "description":"${appIntentForApp2Desc}",
"userData1":"${userData1}",
"userData2":"${userData2}"
},
@@ -308,17 +302,21 @@ payload="$(cat <<EOF
"intent":{
"allOf":[
{
+ "provider-name":"${providerName1}",
"cluster-name":"${clusterName1}"
},
{
+ "provider-name":"${providerName2}",
"cluster-name":"${clusterName2}"
},
{
"anyOf":[
{
+ "provider-name":"${providerName1}",
"cluster-label-name":"${clusterLabelName1}"
},
{
+ "provider-name":"${providerName2}",
"cluster-label-name":"${clusterLabelName2}"
}
]
@@ -329,7 +327,7 @@ payload="$(cat <<EOF
}
EOF
)"
-call_api -d "${payload}" "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/generic-placement-intents/${genericPlacementIntentName2}/app-intents"
+call_api -d "${payload}" "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/generic-placement-intents/${genericPlacementIntentName}/app-intents"
# END: Adding placement intent for each app in the composite app.
# BEGIN: Registering DeploymentIntentGroup in the database
@@ -344,20 +342,20 @@ payload="$(cat <<EOF
},
"spec":{
"profile":"${main_composite_profile_name}",
- "version":"${composite_app_version}",
+ "version":"${releaseName}",
"override-values":[
{
"app-name":"${app1_name}",
"values":
{
- "imageRepository":"registry.hub.docker.com"
+ "collectd_prometheus.service.targetPort":"9104"
}
},
{
"app-name":"${app2_name}",
"values":
{
- "imageRepository":"registry.hub.docker.com"
+ "prometheus.service.nameOfPort":"WebPort9090"
}
}
]
@@ -369,19 +367,18 @@ call_api -d "${payload}" "${base_url}/projects/${project_name}/composite-apps/${
# END: Registering DeploymentIntentGroup in the database
# BEGIN: Adding intents to an intent group
-print_msg "Adding two intents to the intent group"
+print_msg "Adding the genericPlacement intent to the deploymentIntent group"
payload="$(cat <<EOF
{
"metadata":{
- "name":"${deploymentIntentGroupName}",
- "description":"${deploymentIntentGroupNameDesc}",
+ "name":"${intentToBeAddedinDeploymentIntentGroup}",
+ "description":"${intentToBeAddedinDeploymentIntentGroupDesc}",
"userData1":"${userData1}",
"userData2":"${userData2}"
},
"spec":{
"intent":{
- "generic-placement-intent":"${genericPlacementIntentName1}",
- "generic-placement-intent":"${genericPlacementIntentName2}"
+ "generic-placement-intent":"${genericPlacementIntentName}"
}
}
}
@@ -390,3 +387,8 @@ EOF
call_api -d "${payload}" "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/deployment-intent-groups/${deploymentIntentGroupName}/intents"
# END: Adding intents to an intent group
+#BEGIN: Instantiation
+print_msg "Getting the sorted templates for each of the apps.."
+call_api -d "" "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/deployment-intent-groups/${deploymentIntentGroupName}/instantiate"
+# END: Instantiation
+
diff --git a/kud/tests/vnfs/comp-app/collection/app1/profile/override_values.yaml b/kud/tests/vnfs/comp-app/collection/app1/profile/override_values.yaml
index 304ae5de..b3c36804 100644
--- a/kud/tests/vnfs/comp-app/collection/app1/profile/override_values.yaml
+++ b/kud/tests/vnfs/comp-app/collection/app1/profile/override_values.yaml
@@ -1,8 +1,7 @@
collectd_prometheus:
service:
type: ClusterIP
- name: collectd-override
- port: 9103
+ port: 9104
targetPort: 9103
selector:
app: collectd
diff --git a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/service.yaml b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/service.yaml
index 0114ed2e..56fbb5f4 100644
--- a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/service.yaml
+++ b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/service.yaml
@@ -26,12 +26,12 @@ spec:
{{- end }}
{{- end }}
ports:
- - name: web
+ - name: {{ .Values.prometheus.service.nameOfPort }}
{{- if eq .Values.prometheus.service.type "NodePort" }}
nodePort: {{ .Values.global.nodePortPrefix }}{{ .Values.prometheus.service.nodePort }}
{{- end }}
port: 9090
- targetPort: web
+ targetPort: {{ .Values.prometheus.service.nameOfPort }}
selector:
app: prometheus
prometheus: {{ template "prometheus.fullname" . }}-prometheus
diff --git a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/values.yaml b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/values.yaml
index e35c6735..fa528900 100644
--- a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/values.yaml
+++ b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/values.yaml
@@ -37,9 +37,10 @@ prometheus:
- port: cadvisor-prometheus
interval: 10s
path: /metrics
-
+
resources: {}
service:
+ nameOfPort: web
type: ClusterIP
annotations: {}
labels: {}
@@ -67,3 +68,6 @@ prometheus:
#type: NodePort
sessionAffinity: ""
+
+global:
+ imagePullSecrets: "" \ No newline at end of file
diff --git a/kud/tests/vnfs/comp-app/collection/app2/profile/override_values.yaml b/kud/tests/vnfs/comp-app/collection/app2/profile/override_values.yaml
index 6743ac5b..041fc40d 100644
--- a/kud/tests/vnfs/comp-app/collection/app2/profile/override_values.yaml
+++ b/kud/tests/vnfs/comp-app/collection/app2/profile/override_values.yaml
@@ -1,6 +1,6 @@
service:
type: ClusterIP
- name: Prometheus
+ nameOfPort: webPort
annotations: {}
labels: {}
clusterIP: "" \ No newline at end of file