aboutsummaryrefslogtreecommitdiffstats
path: root/kud/tests
diff options
context:
space:
mode:
authorRitu Sood <Ritu.Sood@intel.com>2020-04-13 20:38:39 +0000
committerGerrit Code Review <gerrit@onap.org>2020-04-13 20:38:39 +0000
commit7945fcd8ed65792eeb174d999138b99dbc936a6f (patch)
tree01baba65c845f5af830e724f746357e640b63599 /kud/tests
parentc8ba8f21b68b64b4068f188614dd7c891edf035f (diff)
parentf65daf54a4ab24be9e2c82236a511cedc3bdf230 (diff)
Merge "Adding query APIs for AppIntents"
Diffstat (limited to 'kud/tests')
-rwxr-xr-xkud/tests/plugin_collection_v2.sh56
1 files changed, 25 insertions, 31 deletions
diff --git a/kud/tests/plugin_collection_v2.sh b/kud/tests/plugin_collection_v2.sh
index ffa366f1..f6cb3a06 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"
@@ -225,25 +231,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}"
@@ -262,8 +250,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}"
},
@@ -271,18 +259,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}"
}
]
@@ -293,14 +284,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}"
},
@@ -309,17 +300,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}"
}
]
@@ -330,7 +325,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
@@ -370,7 +365,7 @@ 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":{
@@ -381,8 +376,7 @@ payload="$(cat <<EOF
},
"spec":{
"intent":{
- "generic-placement-intent":"${genericPlacementIntentName1}",
- "generic-placement-intent":"${genericPlacementIntentName2}"
+ "generic-placement-intent":"${genericPlacementIntentName}"
}
}
}