From d452192f36bb2df0bf70b78b482aa8f5814885e3 Mon Sep 17 00:00:00 2001 From: Leonardo Bellini Date: Thu, 1 Mar 2018 08:48:10 -0600 Subject: Add CSIT files for optf/has for integration Issue-ID: OPTFRA-158 Change-Id: Idc7827cf82e21bdddea4293c94516bdc0bfa2b6e Signed-off-by: Leonardo Bellini --- test/csit/plans/optf/has/sample.txt | 1 - test/csit/plans/optf/has/setup.sh | 60 +++++++ test/csit/plans/optf/has/teardown.sh | 28 ++++ test/csit/plans/optf/has/testplan.txt | 3 + test/csit/scripts/optf/has/has_script.sh | 25 +++ test/csit/scripts/optf/has/testsample.txt | 1 - test/csit/scripts/optf/osdf/testsample.txt | 1 + test/csit/tests/optf/has/__init__.robot | 4 + .../optf/has/data/plan_with_wrong_version.json | 175 +++++++++++++++++++++ .../optf/has/data/plan_without_demand_section.json | 93 +++++++++++ test/csit/tests/optf/has/data/sampletest.txt | 1 - test/csit/tests/optf/has/optf_has_test.robot | 29 ++++ 12 files changed, 418 insertions(+), 3 deletions(-) delete mode 100644 test/csit/plans/optf/has/sample.txt create mode 100755 test/csit/plans/optf/has/setup.sh create mode 100755 test/csit/plans/optf/has/teardown.sh create mode 100644 test/csit/plans/optf/has/testplan.txt create mode 100755 test/csit/scripts/optf/has/has_script.sh delete mode 100644 test/csit/scripts/optf/has/testsample.txt create mode 100644 test/csit/scripts/optf/osdf/testsample.txt create mode 100644 test/csit/tests/optf/has/__init__.robot create mode 100644 test/csit/tests/optf/has/data/plan_with_wrong_version.json create mode 100644 test/csit/tests/optf/has/data/plan_without_demand_section.json delete mode 100644 test/csit/tests/optf/has/data/sampletest.txt create mode 100644 test/csit/tests/optf/has/optf_has_test.robot (limited to 'test/csit') diff --git a/test/csit/plans/optf/has/sample.txt b/test/csit/plans/optf/has/sample.txt deleted file mode 100644 index 9f4e8d7d6..000000000 --- a/test/csit/plans/optf/has/sample.txt +++ /dev/null @@ -1 +0,0 @@ -#test diff --git a/test/csit/plans/optf/has/setup.sh b/test/csit/plans/optf/has/setup.sh new file mode 100755 index 000000000..b2c81433c --- /dev/null +++ b/test/csit/plans/optf/has/setup.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# +# add here eventual scripts needed for optf/has +# +echo "##########################################################"; +echo "#"; +echo "# optf/has scripts calling"; +echo "#"; +echo "##########################################################"; +source ${WORKSPACE}/test/csit/scripts/optf/has/has_script.sh + +# +# add here below the start of all docker containers needed for optf/has CSIT testing +# +echo "##########################################################"; +echo "#"; +echo "# optf/has scripts docker containers spinoff"; +echo "#"; +echo "##########################################################"; + +# +# add here all the configuration steps eventually needed to be carried out for optf/has CSIT testing +# +echo "##########################################################"; +echo "#"; +echo "# optf/has configuration step"; +echo "#"; +echo "##########################################################"; + + +# +# add here all ROBOT_VARIABLES settings +# +echo "##########################################################"; +echo "#"; +echo "# optf/has robot variables settings"; +echo "#"; +echo "##########################################################"; +ROBOT_VARIABLES="-v MUSIC_HOSTNAME:http://localhost -v MUSIC_PORT:8080 -v COND_HOSTNAME:http://localhost -v COND_PORT:8091" + +echo ${ROBOT_VARIABLES} + + + diff --git a/test/csit/plans/optf/has/teardown.sh b/test/csit/plans/optf/has/teardown.sh new file mode 100755 index 000000000..b7e6cf075 --- /dev/null +++ b/test/csit/plans/optf/has/teardown.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + +# +# add here below the killing of all docker containers used for optf/has CSIT testing +# +echo "##########################################################"; +echo "#"; +echo "# optf/has scripts docker containers killing"; +echo "#"; +echo "##########################################################"; +# kill-instance.sh + diff --git a/test/csit/plans/optf/has/testplan.txt b/test/csit/plans/optf/has/testplan.txt new file mode 100644 index 000000000..0f9f84dfe --- /dev/null +++ b/test/csit/plans/optf/has/testplan.txt @@ -0,0 +1,3 @@ +# Test suites are relative paths under [integration.git]/test/csit/tests/. +# Place the suites in run order. +optf/has diff --git a/test/csit/scripts/optf/has/has_script.sh b/test/csit/scripts/optf/has/has_script.sh new file mode 100755 index 000000000..6f1ddd6e3 --- /dev/null +++ b/test/csit/scripts/optf/has/has_script.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +echo "######################################################################" +echo "### " +echo "### This is ${WORKSPACE}/test/csit/scripts/optf/has/has_script.sh" +echo "### " +echo "######################################################################" +# +# add here whatever commands is needed to prepare the optf/has CSIT testing +# + diff --git a/test/csit/scripts/optf/has/testsample.txt b/test/csit/scripts/optf/has/testsample.txt deleted file mode 100644 index 9f4e8d7d6..000000000 --- a/test/csit/scripts/optf/has/testsample.txt +++ /dev/null @@ -1 +0,0 @@ -#test diff --git a/test/csit/scripts/optf/osdf/testsample.txt b/test/csit/scripts/optf/osdf/testsample.txt new file mode 100644 index 000000000..9f4e8d7d6 --- /dev/null +++ b/test/csit/scripts/optf/osdf/testsample.txt @@ -0,0 +1 @@ +#test diff --git a/test/csit/tests/optf/has/__init__.robot b/test/csit/tests/optf/has/__init__.robot new file mode 100644 index 000000000..fb654d7bb --- /dev/null +++ b/test/csit/tests/optf/has/__init__.robot @@ -0,0 +1,4 @@ +*** Settings *** +Documentation Integration - Suite 1 + + diff --git a/test/csit/tests/optf/has/data/plan_with_wrong_version.json b/test/csit/tests/optf/has/data/plan_with_wrong_version.json new file mode 100644 index 000000000..9471fbf82 --- /dev/null +++ b/test/csit/tests/optf/has/data/plan_with_wrong_version.json @@ -0,0 +1,175 @@ +{ + "name": "onap optf has plan with wrong version", + "template": { + "conductor_template_version": "yyyy-mm-dd", + "parameters": { + "UCPEHOST": "chcil129snd", + "CUSTOMER":"21014aa2-526b-11e6-beb8-9e71128cae77" + }, + "locations": { + "customer_loc": { + "host_name": { + "get_param": "UCPEHOST" + } + } + }, + "demands": { + "vHNPortalaaS_PRIMARY_1": [ + { + "inventory_provider": "aai", + "inventory_type": "service", + "service_type": "HNPORTAL", + "customer_id": {"get_param": "CUSTOMER"} + }, + { + "inventory_provider": "aai", + "inventory_type": "cloud" + } + ], + "vHNPortalaaS_SECONDARY_1": [ + { + "inventory_provider": "aai", + "inventory_type": "service", + "service_type": "HNPORTAL", + "customer_id": {"get_param": "CUSTOMER"} + }, + { + "inventory_provider": "aai", + "inventory_type": "cloud" + } + ], + "vHNGWaaS_PRIMARY_1": [ + { + "inventory_provider": "aai", + "inventory_type": "service", + "service_type": "HNGATEWAY", + "customer_id": {"get_param": "CUSTOMER"} + }, + { + "inventory_provider": "aai", + "inventory_type": "cloud" + } + ], + "vHNGWaaS_SECONDARY_1": [ + { + "inventory_provider": "aai", + "inventory_type": "service", + "service_type": "HNGATEWAY", + "customer_id": {"get_param": "CUSTOMER"} + }, + { + "inventory_provider": "aai", + "inventory_type": "cloud" + } + ], + "vVIGaaS_PRIMARY_1": [ + { + "inventory_provider": "aai", + "inventory_type": "service", + "service_type": "VVIG", + "customer_id": {"get_param": "CUSTOMER"} + } + ], + "vVIGaaS_SECONDARY_1": [ + { + "inventory_provider": "aai", + "inventory_type": "service", + "service_type": "VVIG", + "customer_id": {"get_param": "CUSTOMER"} + } + ], + "vVIGaaS_PRIMARY_2": [ + { + "inventory_provider": "aai", + "inventory_type": "service", + "service_type": "VVIG", + "customer_id": {"get_param": "CUSTOMER"} + } + ], + "vVIGaaS_SECONDARY_2": [ + { + "inventory_provider": "aai", + "inventory_type": "service", + "service_type": "VVIG", + "customer_id": {"get_param": "CUSTOMER"} + } + ] + }, + "constraints": { + "distance-vvig": { + "type": "distance_to_location", + "demands": [ + "vVIGaaS_SECONDARY_1", + "vVIGaaS_PRIMARY_1" + ], + "properties": { + "distance": "< 5000 km", + "location": "customer_loc" + } + }, + "distance-vgw": { + "type": "distance_to_location", + "demands": [ + "vHNGWaaS_SECONDARY_1", + "vHNGWaaS_PRIMARY_1" + ], + "properties": { + "distance": "< 5000 km", + "location": "customer_loc" + } + }, + "zone-vhngw": { + "type": "zone", + "demands": [ + "vHNGWaaS_SECONDARY_1", + "vHNGWaaS_PRIMARY_1" + ], + "properties": { + "qualifier": "different", + "category": "complex" + } + }, + "zone-vhnportal": { + "type": "zone", + "demands": [ + "vHNPortalaaS_SECONDARY_1", + "vHNPortalaaS_PRIMARY_1" + ], + "properties": { + "qualifier": "different", + "category": "complex" + } + } + }, + "optimization": { + "minimize": { + "sum": [ + { + "product": [ + 1, + { + "distance_between": [ + "customer_loc", + "vVIGaaS_PRIMARY_1" + ] + } + ] + }, + { + "product": [ + 1, + { + "distance_between": [ + "customer_loc", + "vHNGWaaS_PRIMARY_1" + ] + } + ] + } + ] + } + } +}, + "timeout": 5, + "limit": 3 +} diff --git a/test/csit/tests/optf/has/data/plan_without_demand_section.json b/test/csit/tests/optf/has/data/plan_without_demand_section.json new file mode 100644 index 000000000..87a459d87 --- /dev/null +++ b/test/csit/tests/optf/has/data/plan_without_demand_section.json @@ -0,0 +1,93 @@ +{ + "name": "onap optf has plan with wrong version", + "template": { + "conductor_template_version": "2016-11-01", + "parameters": { + "UCPEHOST": "chcil129snd", + "CUSTOMER":"21014aa2-526b-11e6-beb8-9e71128cae77" + }, + "locations": { + "customer_loc": { + "host_name": { + "get_param": "UCPEHOST" + } + } + }, + "constraints": { + "distance-vvig": { + "type": "distance_to_location", + "demands": [ + "vVIGaaS_SECONDARY_1", + "vVIGaaS_PRIMARY_1" + ], + "properties": { + "distance": "< 5000 km", + "location": "customer_loc" + } + }, + "distance-vgw": { + "type": "distance_to_location", + "demands": [ + "vHNGWaaS_SECONDARY_1", + "vHNGWaaS_PRIMARY_1" + ], + "properties": { + "distance": "< 5000 km", + "location": "customer_loc" + } + }, + "zone-vhngw": { + "type": "zone", + "demands": [ + "vHNGWaaS_SECONDARY_1", + "vHNGWaaS_PRIMARY_1" + ], + "properties": { + "qualifier": "different", + "category": "complex" + } + }, + "zone-vhnportal": { + "type": "zone", + "demands": [ + "vHNPortalaaS_SECONDARY_1", + "vHNPortalaaS_PRIMARY_1" + ], + "properties": { + "qualifier": "different", + "category": "complex" + } + } + }, + "optimization": { + "minimize": { + "sum": [ + { + "product": [ + 1, + { + "distance_between": [ + "customer_loc", + "vVIGaaS_PRIMARY_1" + ] + } + ] + }, + { + "product": [ + 1, + { + "distance_between": [ + "customer_loc", + "vHNGWaaS_PRIMARY_1" + ] + } + ] + } + ] + } + } +}, + "timeout": 5, + "limit": 3 +} diff --git a/test/csit/tests/optf/has/data/sampletest.txt b/test/csit/tests/optf/has/data/sampletest.txt deleted file mode 100644 index 9f4e8d7d6..000000000 --- a/test/csit/tests/optf/has/data/sampletest.txt +++ /dev/null @@ -1 +0,0 @@ -#test diff --git a/test/csit/tests/optf/has/optf_has_test.robot b/test/csit/tests/optf/has/optf_has_test.robot new file mode 100644 index 000000000..183cb6859 --- /dev/null +++ b/test/csit/tests/optf/has/optf_has_test.robot @@ -0,0 +1,29 @@ +*** Settings *** +Library OperatingSystem +Library RequestsLibrary +Library json + +*** Variables *** +${MESSAGE} {"ping": "ok"} +${RESP_STATUS} "error" +${RESP_MESSAGE_WRONG_VERSION} "conductor_template_version must be one of: 2016-11-01" +${RESP_MESSAGE_WITHOUT_DEMANDS} Undefined Demand + +#global variables +${generatedPlanId} + +*** Test Cases *** +Get Root Url + [Documentation] It sends a REST GET request to root url + 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/ headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + Log To Console body = ${resp.text} + Should Be Equal As Integers ${resp.status_code} 200 + + +*** Keywords *** + + -- cgit 1.2.3-korg