diff options
14 files changed, 1189 insertions, 10 deletions
diff --git a/deployment/heat/onap-oom/env/tlab/ETE-HEAT-Test.env b/deployment/heat/onap-oom/env/tlab/ETE-HEAT-Test.env index 843e00618..daa145a86 100644 --- a/deployment/heat/onap-oom/env/tlab/ETE-HEAT-Test.env +++ b/deployment/heat/onap-oom/env/tlab/ETE-HEAT-Test.env @@ -14,8 +14,8 @@ parameters: apt_proxy: 192.168.31.204:3142 docker_proxy: 192.168.31.204:5000 - rancher_vm_flavor: m1.large - k8s_vm_flavor: m2.xxlarge + rancher_vm_flavor: m2.large + k8s_vm_flavor: m5.xxlarge public_net_id: fbe8fd92-6636-4e63-ab28-bb6a5b0888a9 public_net_name: admin-vpn-floating diff --git a/deployment/heat/onap-oom/env/tlab/ETE-OOM-Test.env b/deployment/heat/onap-oom/env/tlab/ETE-OOM-Test.env index 2b54be772..cbda112f7 100644 --- a/deployment/heat/onap-oom/env/tlab/ETE-OOM-Test.env +++ b/deployment/heat/onap-oom/env/tlab/ETE-OOM-Test.env @@ -14,8 +14,8 @@ parameters: apt_proxy: 192.168.31.204:3142 docker_proxy: 192.168.31.204:5000 - rancher_vm_flavor: m1.large - k8s_vm_flavor: m2.xxlarge + rancher_vm_flavor: m2.large + k8s_vm_flavor: m5.xxlarge public_net_id: fbe8fd92-6636-4e63-ab28-bb6a5b0888a9 public_net_name: admin-vpn-floating diff --git a/deployment/heat/onap-oom/scripts/deploy.sh b/deployment/heat/onap-oom/scripts/deploy.sh index c81e65c8b..056174d28 100755 --- a/deployment/heat/onap-oom/scripts/deploy.sh +++ b/deployment/heat/onap-oom/scripts/deploy.sh @@ -19,8 +19,8 @@ for n in $(seq 1 5); do envsubst < $ENV_FILE > $ENV_FILE~ openstack stack create -t ./onap-oom.yaml -e $ENV_FILE~ onap-oom - for i in $(seq 1 10); do - sleep 10 + for i in $(seq 1 30); do + sleep 30 K8S_IP=$(openstack stack output show onap-oom k8s_vm_ip -c output_value -f value) RANCHER_IP=$(openstack stack output show onap-oom rancher_vm_ip -c output_value -f value) timeout 1 ping -c 1 "$K8S_IP" && timeout 1 ping -c 1 "$RANCHER_IP" && break @@ -38,7 +38,7 @@ fi ssh-keygen -R $K8S_IP for n in $(seq 1 10); do - timeout 2m ssh -o StrictHostKeychecking=no -i ~/.ssh/onap_key ubuntu@$K8S_IP 'sudo su -l root -c "/root/oom/kubernetes/robot/ete-k8s.sh onap health"' + timeout 15m ssh -o StrictHostKeychecking=no -i ~/.ssh/onap_key ubuntu@$K8S_IP 'sudo su -l root -c "/root/oom/kubernetes/robot/ete-k8s.sh onap health"' RESULT=$? if [ $RESULT -eq 0 ]; then break diff --git a/test/csit/scripts/externalapi-nbi/start_nbi_containers.sh b/test/csit/scripts/externalapi-nbi/start_nbi_containers.sh index d1a026a67..7237a1fbc 100644 --- a/test/csit/scripts/externalapi-nbi/start_nbi_containers.sh +++ b/test/csit/scripts/externalapi-nbi/start_nbi_containers.sh @@ -36,3 +36,16 @@ docker pull $NEXUS_DOCKER_REPO/onap/externalapi/nbi:$DOCKER_IMAGE_VERSION # Start nbi, MariaDB and MongoDB containers with docker compose and nbi/docker-compose.yml docker-compose up -d mariadb mongo && sleep 5 # to ensure that these services are ready for connections docker-compose up -d nbi + +NBI_CONTAINER_NAME=$(docker-compose ps 2> /dev/null | tail -n+3 | tr -s ' ' | cut -d' ' -f1 | grep _nbi_) +NBI_IP=$(docker inspect $NBI_CONTAINER_NAME --format='{{ range .NetworkSettings.Networks }}{{ .IPAddress }}{{ end }}') + +echo "IP address for NBI main container ($NBI_CONTAINER_NAME) is set to ${NBI_IP}." + +# Wait for initialization +for i in {1..30}; do + curl -sS ${NBI_IP}:8080 > /dev/null 2>&1 && break + echo sleep $i + sleep $i +done + diff --git a/test/csit/scripts/optf-has/has/has-properties/conductor.conf.onap b/test/csit/scripts/optf-has/has/has-properties/conductor.conf.onap index 0f9e7494d..a8e84846c 100644 --- a/test/csit/scripts/optf-has/has/has-properties/conductor.conf.onap +++ b/test/csit/scripts/optf-has/has/has-properties/conductor.conf.onap @@ -314,7 +314,7 @@ aafns = conductor #table_prefix = sdnc # Base URL for SDN-C. (string value) -server_url = http://localhost:8082/restconf/ +server_url = http://localhost:8083/restconf/ # Basic Authentication Username (string value) username = admin @@ -346,3 +346,33 @@ extensions = sdnc # solver will restart any orphaned solving requests at startup. (boolean value) #concurrent = false + +[multicloud] + +# +# From conductor +# + +# Base URL for Multicloud without a trailing slash. (string value) +server_url = http://msb.onap.org:8082/api/multicloud + +# Timeout for Multicloud Rest Call (string value) +multicloud_rest_timeout = 30 + +# Number of retry for Multicloud Rest Call (string value) +multicloud_retries = 3 + +# The version of Multicloud API. (string value) +server_url_version = v0 + + + +[vim_controller] + +# +# From conductor +# + +# Extensions list to use (list value) +extensions = multicloud + diff --git a/test/csit/scripts/optf-has/has/has_script.sh b/test/csit/scripts/optf-has/has/has_script.sh index ac907eea1..ee5479e10 100755 --- a/test/csit/scripts/optf-has/has/has_script.sh +++ b/test/csit/scripts/optf-has/has/has_script.sh @@ -60,7 +60,7 @@ MULTICLOUDSIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.I echo "MULTICLOUDSIM_IP=${MULTICLOUDSIM_IP}" # change MULTICLOUD reference to the local instance -sed -i -e "s%localhost:8082/%${MULTICLOUDSIM_IP}:8082/%g" /tmp/conductor/properties/conductor.conf +sed -i -e "s%msb.onap.org:8082/%${MULTICLOUDSIM_IP}:8082/%g" /tmp/conductor/properties/conductor.conf #onboard conductor into music curl -vvvvv --noproxy "*" --request POST http://${MUSIC_IP}:8080/MUSIC/rest/v2/admin/onboardAppWithMusic -H "Content-Type: application/json" --data @${WORKSPACE}/test/csit/tests/optf-has/has/data/onboard.json diff --git a/test/csit/tests/externalapi-nbi/healthcheck/healthcheck.robot b/test/csit/tests/externalapi-nbi/healthcheck/healthcheck.robot index eb5a5bb4f..21c084894 100644 --- a/test/csit/tests/externalapi-nbi/healthcheck/healthcheck.robot +++ b/test/csit/tests/externalapi-nbi/healthcheck/healthcheck.robot @@ -1,6 +1,7 @@ *** Settings *** Documentation The main interface for interacting with External API/NBI Library RequestsLibrary +Library Collections *** Variables *** ${GLOBAL_NBI_SERVER_PROTOCOL} http @@ -9,6 +10,9 @@ ${GLOBAL_NBI_SERVER_PORT} 8080 ${NBI_HEALTH_CHECK_PATH} /nbi/api/v1/status ${NBI_ENDPOINT} ${GLOBAL_NBI_SERVER_PROTOCOL}://${GLOBAL_INJECTED_NBI_IP_ADDR}:${GLOBAL_NBI_SERVER_PORT} +*** Test Cases *** +NBI Health Check + Run NBI Health Check *** Keywords *** Run NBI Health Check @@ -26,4 +30,4 @@ Run NBI Get Request ${json}= Set Variable ${resp.json()} ${status}= Get From Dictionary ${json} status Should Be Equal ${status} ok - [Return] ${resp}
\ No newline at end of file + [Return] ${resp} diff --git a/test/csit/tests/optf-has/has/data/plan_with_hpa.json b/test/csit/tests/optf-has/has/data/plan_with_hpa.json new file mode 100644 index 000000000..bf314a9cb --- /dev/null +++ b/test/csit/tests/optf-has/has/data/plan_with_hpa.json @@ -0,0 +1,230 @@ +{ + "name":"vCPE-with-HPA", + "template":{ + "homing_template_version":"2017-10-10", + "parameters":{ + "service_name":"Residential vCPE", + "service_id":"vcpe_service_id", + "customer_lat":45.395968, + "customer_long":-71.135344, + "REQUIRED_MEM":4, + "REQUIRED_DISK":100, + "pnf_id":"some_pnf_id" + }, + "locations":{ + "customer_loc":{ + "latitude":{ + "get_param":"customer_lat" + }, + "longitude":{ + "get_param":"customer_long" + } + } + }, + "demands":{ + "vG":[ + { + "inventory_provider":"aai", + "inventory_type":"cloud" + } + ] + }, + "constraints":{ + "constraint_vg_customer":{ + "type":"distance_to_location", + "demands":[ + "vG" + ], + "properties":{ + "distance":"< 100 km", + "location":"customer_loc" + } + }, + "hpa_constraint":{ + "type":"hpa", + "demands":[ + "vG" + ], + "properties":{ + "evaluate":[ + { + "flavorLabel":"flavor_label_1", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"4", + "operator":">=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"4", + "operator":">=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"numa", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numaNodes", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-0", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-1", + "hpa-attribute-value":"4", + "operator":"=" + }, + { + "hpa-attribute-key":"numaMem-0", + "hpa-attribute-value":"2", + "operator":"=", + "unit":"GB" + }, + { + "hpa-attribute-key":"numaMem-1", + "hpa-attribute-value":"4", + "operator":"=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"cpuPinning", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"logicalCpuThreadPinningPolicy", + "hpa-attribute-value":"prefer", + "operator":"=" + }, + { + "hpa-attribute-key":"logicalCpuPinningPolicy", + "hpa-attribute-value":"dedicated", + "operator":"=" + } + ] + } + ] + }, + { + "flavorLabel":"flavor_label_2", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"8", + "operator":">=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"16", + "operator":">=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"numa", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numaNodes", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-0", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-1", + "hpa-attribute-value":"4", + "operator":"=" + }, + { + "hpa-attribute-key":"numaMem-0", + "hpa-attribute-value":"2", + "operator":"=", + "unit":"GB" + }, + { + "hpa-attribute-key":"numaMem-1", + "hpa-attribute-value":"4", + "operator":"=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"ovsDpdk", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"dataProcessingAccelerationLibrary", + "hpa-attribute-value":"v18.02", + "operator":"=" + } + ] + } + ] + } + ] + } + } + }, + "optimization":{ + "minimize":{ + "sum":[ + { + "distance_between":[ + "customer_loc", + "vG" + ] + }, + { + "distance_between":[ + "customer_loc", + "vG" + ] + } + ] + } + } + }, + "timeout":5, + "limit":3 +} diff --git a/test/csit/tests/optf-has/has/data/plan_with_hpa_requirements_mandatory.json b/test/csit/tests/optf-has/has/data/plan_with_hpa_requirements_mandatory.json new file mode 100644 index 000000000..80685ae8e --- /dev/null +++ b/test/csit/tests/optf-has/has/data/plan_with_hpa_requirements_mandatory.json @@ -0,0 +1,165 @@ +{ + "name":"vCPE-with-HPA-requirement-mandatory", + "template":{ + "homing_template_version":"2017-10-10", + "parameters":{ + "service_name":"Residential vCPE", + "service_id":"vcpe_service_id", + "customer_lat":45.395968, + "customer_long":-71.135344, + "REQUIRED_MEM":4, + "REQUIRED_DISK":100, + "pnf_id":"some_pnf_id" + }, + "locations":{ + "customer_loc":{ + "latitude":{ + "get_param":"customer_lat" + }, + "longitude":{ + "get_param":"customer_long" + } + } + }, + "demands":{ + "vG":[ + { + "inventory_provider":"aai", + "inventory_type":"cloud" + } + ] + }, + "constraints":{ + "constraint_vg_customer":{ + "type":"distance_to_location", + "demands":[ + "vG" + ], + "properties":{ + "distance":"< 100 km", + "location":"customer_loc" + } + }, + "hpa_constraint":{ + "type":"hpa", + "demands":[ + "vG" + ], + "properties":{ + "evaluate":[ + { + "flavorLabel":"flavor_label_1", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"64", + "operator":"=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"64", + "operator":"=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"numa", + "hpa-version":"v1", + "architecture":"generic", + "mandatory":"True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numaNodes", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-0", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-1", + "hpa-attribute-value":"4", + "operator":"=" + }, + { + "hpa-attribute-key":"numaMem-0", + "hpa-attribute-value":"2", + "operator":"=", + "unit":"GB" + }, + { + "hpa-attribute-key":"numaMem-1", + "hpa-attribute-value":"4", + "operator":"=", + "unit":"GB" + } + ] + } + ] + }, + { + "flavorLabel":"flavor_label_2", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"32", + "operator":"=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"128", + "operator":"=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"ovsDpdk", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"dataProcessingAccelerationLibrary", + "hpa-attribute-value":"v18.02", + "operator":"=" + } + ] + } + ] + } + ] + } + } + }, + "optimization":{ + "minimize":{ + "sum":[ + { + "distance_between":[ + "customer_loc", + "vG" + ] + } + ] + } + } + }, + "timeout":5, + "limit":3 +} diff --git a/test/csit/tests/optf-has/has/data/plan_with_hpa_requirements_optionals.json b/test/csit/tests/optf-has/has/data/plan_with_hpa_requirements_optionals.json new file mode 100644 index 000000000..4672349d2 --- /dev/null +++ b/test/csit/tests/optf-has/has/data/plan_with_hpa_requirements_optionals.json @@ -0,0 +1,217 @@ +{ + "name":"vCPE-HPA-Requirement-Optional", + "template":{ + "homing_template_version":"2017-10-10", + "parameters":{ + "service_name":"Residential vCPE", + "service_id":"vcpe_service_id", + "customer_lat":45.395968, + "customer_long":-71.135344, + "REQUIRED_MEM":4, + "REQUIRED_DISK":100, + "pnf_id":"some_pnf_id" + }, + "locations":{ + "customer_loc":{ + "latitude":{ + "get_param":"customer_lat" + }, + "longitude":{ + "get_param":"customer_long" + } + } + }, + "demands":{ + "vG":[ + { + "inventory_provider":"aai", + "inventory_type":"cloud" + } + ] + }, + "constraints":{ + "constraint_vg_customer":{ + "type":"distance_to_location", + "demands":[ + "vG" + ], + "properties":{ + "distance":"< 100 km", + "location":"customer_loc" + } + }, + "hpa_constraint":{ + "type":"hpa", + "demands":[ + "vG" + ], + "properties":{ + "evaluate":[ + { + "flavorLabel":"flavor_label_1", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"4", + "operator":">=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"8", + "operator":">=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"instructionSetExtensions", + "hpa-version":"v1", + "architecture":"Intel64", + "mandatory": "True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"instructionSetExtensions", + "hpa-attribute-value":["aes", "sse", "avx", "smt"], + "operator":"ALL", + "unit":"" + } + ] + }, + { + "hpa-feature":"numa", + "hpa-version":"v1", + "architecture":"generic", + "mandatory":"False", + "score":"3", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numaNodes", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-0", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-1", + "hpa-attribute-value":"4", + "operator":"=" + }, + { + "hpa-attribute-key":"numaMem-0", + "hpa-attribute-value":"2", + "operator":"=", + "unit":"GB" + }, + { + "hpa-attribute-key":"numaMem-1", + "hpa-attribute-value":"4", + "operator":"=", + "unit":"GB" + } + ] + } + ] + }, + { + "flavorLabel":"flavor_label_2", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"4", + "operator":">=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"8", + "operator":">=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"ovsDpdk", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score":"5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"dataProcessingAccelerationLibrary", + "hpa-attribute-value":"v18.02", + "operator":"=" + } + ] + }, + { + "hpa-feature":"numa", + "hpa-version":"v1", + "architecture":"generic", + "mandatory":"False", + "score":"3", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numaNodes", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-0", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-1", + "hpa-attribute-value":"4", + "operator":"=" + }, + { + "hpa-attribute-key":"numaMem-0", + "hpa-attribute-value":"2", + "operator":"=", + "unit":"GB" + }, + { + "hpa-attribute-key":"numaMem-1", + "hpa-attribute-value":"4", + "operator":"=", + "unit":"GB" + } + ] + } + ] + } + ] + } + } + }, + "optimization":{ + "minimize":{ + "sum":[ + { + "distance_between":[ + "customer_loc", + "vG" + ] + } + ] + } + } + }, + "timeout":5, + "limit":3 +} diff --git a/test/csit/tests/optf-has/has/data/plan_with_hpa_simple.json b/test/csit/tests/optf-has/has/data/plan_with_hpa_simple.json new file mode 100644 index 000000000..25b226280 --- /dev/null +++ b/test/csit/tests/optf-has/has/data/plan_with_hpa_simple.json @@ -0,0 +1,129 @@ +{ + "name":"vCPE-with-HPA", + "template":{ + "homing_template_version":"2017-10-10", + "parameters":{ + "service_name":"Residential vCPE", + "service_id":"vcpe_service_id", + "customer_lat":45.395968, + "customer_long":-71.135344, + "REQUIRED_MEM":4, + "REQUIRED_DISK":100, + "pnf_id":"some_pnf_id" + }, + "locations":{ + "customer_loc":{ + "latitude":{ + "get_param":"customer_lat" + }, + "longitude":{ + "get_param":"customer_long" + } + } + }, + "demands":{ + "vG":[ + { + "inventory_provider":"aai", + "inventory_type":"cloud" + } + ] + }, + "constraints":{ + "hpa_constraint":{ + "type":"hpa", + "demands":[ + "vG" + ], + "properties":{ + "evaluate":[ + { + "flavorLabel":"flavor_label_1", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"32", + "operator":"=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"64", + "operator":"=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"ovsDpdk", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"dataProcessingAccelerationLibrary", + "hpa-attribute-value":"v18.02", + "operator":"=" + } + ] + } + ] + }, + { + "flavorLabel":"flavor_label_2", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"8", + "operator":">=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"16", + "operator":">=", + "unit":"GB" + } + ] + } + ] + } + ] + } + } + }, + "optimization":{ + "minimize":{ + "sum":[ + { + "distance_between":[ + "customer_loc", + "vG" + ] + }, + { + "distance_between":[ + "customer_loc", + "vG" + ] + } + ] + } + } + }, + "timeout":5, + "limit":3 +} diff --git a/test/csit/tests/optf-has/has/data/plan_with_hpa_unmatched.json b/test/csit/tests/optf-has/has/data/plan_with_hpa_unmatched.json new file mode 100644 index 000000000..8a3198566 --- /dev/null +++ b/test/csit/tests/optf-has/has/data/plan_with_hpa_unmatched.json @@ -0,0 +1,117 @@ +{ + "name":"vCPE-with-HPA-unmatched-requirements", + "template":{ + "homing_template_version":"2017-10-10", + "parameters":{ + "service_name":"Residential vCPE", + "service_id":"vcpe_service_id", + "customer_lat":45.395968, + "customer_long":-71.135344, + "REQUIRED_MEM":4, + "REQUIRED_DISK":100, + "pnf_id":"some_pnf_id" + }, + "locations":{ + "customer_loc":{ + "latitude":{ + "get_param":"customer_lat" + }, + "longitude":{ + "get_param":"customer_long" + } + } + }, + "demands":{ + "vG":[ + { + "inventory_provider":"aai", + "inventory_type":"cloud" + } + ] + }, + "constraints":{ + "constraint_vgmux_customer":{ + "type":"distance_to_location", + "demands":[ + "vG" + ], + "properties":{ + "distance":"< 100 km", + "location":"customer_loc" + } + }, + "hpa_constraint":{ + "type":"hpa", + "demands":[ + "vG" + ], + "properties":{ + "evaluate":[ + { + "flavorLabel":"flavor_label_1", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"60", + "operator":"=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"64", + "operator":"=", + "unit":"GB" + } + ] + } + ] + }, + { + "flavorLabel":"flavor_label_2", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory":"True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"30", + "operator":"=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"128", + "operator":"=", + "unit":"GB" + } + ] + } + ] + } + ] + } + } + }, + "optimization":{ + "minimize":{ + "sum":[ + { + "distance_between":[ + "customer_loc", + "vG" + ] + } + ] + } + } + }, + "timeout":5, + "limit":3 +} diff --git a/test/csit/tests/optf-has/has/data/plan_with_vim_fit.json b/test/csit/tests/optf-has/has/data/plan_with_vim_fit.json new file mode 100644 index 000000000..00a599125 --- /dev/null +++ b/test/csit/tests/optf-has/has/data/plan_with_vim_fit.json @@ -0,0 +1,89 @@ +{ + "name":"vCPE-Sanity1", + "template":{ + "homing_template_version":"2017-10-10", + "parameters":{ + "service_name":"Residential vCPE", + "service_id":"vcpe_service_id", + "customer_lat":45.395968, + "customer_long":-71.135344, + "REQUIRED_MEM":4, + "REQUIRED_DISK":100, + "pnf_id":"some_pnf_id" + }, + "locations":{ + "customer_loc":{ + "latitude":{ + "get_param":"customer_lat" + }, + "longitude":{ + "get_param":"customer_long" + } + } + }, + "demands":{ + "vG":[ + { + "inventory_provider":"aai", + "inventory_type":"cloud" + } + ] + }, + "constraints":{ + "constraint_vg_customer":{ + "type":"distance_to_location", + "demands":[ + "vG" + ], + "properties":{ + "distance":"< 100 km", + "location":"customer_loc" + } + }, + "check_cloud_capacity":{ + "type":"vim_fit", + "demands":[ + "vG" + ], + "properties":{ + "controller":"multicloud", + "request":{ + "vCPU":10, + "Memory":{ + "quantity":{ + "get_param":"REQUIRED_MEM" + }, + "unit":"GB" + }, + "Storage":{ + "quantity":{ + "get_param":"REQUIRED_DISK" + }, + "unit":"GB" + } + } + } + } + }, + "optimization":{ + "minimize":{ + "sum":[ + { + "distance_between":[ + "customer_loc", + "vG" + ] + }, + { + "distance_between":[ + "customer_loc", + "vG" + ] + } + ] + } + } + }, + "timeout":5, + "limit":3 +} diff --git a/test/csit/tests/optf-has/has/optf_has_test.robot b/test/csit/tests/optf-has/has/optf_has_test.robot index 62db10774..815ffa850 100644 --- a/test/csit/tests/optf-has/has/optf_has_test.robot +++ b/test/csit/tests/optf-has/has/optf_has_test.robot @@ -295,6 +295,191 @@ GetPlanWithShortDistanceConstraint Should Be Equal As Integers ${resp.status_code} 200 Should Be Equal not found ${resultStatus} +SendPlanWithVimFit + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_vim_fit.json + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + Log To Console body = ${resp.text} + ${response_json} json.loads ${resp.content} + ${generatedPlanId}= Convert To String ${response_json['id']} + Set Global Variable ${generatedPlanId} + Log To Console generatedPlanId = ${generatedPlanId} + Should Be Equal As Integers ${resp.status_code} 201 + Sleep 60s Wait Plan Resolution + +GetPlanWithVimFit + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + ${response_json} json.loads ${resp.content} + ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} + Set Global Variable ${resultStatus} + Log To Console resultStatus = ${resultStatus} + Log To Console body = ${resp.text} + Should Be Equal As Integers ${resp.status_code} 200 + Should Be Equal done ${resultStatus} + +SendPlanWithHpa + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_hpa.json + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + Log To Console body = ${resp.text} + ${response_json} json.loads ${resp.content} + ${generatedPlanId}= Convert To String ${response_json['id']} + Set Global Variable ${generatedPlanId} + Log To Console generatedPlanId = ${generatedPlanId} + Should Be Equal As Integers ${resp.status_code} 201 + Sleep 60s Wait Plan Resolution + +GetPlanWithHpa + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + ${response_json} json.loads ${resp.content} + ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} + Set Global Variable ${resultStatus} + Log To Console resultStatus = ${resultStatus} + Log To Console body = ${resp.text} + Should Be Equal As Integers ${resp.status_code} 200 + Should Be Equal done ${resultStatus} + +SendPlanWithHpaSimple + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_hpa_simple.json + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + Log To Console body = ${resp.text} + ${response_json} json.loads ${resp.content} + ${generatedPlanId}= Convert To String ${response_json['id']} + Set Global Variable ${generatedPlanId} + Log To Console generatedPlanId = ${generatedPlanId} + Should Be Equal As Integers ${resp.status_code} 201 + Sleep 60s Wait Plan Resolution + +GetPlanWithHpaSimple + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + ${response_json} json.loads ${resp.content} + ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} + Set Global Variable ${resultStatus} + Log To Console resultStatus = ${resultStatus} + Log To Console body = ${resp.text} + Should Be Equal As Integers ${resp.status_code} 200 + Should Be Equal done ${resultStatus} + +SendPlanWithHpaMandatory + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_hpa_requirements_mandatory.json + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + Log To Console body = ${resp.text} + ${response_json} json.loads ${resp.content} + ${generatedPlanId}= Convert To String ${response_json['id']} + Set Global Variable ${generatedPlanId} + Log To Console generatedPlanId = ${generatedPlanId} + Should Be Equal As Integers ${resp.status_code} 201 + Sleep 60s Wait Plan Resolution + +GetPlanWithHpaMandatory + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + ${response_json} json.loads ${resp.content} + ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} + Set Global Variable ${resultStatus} + Log To Console resultStatus = ${resultStatus} + Log To Console body = ${resp.text} + Should Be Equal As Integers ${resp.status_code} 200 + Should Be Equal done ${resultStatus} + +SendPlanWithHpaOptionals + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_hpa_requirements_optionals.json + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + Log To Console body = ${resp.text} + ${response_json} json.loads ${resp.content} + ${generatedPlanId}= Convert To String ${response_json['id']} + Set Global Variable ${generatedPlanId} + Log To Console generatedPlanId = ${generatedPlanId} + Should Be Equal As Integers ${resp.status_code} 201 + Sleep 60s Wait Plan Resolution + +GetPlanWithHpaOptionals + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + ${response_json} json.loads ${resp.content} + ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} + Set Global Variable ${resultStatus} + Log To Console resultStatus = ${resultStatus} + Log To Console body = ${resp.text} + Should Be Equal As Integers ${resp.status_code} 200 + Should Be Equal done ${resultStatus} + +SendPlanWithHpaUnmatched + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_hpa_unmatched.json + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + Log To Console body = ${resp.text} + ${response_json} json.loads ${resp.content} + ${generatedPlanId}= Convert To String ${response_json['id']} + Set Global Variable ${generatedPlanId} + Log To Console generatedPlanId = ${generatedPlanId} + Should Be Equal As Integers ${resp.status_code} 201 + Sleep 60s Wait Plan Resolution + +GetPlanWithHpaUnmatched + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + ${response_json} json.loads ${resp.content} + ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} + Set Global Variable ${resultStatus} + Log To Console resultStatus = ${resultStatus} + Log To Console body = ${resp.text} + Should Be Equal As Integers ${resp.status_code} 200 + Should Be Equal not found ${resultStatus} *** Keywords *** |