From 11e362c453d8188076b7bc4511267f2ba4128e56 Mon Sep 17 00:00:00 2001 From: krishnaa96 Date: Tue, 16 Mar 2021 11:27:38 +0530 Subject: Add CSIT to the project repo Issue-ID: OPTFRA-930 Signed-off-by: krishnaa96 Change-Id: I93d047739a9d24c90c33a179692329045f94b10b --- csit/.gitignore | 2 + csit/plans/default/setup.sh | 59 ++ csit/plans/default/teardown.sh | 55 ++ csit/plans/default/testplan.txt | 3 + csit/prepare-csit.sh | 47 ++ csit/run-csit.sh | 197 ++++++ csit/run-project-csit.sh | 35 + csit/scripts/common_functions.sh | 263 ++++++++ csit/scripts/get-instance-ip.sh | 17 + csit/scripts/has-properties/AAF_RootCA.cer | 31 + csit/scripts/has-properties/conductor.conf.onap | 635 ++++++++++++++++++ csit/scripts/has-properties/has.json | 51 ++ csit/scripts/has-properties/log.conf.onap | 65 ++ csit/scripts/has_proxy_settings.sh | 31 + csit/scripts/has_script.sh | 118 ++++ csit/scripts/has_teardown_script.sh | 34 + csit/scripts/music-properties/log4j.properties | 3 + csit/scripts/music-properties/music.properties | 17 + csit/scripts/music/cql/admin.cql | 34 + csit/scripts/music/cql/admin_pw.cql | 2 + csit/scripts/music/cql/extra/test.cql | 1 + csit/scripts/music_script.sh | 173 +++++ csit/scripts/music_teardown_script.sh | 61 ++ csit/scripts/setup-sms.sh | 71 ++ csit/scripts/simulator_script.sh | 103 +++ csit/scripts/simulator_teardown_script.sh | 26 + csit/scripts/wait_for_port.sh | 18 + csit/tests/has/__init__.robot | 4 + csit/tests/has/data/healthcheck.json | 19 + .../data/nsi_selection_template_with_create.json | 151 +++++ .../data/nsi_selection_template_with_nonsi.json | 151 +++++ .../data/nsi_selection_template_with_reuse.json | 152 +++++ csit/tests/has/data/nssi_selection_template.json | 75 +++ .../data/nssi_selection_template_unmatched.json | 76 +++ csit/tests/has/data/nst_selection_template.json | 55 ++ csit/tests/has/data/onboard.json | 6 + csit/tests/has/data/plan_with_hpa.json | 260 ++++++++ .../data/plan_with_hpa_requirements_mandatory.json | 193 ++++++ .../data/plan_with_hpa_requirements_optionals.json | 247 +++++++ .../data/plan_with_hpa_score_multi_objective.json | 267 ++++++++ csit/tests/has/data/plan_with_hpa_simple.json | 156 +++++ csit/tests/has/data/plan_with_hpa_unmatched.json | 143 ++++ csit/tests/has/data/plan_with_lati_and_longi.json | 41 ++ .../data/plan_with_short_distance_constraint.json | 64 ++ csit/tests/has/data/plan_with_vim_fit.json | 89 +++ .../data/plan_with_wrong_distance_constraint.json | 63 ++ csit/tests/has/data/plan_with_wrong_version.json | 41 ++ .../has/data/plan_without_demand_section.json | 33 + csit/tests/has/optf_has_test.robot | 726 +++++++++++++++++++++ 49 files changed, 5164 insertions(+) create mode 100644 csit/.gitignore create mode 100755 csit/plans/default/setup.sh create mode 100755 csit/plans/default/teardown.sh create mode 100644 csit/plans/default/testplan.txt create mode 100755 csit/prepare-csit.sh create mode 100755 csit/run-csit.sh create mode 100755 csit/run-project-csit.sh create mode 100755 csit/scripts/common_functions.sh create mode 100755 csit/scripts/get-instance-ip.sh create mode 100644 csit/scripts/has-properties/AAF_RootCA.cer create mode 100644 csit/scripts/has-properties/conductor.conf.onap create mode 100644 csit/scripts/has-properties/has.json create mode 100644 csit/scripts/has-properties/log.conf.onap create mode 100755 csit/scripts/has_proxy_settings.sh create mode 100755 csit/scripts/has_script.sh create mode 100755 csit/scripts/has_teardown_script.sh create mode 100644 csit/scripts/music-properties/log4j.properties create mode 100644 csit/scripts/music-properties/music.properties create mode 100644 csit/scripts/music/cql/admin.cql create mode 100644 csit/scripts/music/cql/admin_pw.cql create mode 100644 csit/scripts/music/cql/extra/test.cql create mode 100755 csit/scripts/music_script.sh create mode 100755 csit/scripts/music_teardown_script.sh create mode 100755 csit/scripts/setup-sms.sh create mode 100755 csit/scripts/simulator_script.sh create mode 100755 csit/scripts/simulator_teardown_script.sh create mode 100755 csit/scripts/wait_for_port.sh create mode 100644 csit/tests/has/__init__.robot create mode 100644 csit/tests/has/data/healthcheck.json create mode 100644 csit/tests/has/data/nsi_selection_template_with_create.json create mode 100644 csit/tests/has/data/nsi_selection_template_with_nonsi.json create mode 100644 csit/tests/has/data/nsi_selection_template_with_reuse.json create mode 100644 csit/tests/has/data/nssi_selection_template.json create mode 100644 csit/tests/has/data/nssi_selection_template_unmatched.json create mode 100644 csit/tests/has/data/nst_selection_template.json create mode 100644 csit/tests/has/data/onboard.json create mode 100644 csit/tests/has/data/plan_with_hpa.json create mode 100644 csit/tests/has/data/plan_with_hpa_requirements_mandatory.json create mode 100644 csit/tests/has/data/plan_with_hpa_requirements_optionals.json create mode 100644 csit/tests/has/data/plan_with_hpa_score_multi_objective.json create mode 100644 csit/tests/has/data/plan_with_hpa_simple.json create mode 100644 csit/tests/has/data/plan_with_hpa_unmatched.json create mode 100644 csit/tests/has/data/plan_with_lati_and_longi.json create mode 100644 csit/tests/has/data/plan_with_short_distance_constraint.json create mode 100644 csit/tests/has/data/plan_with_vim_fit.json create mode 100644 csit/tests/has/data/plan_with_wrong_distance_constraint.json create mode 100644 csit/tests/has/data/plan_with_wrong_version.json create mode 100644 csit/tests/has/data/plan_without_demand_section.json create mode 100644 csit/tests/has/optf_has_test.robot diff --git a/csit/.gitignore b/csit/.gitignore new file mode 100644 index 0000000..c8865c2 --- /dev/null +++ b/csit/.gitignore @@ -0,0 +1,2 @@ +env.properties +archives/ diff --git a/csit/plans/default/setup.sh b/csit/plans/default/setup.sh new file mode 100755 index 0000000..b6ddc76 --- /dev/null +++ b/csit/plans/default/setup.sh @@ -0,0 +1,59 @@ +#!/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 "# aaf-sms setup.sh script"; +source ${WORKSPACE}/scripts/setup-sms.sh + +# +# add here eventual scripts needed for music +# +echo "# music scripts calling"; +source ${WORKSPACE}/scripts/music_script.sh + + +# +echo "# simulator scripts calling"; +source ${WORKSPACE}/scripts/simulator_script.sh + +# add here eventual scripts needed for optf/has +# +echo "# optf/has scripts calling"; +source ${WORKSPACE}/scripts/has_script.sh + +# +# add here below the start of all docker containers needed for optf/has CSIT testing +# +echo "# optf/has scripts docker containers spinoff"; + +# +# add here all the configuration steps eventually needed to be carried out for optf/has CSIT testing +# +echo "# optf/has configuration step"; + + +# +# add here all ROBOT_VARIABLES settings +# +echo "# optf/has robot variables settings"; +echo "conductor ip = ${COND_IP}" +echo "music ip = ${TOMCAT_IP}" + +ROBOT_VARIABLES="-v MUSIC_HOSTNAME:http://${TOMCAT_IP} -v MUSIC_PORT:8080 -v COND_HOSTNAME:http://${COND_IP} -v COND_PORT:8091" + +echo ${ROBOT_VARIABLES} + + + diff --git a/csit/plans/default/teardown.sh b/csit/plans/default/teardown.sh new file mode 100755 index 0000000..6fcd753 --- /dev/null +++ b/csit/plans/default/teardown.sh @@ -0,0 +1,55 @@ +#!/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 +# +# Move logs to has + +mkdir ${WORKSPACE}/archives/logs +docker logs cond-cont > ${WORKSPACE}/archives/logs/cond-cont.log +docker logs cond-api > ${WORKSPACE}/archives/logs/cond-api.log +docker logs cond-data > ${WORKSPACE}/archives/logs/cond-data.log +docker logs cond-solv > ${WORKSPACE}/archives/logs/cond-solv.log +docker logs cond-resv > ${WORKSPACE}/archives/logs/cond-resv.log + + +# +# optf/has scripts docker containers killing"; +# +echo "# optf/has has scripts calling"; +source ${WORKSPACE}/scripts/has_teardown_script.sh + +echo "# optf/has simulator scripts calling"; +source ${WORKSPACE}/scripts/simulator_teardown_script.sh + +echo "# optf/has music scripts calling"; +source ${WORKSPACE}/scripts/music_teardown_script.sh + +echo "# aaf-sms teardown.sh script"; +#kill-instance.sh sms +#kill-instance.sh vault +docker stop sms +docker stop vault + +docker rm sms +docker rm vault + +docker volume prune -f + +rm -rf ${WORKSPACE}/plans/default/config diff --git a/csit/plans/default/testplan.txt b/csit/plans/default/testplan.txt new file mode 100644 index 0000000..1530280 --- /dev/null +++ b/csit/plans/default/testplan.txt @@ -0,0 +1,3 @@ +# Test suites are relative paths under [integration/csit.git]/tests/. +# Place the suites in run order. +has diff --git a/csit/prepare-csit.sh b/csit/prepare-csit.sh new file mode 100755 index 0000000..d46b17a --- /dev/null +++ b/csit/prepare-csit.sh @@ -0,0 +1,47 @@ +#!/bin/bash -x +# +# Copyright 2019-2021 © Samsung Electronics Co., Ltd. +# Modifications Copyright (C) 2021 Pantheon.tech +# +# 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. +# +# This script installs common libraries required by CSIT tests +# +# Branched from ccsdk/distribution to this repository Feb 23, 2021 +# + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=`git rev-parse --show-toplevel` +fi + +TESTPLANDIR=${WORKSPACE}/${TESTPLAN} + +# Assume that if ROBOT_VENV is set and virtualenv with system site packages can be activated, +# ci-management/jjb/integration/include-raw-integration-install-robotframework.sh has already +# been executed + +if [ -f ${WORKSPACE}/env.properties ]; then + source ${WORKSPACE}/env.properties +fi +if [ -f ${ROBOT_VENV}/bin/activate ]; then + source ${ROBOT_VENV}/bin/activate +else + rm -rf /tmp/ci-management + rm -f ${WORKSPACE}/env.properties + cd /tmp + git clone "https://gerrit.onap.org/r/ci-management" + source /tmp/ci-management/jjb/integration/include-raw-integration-install-robotframework.sh +fi + +pip freeze + diff --git a/csit/run-csit.sh b/csit/run-csit.sh new file mode 100755 index 0000000..9220ef9 --- /dev/null +++ b/csit/run-csit.sh @@ -0,0 +1,197 @@ +#!/bin/bash -x +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# Modification Copyright 2019-2021 © Samsung Electronics 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. +# +# $1 project/functionality +# $2 robot options + +# Branched from ccsdk/distribution to this repository Feb 23, 2021 + +# +# functions +# + +function on_exit(){ + rc=$? + if [[ ${WORKSPACE} ]]; then + if [[ ${WORKDIR} ]]; then + rsync -av "$WORKDIR/" "$WORKSPACE/archives/$TESTPLAN" + fi + # Record list of active docker containers + docker ps --format "{{.Image}}" > "$WORKSPACE/archives/$TESTPLAN/_docker-images.log" + + # show memory consumption after all docker instances initialized + docker_stats | tee "$WORKSPACE/archives/$TESTPLAN/_sysinfo-2-after-robot.txt" + fi + # Run teardown script plan if it exists + cd "${TESTPLANDIR}" + TEARDOWN="${TESTPLANDIR}/teardown.sh" + if [ -f "${TEARDOWN}" ]; then + echo "Running teardown script ${TEARDOWN}" + source_safely "${TEARDOWN}" + fi + # TODO: do something with the output + exit $rc +} +# ensure that teardown and other finalizing steps are always executed +trap on_exit EXIT + +function docker_stats(){ + #General memory details + echo "> top -bn1 | head -3" + top -bn1 | head -3 + echo + + echo "> free -h" + free -h + echo + + #Memory details per Docker + echo "> docker ps" + docker ps + echo + + echo "> docker stats --no-stream" + docker stats --no-stream + echo +} + +# save current set options +function save_set() { + RUN_CSIT_SAVE_SET="$-" + RUN_CSIT_SHELLOPTS="$SHELLOPTS" +} + +# load the saved set options +function load_set() { + _setopts="$-" + + # bash shellopts + for i in $(echo "$SHELLOPTS" | tr ':' ' ') ; do + set +o ${i} + done + for i in $(echo "$RUN_CSIT_SHELLOPTS" | tr ':' ' ') ; do + set -o ${i} + done + + # other options + for i in $(echo "$_setopts" | sed 's/./& /g') ; do + set +${i} + done + set -${RUN_CSIT_SAVE_SET} +} + +# set options for quick bailout when error +function harden_set() { + set -xeo pipefail + set +u # enabled it would probably fail too many often +} + +# relax set options so the sourced file will not fail +# the responsibility is shifted to the sourced file... +function relax_set() { + set +e + set +o pipefail +} + +# wrapper for sourcing a file +function source_safely() { + [ -z "$1" ] && return 1 + relax_set + . "$1" + load_set +} + +# +# main +# + +# set and save options for quick failure +harden_set && save_set + +if [ $# -eq 0 ] +then + echo + echo "Usage: $0 plans// []" + echo + echo " , , : " + echo " The same values as for the '{project}-csit-{functionality}' JJB job template." + echo + exit 1 +fi + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=$(git rev-parse --show-toplevel) +fi + +if [ -f "${WORKSPACE}/${1}/testplan.txt" ]; then + export TESTPLAN="${1}" +else + echo "testplan not found: ${WORKSPACE}/${TESTPLAN}/testplan.txt" + exit 2 +fi + +export TESTOPTIONS="${2}" + +rm -rf "$WORKSPACE/archives/$TESTPLAN" +mkdir -p "$WORKSPACE/archives/$TESTPLAN" + +TESTPLANDIR="${WORKSPACE}/${TESTPLAN}" + +# Run installation of prerequired libraries +source_safely "${WORKSPACE}/prepare-csit.sh" + +# Activate the virtualenv containing all the required libraries installed by prepare-csit.sh +source_safely "${ROBOT_VENV}/bin/activate" + +WORKDIR=$(mktemp -d --suffix=-robot-workdir) +cd "${WORKDIR}" + +# Add csit scripts to PATH +export PATH="${PATH}:${WORKSPACE}/docker/scripts:${WORKSPACE}/scripts:${ROBOT_VENV}/bin" +export SCRIPTS="${WORKSPACE}/scripts" +export ROBOT_VARIABLES= + +# Sign in to nexus3 docker repo +docker login -u docker -p docker nexus3.onap.org:10001 + +# Run setup script plan if it exists +cd "${TESTPLANDIR}" +SETUP="${TESTPLANDIR}/setup.sh" +if [ -f "${SETUP}" ]; then + echo "Running setup script ${SETUP}" + source_safely "${SETUP}" +fi + +# show memory consumption after all docker instances initialized +docker_stats | tee "$WORKSPACE/archives/$TESTPLAN/_sysinfo-1-after-setup.txt" + +# Run test plan +cd "$WORKDIR" +echo "Reading the testplan:" +cat "${TESTPLANDIR}/testplan.txt" | egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' | sed "s|^|${WORKSPACE}/tests/|" > testplan.txt +cat testplan.txt +SUITES=$( xargs -a testplan.txt ) + +echo ROBOT_VARIABLES="${ROBOT_VARIABLES}" +echo "Starting Robot test suites ${SUITES} ..." +relax_set +python -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} +RESULT=$? +load_set +echo "RESULT: $RESULT" +# Note that the final steps are done in on_exit function after this exit! +exit $RESULT diff --git a/csit/run-project-csit.sh b/csit/run-project-csit.sh new file mode 100755 index 0000000..a231c5e --- /dev/null +++ b/csit/run-project-csit.sh @@ -0,0 +1,35 @@ +#!/bin/bash -x +# +# Copyright 2020-2021 © Samsung Electronics Co., Ltd. +# Modifications Copyright (C) 2021 Pantheon.tech +# +# 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. +# +# Branched from ccsdk/distribution to this repository Feb 23, 2021 +# + +# $1 test options (passed on to run-csit.sh as such) + +export TESTOPTIONS=${1} +export WORKSPACE=$(git rev-parse --show-toplevel)/csit + +rm -rf ${WORKSPACE}/archives +mkdir -p ${WORKSPACE}/archives +cd ${WORKSPACE} + +# Execute all test-suites defined under plans subdirectory +for dir in plans/*/ +do + dir=${dir%*/} # remove the trailing / + ./run-csit.sh ${dir} ${TESTOPTIONS} +done diff --git a/csit/scripts/common_functions.sh b/csit/scripts/common_functions.sh new file mode 100755 index 0000000..684c418 --- /dev/null +++ b/csit/scripts/common_functions.sh @@ -0,0 +1,263 @@ +#!/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. + +function memory_details(){ + #General memory details + echo "> top -bn1 | head -3" + top -bn1 | head -3 + echo + + echo "> free -h" + free -h + echo + + #Memory details per Docker + echo "> docker ps" + docker ps + echo + + echo "> docker stats --no-stream" + docker stats --no-stream + echo +} +function fibonacci_number(){ + set +x + if [ $1 -le 1 ] + then + echo "1" + elif [ $1 -le 10 ] + then + Num=$1 + f1=0 + f2=1 + fn=-1 + for i in `eval echo {1..$Num}`;do + fn=$((f1+f2)) + f1=$f2 + f2=$fn + done + echo $fn + else + echo "30" + fi +} +function wait_curl_driver(){ + #Parameters: + #CURL_COMMAND - the URL on which the curl command will be executed + #GREP_STRING - Desired string to be found inside the body response of the + # previous curl command + #EXCLUDE_STRING - If the filtered string (GREP_STRING) must not exist in + # the body response of the curl + #WAIT_MESSAGE - the message to be displayed for logging purpose. (optional) + #REPEAT_NUMBER - the maximum number of tries before abandoning the curl + # command (optional, by default = 15) + #MAX_TIME - Maximum time allowed for the transfer (in seconds) + #STATUS_CODE - A HTTP status code desired to be found by getting the link + # /!\ IMPORTANT NOTICE: the usage of STATUS_CODE option turn GREP_STRING/ + # /!\ EXCLUDE_STRING/and the MAX_TIME options becomes obsolete with no + # /!\ execution impact + #MEMORY_USAGE - If Parameters exists shows the memory usage after curl + # execution(s) + + repeat_max=15 + parameters="$@" + + #WAIT_MESSAGE + if [[ $parameters == *"WAIT_MESSAGE"* ]] + then + wait_message=`echo $parameters | sed -e "s/.*WAIT_MESSAGE=//g"` + wait_message=`echo $wait_message | sed -e "s/ .*//g"` + else + wait_message="wait ..." + fi + + #REPEAT_NUMBER + if [[ $parameters == *"REPEAT_NUMBER"* ]] + then + repeat_max=`echo $parameters | sed -e "s/.*REPEAT_NUMBER=//g"` + repeat_max=`echo $repeat_max | sed -e "s/ .*//g"` + fi + + #CURL_COMMAND + if [[ $parameters == *"CURL_COMMAND"* ]] + then + curl_command=`echo $parameters | sed -e 's/.*CURL_COMMAND=//g'` + curl_command=`echo $curl_command | sed -e 's/ .*//g'` + else + echo "-Curl is empty-" # Or no parameterseter passed. + return 0 + fi + + #MAX_TIME + if [[ $parameters == *"MAX_TIME"* ]] + then + max_time=`echo $parameters | sed -e 's/.*MAX_TIME=//g'` + max_time=`echo $max_time | sed -e 's/ .*//g'` + else + max_time="5" + fi + + exclude_string="" + #EXCLUDE_STRING + if [[ $parameters == *"EXCLUDE_STRING"* ]] + then + exclude_string="-v" + fi + + status_code="" + #STATUS_CODE + if [[ $parameters == *"STATUS_CODE"* ]] + then + status_code=`echo $parameters | sed -e 's/.*STATUS_CODE=//g'` + status_code=`echo $status_code | sed -e 's/ .*//g'` + fi + + for i in `eval echo {1..$repeat_max}`; do + response_code=`curl -o /dev/null --silent --head --write-out '%{http_code}' $curl_command` + echo "..." + if [[ ! -z $status_code ]] ; then + if [ "$status_code" -eq "$response_code" ] + then + echo "SUCCESS:Actual Status code <$response_code> match the expected code <$status_code>" + return 0 + else + echo "WARNING:Expected <$status_code> but Actual <$response_code>" + fi + else + #GREP_STRING + if [[ $parameters == *"GREP_STRING"* ]] + then + grep_command=`echo $parameters | sed -e 's/.*GREP_STRING=//g'` + grep_command=`echo $grep_command | sed -e 's/ REPEAT_NUMBER=.*//g' | sed -e 's/ CURL_COMMAND=.*//g' | sed -e 's/ WAIT_MESSAGE=.*//g' | sed -e 's/ MAX_TIME=.*//g' | sed -e 's/ EXCLUDE_STRING.*//g'` + else + echo "-Grep_command is empty-" # Or no parameters passed. + return 0 + fi + + str=`curl -sS -m$max_time $curl_command | grep "$grep_command"` + echo "BODY::$str" + if [[ ! -z $exclude_string ]] + then + if [[ -z $str ]] + then + echo "SUCCESS: body response does not contains '$grep_command'"; + break; + else + echo "Fall_Short: Body response still contains '$grep_command'" + fi + else + if [[ ! -z $str ]] + then + echo "SUCCESS: body response contains '$grep_command'"; + break; + else + echo "Fall_Short: Element '$grep_command' not found yet # "$i"" + fi + fi + + if [ "$?" = "7" ]; then + echo 'Connection refused or can not connect to server/proxy'; + str='' + fi + fi + seconds2sleep=`fibonacci_number $i` + echo $wait_message + echo "Iteration::$i out of $repeat_max " + echo "Quiet time for $seconds2sleep seconds ..." + sleep $seconds2sleep + + # if waiting for a long time, log system load + if [ $i -gt 45 ] + then + memory_details + fi + done + #MEMORY_USAGE + if [[ $parameters == *"MEMORY_USAGE"* ]] + then + echo "==========================MEMORY USAGE==================================" + memory_details + echo "========================================================================" + fi + return 0 +} + +function run_simulator () +{ + run_robottestlib + run_simulator_docker $1 +} + +function run_robottestlib () +{ + #Start the robottest REST library if not started + if ! pgrep -f robottest > /dev/null + then + #Download the latest robottest jar + wget -q -O ${SCRIPTS}/integration/mockserver/org.openo.robottest.jar "https://nexus.open-o.org/service/local/artifact/maven/redirect?r=snapshots&g=org.openo.integration&a=org.openo.robottest&e=jar&v=LATEST" + chmod +x ${SCRIPTS}/integration/mockserver/org.openo.robottest.jar + eval `java -cp ${SCRIPTS}/integration/mockserver/org.openo.robottest.jar org.openo.robot.test.robottest.MyRemoteLibrary` & + fi +} + +function run_simulator_docker () +{ + #Start the simulator docker if not started + SIMULATOR_IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' simulator` + if [[ -z $SIMULATOR_IP ]] + then + echo "Starting simulator docker..." + SIMULATOR_JSON=$1 + if [[ -z $SIMULATOR_JSON ]] + then + SIMULATOR_JSON=main.json + fi + docker run -d -i -t --name simulator -e SIMULATOR_JSON=$SIMULATOR_JSON -p 18009:18009 -p 18008:18008 openoint/simulate-test-docker + SIMULATOR_IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' simulator` + fi + + #Set the simulator IP in robot variables + ROBOT_VARIABLES=${ROBOT_VARIABLES}" -v SIMULATOR_IP:${SIMULATOR_IP} -v SCRIPTS:${SCRIPTS}" + echo ${ROBOT_VARIABLES} +} + +function get_docker_compose_service () +{ + local service=$1 + local compose_file=${2:-docker-compose.yml} + + echo $(docker-compose --file ./${compose_file} ps | grep $service | cut -d " " -f1 ) +} + +function bypass_ip_adress () +{ + local ip_address=$1 + + if [[ $no_proxy && $no_proxy != *$ip_address* ]]; then + export no_proxy=$no_proxy,$ip_address + fi +} + +function wait_for_service_init () +{ + local service_url=$1 + + for delay in {1..50}; do + curl -sS ${service_url} && break + echo "$delay - Waiting for $service_url..." + sleep $delay + done +} diff --git a/csit/scripts/get-instance-ip.sh b/csit/scripts/get-instance-ip.sh new file mode 100755 index 0000000..a236c02 --- /dev/null +++ b/csit/scripts/get-instance-ip.sh @@ -0,0 +1,17 @@ +#!/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. +# +docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $1 diff --git a/csit/scripts/has-properties/AAF_RootCA.cer b/csit/scripts/has-properties/AAF_RootCA.cer new file mode 100644 index 0000000..e9a50d7 --- /dev/null +++ b/csit/scripts/has-properties/AAF_RootCA.cer @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPjCCAyagAwIBAgIJAJ6u7cCnzrWdMA0GCSqGSIb3DQEBCwUAMCwxDjAMBgNV +BAsMBU9TQUFGMQ0wCwYDVQQKDARPTkFQMQswCQYDVQQGEwJVUzAeFw0xODA0MDUx +NDE1MjhaFw0zODAzMzExNDE1MjhaMCwxDjAMBgNVBAsMBU9TQUFGMQ0wCwYDVQQK +DARPTkFQMQswCQYDVQQGEwJVUzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC +ggIBAMA5pkgRs7NhGG4ew5JouhyYakgYUyFaG121+/h8qbSdt0hVQv56+EA41Yq7 +XGie7RYDQK9NmAFF3gruE+6X7wvJiChp+Cyd7sFMnb65uWhxEdxWTM2BJFrgfzUn +H8ZCxgaCo3XH4PzlKRy2LQQJEJECwl/RZmRCXijMt5e9h8XoZY/fKkKcZZUsWNCM +pTo266wjvA9MXLmdgReRj0+vrCjrNqy+htwJDztoiHWiYPqT6o8EvGcgjNqjlZx7 +NUNf8MfLDByqKF6+wRbHv1GKjn3/Vijd45Fv8riyRYROiFanvbV6jIfBkv8PZbXg +2VDWsYsgp8NAvMxK+iV8cO+Ck3lBI2GOPZbCEqpPVTYbLUz6sczAlCXwQoPzDIZY +wYa3eR/gYLY1gP2iEVHORag3bLPap9ZX5E8DZkzTNTjovvLk8KaCmfcaUMJsBtDd +ApcUitz10cnRyZc1sX3gE1f3DpzQM6t9C5sOVyRhDcSrKqqwb9m0Ss04XAS9FsqM +P3UWYQyqDXSxlUAYaX892u8mV1hxnt2gjb22RloXMM6TovM3sSrJS0wH+l1nznd6 +aFXftS/G4ZVIVZ/LfT1is4StoyPWZCwwwly1z8qJQ/zhip5NgZTxQw4mi7ww35DY +PdAQOCoajfSvFjqslQ/cPRi/MRCu079heVb5fQnnzVtnpFQRAgMBAAGjYzBhMB0G +A1UdDgQWBBRTVTPyS+vQUbHBeJrBKDF77+rtSTAfBgNVHSMEGDAWgBRTVTPyS+vQ +UbHBeJrBKDF77+rtSTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAN +BgkqhkiG9w0BAQsFAAOCAgEAPx/IaK94n02wPxpnYTy+LVLIxwdq/kawNd6IbiMz +L87zmNMDmHcGbfoRCj8OkhuggX9Lx1/CkhpXimuYsZOFQi5blr/u+v4mIbsgbmi9 +7j+cUHDP0zLycvSvxKHty51LwmaX9a4wkJl5zBU4O1sd/H9tWcEmwJ39ltKoBKBx +c94Zc3iMm5ytRWGj+0rKzLDAXEWpoZ5bE5PLJauA6UDCxDLfs3FwhbS7uDggxYvf +jySF5FCNET94oJ+m8s7VeHvoa8iPGKvXrIqdd7XDHnqJJlVKr7m9S0fMbyEB8ci2 +RtOXDt93ifY1uhoEtEykn4dqBSp8ezvNMnwoXdYPDvTd9uCAFeWFLVreBAWxd25h +PsBTkZA5hpa/rA+mKv6Af4VBViYr8cz4dZCsFChuioVebe9ighrfjB//qKepFjPF +CyjzKN1u0JKm/2x/ORqxkTONG8p3uDwoIOyimUcTtTMv42bfYD88RKakqSFXE9G+ +Z0LlaKABqfjK49o/tsAp+c5LoNlYllKhnetO3QAdraHwdmC36BhoghzR1jpX751A +cZn2VH3Q4XKyp01cJNCJIrua+A+bx6zh3RyW6zIIkbRCbET+UD+4mr8WIcSE3mtR +ZVlnhUDO4z9//WKMVzwS9Rh8/kuszrGFI1KQozXCHLrce3YP6RYZfOed79LXaRwX +dYY= +-----END CERTIFICATE----- diff --git a/csit/scripts/has-properties/conductor.conf.onap b/csit/scripts/has-properties/conductor.conf.onap new file mode 100644 index 0000000..b8b0a0a --- /dev/null +++ b/csit/scripts/has-properties/conductor.conf.onap @@ -0,0 +1,635 @@ +[DEFAULT] + +# +# From conductor +# + +# Configuration file for WSGI definition of API. (string value) +api_paste_config = /usr/local/etc/conductor/api_paste.ini + +# Music keyspace for content (string value) +#keyspace = conductor + +# Delay time (Seconds) for MUSIC requests. Set it to 2 seconds by default. +# (integer value) +#delay_time = 2 + +# (boolean value) +#HPA_enabled = true + +# +# From oslo.log +# + +# If set to true, the logging level will be set to DEBUG instead of the default +# INFO level. (boolean value) +# Note: This option can be changed without restarting. +debug = true + +# The name of a logging configuration file. This file is appended to any +# existing logging configuration files. For details about logging configuration +# files, see the Python logging module documentation. Note that when logging +# configuration files are used then all logging configuration is set in the +# configuration file and other logging configuration options are ignored (for +# example, logging_context_format_string). (string value) +# Note: This option can be changed without restarting. +# Deprecated group/name - [DEFAULT]/log_config +log_config_append = /usr/local/bin/log.conf + +# Defines the format string for %%(asctime)s in log records. Default: +# %(default)s . This option is ignored if log_config_append is set. (string +# value) +#log_date_format = %Y-%m-%d %H:%M:%S + +# (Optional) Name of log file to send logging output to. If no default is set, +# logging will go to stderr as defined by use_stderr. This option is ignored if +# log_config_append is set. (string value) +# Deprecated group/name - [DEFAULT]/logfile +#log_file = application.log + +# (Optional) The base directory used for relative log_file paths. This option +# is ignored if log_config_append is set. (string value) +# Deprecated group/name - [DEFAULT]/logdir +log_dir = /var/log + +# Uses logging handler designed to watch file system. When log file is moved or +# removed this handler will open a new log file with specified path +# instantaneously. It makes sense only if log_file option is specified and +# Linux platform is used. This option is ignored if log_config_append is set. +# (boolean value) +#watch_log_file = false + +# Use syslog for logging. Existing syslog format is DEPRECATED and will be +# changed later to honor RFC5424. This option is ignored if log_config_append +# is set. (boolean value) +#use_syslog = false + +# Enable journald for logging. If running in a systemd environment you may wish +# to enable journal support. Doing so will use the journal native protocol +# which includes structured metadata in addition to log messages.This option is +# ignored if log_config_append is set. (boolean value) +#use_journal = false + +# Syslog facility to receive log lines. This option is ignored if +# log_config_append is set. (string value) +#syslog_log_facility = LOG_USER + +# Use JSON formatting for logging. This option is ignored if log_config_append +# is set. (boolean value) +#use_json = false + +# Log output to standard error. This option is ignored if log_config_append is +# set. (boolean value) +#use_stderr = false + +# Format string to use for log messages with context. (string value) +#logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s + +# Format string to use for log messages when context is undefined. (string +# value) +#logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s + +# Additional data to append to log message when logging level for the message +# is DEBUG. (string value) +#logging_debug_format_suffix = %(funcName)s %(pathname)s:%(lineno)d + +# Prefix each line of exception output with this format. (string value) +#logging_exception_prefix = %(asctime)s.%(msecs)03d %(process)d ERROR %(name)s %(instance)s + +# Defines the format string for %(user_identity)s that is used in +# logging_context_format_string. (string value) +#logging_user_identity_format = %(user)s %(tenant)s %(domain)s %(user_domain)s %(project_domain)s + +# List of package logging levels in logger=LEVEL pairs. This option is ignored +# if log_config_append is set. (list value) +#default_log_levels = amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,oslo_messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN,websocket=WARN,requests.packages.urllib3.util.retry=WARN,urllib3.util.retry=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN,taskflow=WARN,keystoneauth=WARN,oslo.cache=INFO,dogpile.core.dogpile=INFO + +# Enables or disables publication of error events. (boolean value) +#publish_errors = false + +# The format for an instance that is passed with the log message. (string +# value) +#instance_format = "[instance: %(uuid)s] " + +# The format for an instance UUID that is passed with the log message. (string +# value) +#instance_uuid_format = "[instance: %(uuid)s] " + +# Interval, number of seconds, of log rate limiting. (integer value) +#rate_limit_interval = 0 + +# Maximum number of logged messages per rate_limit_interval. (integer value) +#rate_limit_burst = 0 + +# Log level name used by rate limiting: CRITICAL, ERROR, INFO, WARNING, DEBUG +# or empty string. Logs with level greater or equal to rate_limit_except_level +# are not filtered. An empty string means that all levels are filtered. (string +# value) +#rate_limit_except_level = CRITICAL + +# Enables or disables fatal status of deprecations. (boolean value) +#fatal_deprecations = false + + +[auth] +# appkey = h@ss3crtky400fdntc#001 +appkey = + +[aaf_api] + +# +# From conductor +# + +# is_aaf_enabled. (boolean value) +#is_aaf_enabled = true + +# aaf_cache_expiry_hrs. (integer value) +#aaf_cache_expiry_hrs = 3 + +# aaf_url. (string value) +aaf_url = http://localhost:8100/authz/perms/user/ + +# aaf_cert_file. (string value) +#aaf_cert_file = + +# aaf_cert_key_file. (string value) +#aaf_cert_key_file = + +# aaf_ca_bundle_file. (string value) +#aaf_ca_bundle_file = +aaf_ca_bundle_file = /usr/local/bin/AAF_RootCA.cer + +# aaf_retries. (integer value) +#aaf_retries = 3 + +# aaf_timeout. (integer value) +#aaf_timeout = 100 + +# aaf_user_roles. (list value) +#aaf_permissions = {"type": "org.onap.oof.access","instance": "*","action": "*"} + + +[aaf_sms] + +# +# From conductor +# + +# Is Secret Management service enabled (boolean value) +#is_enabled = true + +# Base URL for SMS, up to and not including the version, and without a trailing +# slash. (string value) +aaf_sms_url = http://aaf-sms.onap:10443 + +# Timeout for SMS API Call (integer value) +#aaf_sms_timeout = 30 + +# Path to the cacert that will be used to verify If this is None, verify will +# be False and the server certis not verified by the client. (string value) +#aaf_ca_certs = AAF_RootCA.cer +aaf_ca_certs = /usr/local/bin/AAF_RootCA.cer + +# Domain Name for HAS (string value) +#secret_domain = has + + +[aai] + +# +# From conductor +# + +# Interval with which to refresh the local cache, in minutes. (integer value) +#cache_refresh_interval = 1440 +cache_refresh_interval = 1 + +# Interval with which to refresh the local complex cache, in minutes. (integer +# value) +#complex_cache_refresh_interval = 1440 +complex_cache_refresh_interval = 60 + +# Data Store table prefix. (string value) +#table_prefix = aai + +# Base URL for A&AI, up to and not including the version, and without a +# trailing slash. (string value) +#server_url = https://controller:8443/aai +server_url = http://localhost:8081/aai/ + +# Timeout for A&AI Rest Call (string value) +#aai_rest_timeout = 30 + +# Number of retry for A&AI Rest Call (string value) +#aai_retries = 3 + +# The version of A&AI in v# format. (string value) +server_url_version = v14 + +# SSL/TLS certificate file in pem format. This certificate must be registered +# with the A&AI endpoint. (string value) +#certificate_file = certificate.pem +certificate_file = + +# Private Certificate Key file in pem format. (string value) +#certificate_key_file = certificate_key.pem +certificate_key_file = + +# Certificate Authority Bundle file in pem format. Must contain the appropriate +# trust chain for the Certificate file. (string value) +#certificate_authority_bundle_file = certificate_authority_bundle.pem +certificate_authority_bundle_file = /usr/local/bin/AAF_RootCA.cer + +[api] + +# +# From conductor +# + +# Toggle Pecan Debug Middleware. (boolean value) +#pecan_debug = false + +# Default maximum number of items returned by API request. (integer value) +# Minimum value: 1 +#default_api_return_limit = 100 + + +[conductor_api] + +# +# From conductor +# + +# Base URL for plans. (string value) +#server_url = + +# auth toggling. (boolean value) +basic_auth_secure = false + + +[controller] + +# +# From conductor +# + +# Timeout for planning requests. Default value is 10. (integer value) +# Minimum value: 1 +#timeout = 10 + +# Maximum number of result sets to return. Default value is 1. (integer value) +# Minimum value: 1 +#limit = 1 + +# Number of workers for controller service. Default value is 1. (integer value) +# Minimum value: 1 +#workers = 1 + +# Set to True when controller will run in active-active mode. When set to +# False, controller will flush any abandoned messages at startup. The +# controller always restarts abandoned template translations at startup. +# (boolean value) +#concurrent = false +concurrent = true + +# Time between checking for new plans. Default value is 1. (integer value) +# Minimum value: 1 +#polling_interval = 1 +opt_schema_file = /opt/has/conductor/etc/conductor/opt_schema.json + +# (integer value) +# Minimum value: 1 +#max_translation_counter = 1 + + +[data] + +# +# From conductor +# + +# Number of workers for data service. Default value is 1. (integer value) +# Minimum value: 1 +#workers = 1 + +# Set to True when data will run in active-active mode. When set to False, data +# will flush any abandoned messages at startup. (boolean value) +#concurrent = false +concurrent = true + +# Default value is -8000, which is the diameter of the earth. The distance +# cannot larger than this value (floating point value) +#existing_placement_cost = -8000.0 + +# (floating point value) +#cloud_candidate_cost = 2.0 + +# (floating point value) +#service_candidate_cost = 1.0 + + +[inventory_provider] + +# +# From conductor +# + +# Extensions list to use (list value) +extensions = aai,generator + + +[messaging_server] + +# +# From conductor +# + +# Music keyspace for messages (string value) +#keyspace = conductor_rpc + +# Wait interval while checking for a message response. Default value is 1 +# second. (integer value) +# Minimum value: 1 +#check_interval = 1 + +# Overall message response timeout. Default value is 120 seconds. (integer +# value) +# Minimum value: 1 +#response_timeout = 120 + +# Timeout for detecting a VM is down, and other VMs can pick the plan up. +# Default value is 5 minutes. (integer value) (integer value) +# Minimum value: 1 +#timeout = 300 + +# Number of workers for messaging service. Default value is 1. (integer value) +# Minimum value: 1 +#workers = 1 + +# Time between checking for new messages. Default value is 1. (integer value) +# Minimum value: 1 +#polling_interval = 1 + +# Log debug messages. Default value is False. (boolean value) +#debug = 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 + +# Certificate Authority Bundle file in pem format. Must contain the appropriate +# trust chain for the Certificate file. (string value) +#certificate_authority_bundle_file = certificate_authority_bundle.pem +certificate_authority_bundle_file = /usr/local/bin/AAF_RootCA.cer + +# Enabling HTTPs mode (boolean value) +# enable_https_mode = +enable_https_mode = True +[music_api] + +# +# From conductor +# + +# Base URL for Music REST API without a trailing slash. (string value) +server_url = http://localhost:8080/MUSIC/rest/v2 +version = v2 + +# DEPRECATED: List of hostnames (round-robin access) (list value) +# This option is deprecated for removal. +# Its value may be silently ignored in the future. +# Reason: Use server_url instead +#hostnames = + +# DEPRECATED: Port (integer value) +# This option is deprecated for removal. +# Its value may be silently ignored in the future. +# Reason: Use server_url instead +#port = + +# DEPRECATED: Path (string value) +# This option is deprecated for removal. +# Its value may be silently ignored in the future. +# Reason: Use server_url instead +#path = + +# Socket connection timeout (floating point value) +#connect_timeout = 3.05 + +# Socket read timeout (floating point value) +#read_timeout = 12.05 + +# Lock timeout (integer value) +#lock_timeout = 10 + +# Replication factor (integer value) +#replication_factor = 1 + +# Use mock API (boolean value) +#mock = false + +# (string value) +#music_topology = SimpleStrategy + +# Name of the first data center (string value) +#first_datacenter_name = + +# Number of replicas in first data center (integer value) +#first_datacenter_replicas = + +# Name of the second data center (string value) +#second_datacenter_name = + +# Number of replicas in second data center (integer value) +#second_datacenter_replicas = + +# Name of the third data center (string value) +#third_datacenter_name = + +# Number of replicas in third data center (integer value) +#third_datacenter_replicas = + +# new or old version (boolean value) +#music_new_version = +music_new_version = True + +# for version (string value) +#music_version = +music_version = "3.0.21" + +[prometheus] + +# +# From conductor +# + +# Prometheus Metrics Endpoint (list value) +#metrics_port = 8000,8001,8002,8003,8004 + + +[reservation] + +# +# From conductor +# + +# Number of workers for reservation service. Default value is 1. (integer +# value) +# Minimum value: 1 +#workers = 1 + +# Number of times reservation/release should be attempted. (integer value) +#reserve_retries = 1 + +# Timeout for detecting a VM is down, and other VMs can pick the plan up and +# resereve. Default value is 600 seconds. (integer value) (integer value) +# Minimum value: 1 +#timeout = 600 + +# Set to True when reservation will run in active-active mode. When set to +# False, reservation will restart any orphaned reserving requests at startup. +# (boolean value) +#concurrent = false +concurrent = true + +# (integer value) +# Minimum value: 1 +#max_reservation_counter = 1 + + +[sdnc] + +# +# From conductor +# + +# Interval with which to refresh the local cache, in minutes. (integer value) +#cache_refresh_interval = 1440 + +# Data Store table prefix. (string value) +#table_prefix = sdnc + +# Base URL for SDN-C, up to and including the version. (string value) +#server_url = https://controller:8443/restconf/ +server_url = http://localhost:8083/restconf/ + +# Timeout for SDNC Rest Call (string value) +#sdnc_rest_timeout = 30 + +# Retry Numbers for SDNC Rest Call (string value) +#sdnc_retries = 3 + + +[service_controller] + +# +# From conductor +# + +# Extensions list to use (list value) +#extensions = sdnc + + +[solver] + +# +# From conductor +# + +# Number of workers for solver service. Default value is 1. (integer value) +# Minimum value: 1 +#workers = 1 + +# The timeout value for solver service. Default value is 480 seconds. (integer +# value) +# Minimum value: 1 +#solver_timeout = 480 + +# Set to True when solver will run in active-active mode. When set to False, +# solver will restart any orphaned solving requests at startup. (boolean value) +#concurrent = false +concurrent = true + +# Timeout for detecting a VM is down, and other VMs can pick the plan up. This +# value should be larger than solver_timeoutDefault value is 10 minutes. +# (integer value) (integer value) +# Minimum value: 1 +#timeout = 600 + +# (integer value) +# Minimum value: 1 +#max_solver_counter = 1 + + +[vim_controller] + +# +# From conductor +# + +# Extensions list to use (list value) +#extensions = multicloud + + +[sdc] + +# +# From conductor +# + + +# Data Store table prefix. (string value) +#table_prefix = sdc + +# Base URL for SDC, up to and not including the version, and without a +# trailing slash. (string value) +#server_url = https://controller:8443/sdc +server_url = http://localhost:9595/sdc + +# Timeout for SDC Rest Call (string value) +#sdc_rest_timeout = 30 + +# Number of retry for SDC Rest Call (string value) +#sdc_retries = 3 + +# The version of A&AI in v# format. (string value) +server_url_version = v1 + +# SSL/TLS certificate file in pem format. This certificate must be registered +# with the SDC endpoint. (string value) +#certificate_file = certificate.pem +certificate_file = + +# Private Certificate Key file in pem format. (string value) +#certificate_key_file = certificate_key.pem +certificate_key_file = + +# Certificate Authority Bundle file in pem format. Must contain the appropriate +# trust chain for the Certificate file. (string value) +#certificate_authority_bundle_file = certificate_authority_bundle.pem +certificate_authority_bundle_file = /usr/local/bin/AAF_RootCA.cer + +# Username for SDC. (string value) +#username = + +# Password for SDC. (string value) +#password = + +temp_path = "/tmp/nsttemplates" + diff --git a/csit/scripts/has-properties/has.json b/csit/scripts/has-properties/has.json new file mode 100644 index 0000000..2074c6c --- /dev/null +++ b/csit/scripts/has-properties/has.json @@ -0,0 +1,51 @@ +{ + "domain": { + "name": "has", + "secrets": [ + { + "name": "aai", + "values": { + "username": "oof@oof.onap.org", + "password": "demo123456!" + } + }, + { + "name": "conductor_api", + "values": { + "username": "admin1", + "password": "plan.15" + } + }, + { + "name": "sdnc", + "values": { + "username": "admin", + "password": "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" + } + }, + { + "name": "sdc", + "values": { + "username": "aai", + "password": "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" + } + }, + { + "name": "music_api", + "values": { + "aafuser": "conductor", + "aafpass": "c0nduct0r", + "aafns": "conductor" + } + }, + { + "name": "aaf_api", + "values": { + "username": "aaf_admin@people.osaaf.org", + "password": "demo123456!", + "aaf_conductor_user": "oof@oof.onap.org" + } + } + ] + } +} diff --git a/csit/scripts/has-properties/log.conf.onap b/csit/scripts/has-properties/log.conf.onap new file mode 100644 index 0000000..41d6644 --- /dev/null +++ b/csit/scripts/has-properties/log.conf.onap @@ -0,0 +1,65 @@ +[loggers] +keys=root + +[handlers] +keys=trfhand,consoleHandler,audithand,metrichand,errhand,debughand + +[logger_root] +level=NOTSET +handlers=trfhand,consoleHandler,audithand,metrichand,errhand,debughand + +[handler_consoleHandler] +class=StreamHandler +level=NOTSET +formatter=generic +args=(sys.stdout,) + +[handler_trfhand] +class=handlers.TimedRotatingFileHandler +level=NOTSET +formatter=generic +args=('application.log','midnight', 1, 10) + +[handler_audithand] +class=handlers.TimedRotatingFileHandler +level=INFO +formatter=audit +args=('audit.log', 'midnight', 1, 10) + +[handler_metrichand] +class=handlers.TimedRotatingFileHandler +level=INFO +formatter=metric +args=('metric.log','midnight', 1, 10) + +[handler_errhand] +class=handlers.TimedRotatingFileHandler +level=ERROR +formatter=error +args=('error.log','midnight', 1, 10) + +[handler_debughand] +class=handlers.TimedRotatingFileHandler +level=DEBUG +formatter=generic +args=('debug.log','midnight', 1, 10) + +[formatters] +keys=generic,audit,metric,error + +[formatter_audit] +format=%(asctime)s|%(asctime)s|00000000-0000-0000-0000-000000000000||%(thread)d||Conductor|N/A|COMPLETE|200|sucessful||%(levelname)s|||0|%(module)s|||||||||%(name)s : [-] %(message)s +datefmt= + +[formatter_metric] +format=%(asctime)s|%(asctime)s|00000000-0000-0000-0000-000000000000||%(thread)d||Conductor|N/A|N/A|N/A|COMPLETE|200|sucessful||%(levelname)s|||0|%(module)s||||||||||%(name)s : [-] %(message)s +datefmt= + +[formatter_error] +format=%(asctime)s|00000000-0000-0000-0000-000000000000|%(thread)d|Conductor|N/A|N/A|N/A|ERROR|500|N/A|%(name)s : [-] %(message)s +datefmt= + +[formatter_generic] +format=%(asctime)s||%(thread)d|%(levelname)s|%(module)s|%(name)s: [-] %(message)s +datefmt= + diff --git a/csit/scripts/has_proxy_settings.sh b/csit/scripts/has_proxy_settings.sh new file mode 100755 index 0000000..2a84bfc --- /dev/null +++ b/csit/scripts/has_proxy_settings.sh @@ -0,0 +1,31 @@ +#!/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. +# +# put into this file local proxy settings in case they are needed on your local environment +echo "### This is ${WORKSPACE}/scripts/has_proxy_settings.sh" + +echo "optf/has proxy settings" +if [ "$#" -eq "1" ]; then + echo "$1" + cd $1 + pwd +else + exit 1 +fi + +# don't remove following lines: commands can be attached here + + diff --git a/csit/scripts/has_script.sh b/csit/scripts/has_script.sh new file mode 100755 index 0000000..b33e1ab --- /dev/null +++ b/csit/scripts/has_script.sh @@ -0,0 +1,118 @@ +#!/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 "### This is ${WORKSPACE}/scripts/has_script.sh" +# +# add here whatever commands is needed to prepare the optf/has CSIT testing +# + +# assume the base is /tmp dir +DIR=/tmp + +# the directory of the script +echo ${DIR} +cd ${DIR} + +# create directory for volume and copy configuration file +# run docker containers +COND_CONF=/tmp/conductor/properties/conductor.conf +LOG_CONF=/tmp/conductor/properties/log.conf +IMAGE_NAME=nexus3.onap.org:10003/onap/optf-has +IMAGE_VER=latest +BUNDLE=/tmp/conductor/properties/AAF_RootCA.cer + +mkdir -p /tmp/conductor/properties +mkdir -p /tmp/sms/properties +mkdir -p /tmp/conductor/logs +cp ${WORKSPACE}/scripts/has-properties/conductor.conf.onap /tmp/conductor/properties/conductor.conf +cp ${WORKSPACE}/scripts/has-properties/log.conf.onap /tmp/conductor/properties/log.conf +cp ${WORKSPACE}/scripts/has-properties/AAF_RootCA.cer /tmp/conductor/properties/AAF_RootCA.cer +cp ${WORKSPACE}/scripts/has-properties/has.json /tmp/sms/properties/has.json +#chmod -R 777 /tmp/conductor/properties + +MUSIC_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' music-tomcat` +echo "MUSIC_IP=${MUSIC_IP}" +SMS_IP=`${WORKSPACE}/scripts/get-instance-ip.sh sms` +echo "SMS_IP=${SMS_IP}" + +# change MUSIC reference to the local instance +sed -i -e "s%localhost:8080/MUSIC%${MUSIC_IP}:8080/MUSIC%g" /tmp/conductor/properties/conductor.conf + +AAISIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' aaisim` +echo "AAISIM_IP=${AAISIM_IP}" + +# change AAI reference to the local instance +sed -i -e "s%localhost:8081/%${AAISIM_IP}:8081/%g" /tmp/conductor/properties/conductor.conf + +SDCSIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' sdcsim` +echo "SDCSIM_IP=${SDCSIM_IP}" + +# change SDC reference to the local instance +sed -i -e "s%localhost:9595/%${SDCSIM_IP}:9595/%g" /tmp/conductor/properties/conductor.conf + + +MULTICLOUDSIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' multicloudsim` +echo "MULTICLOUDSIM_IP=${MULTICLOUDSIM_IP}" + +# change MULTICLOUD reference to the local instance +sed -i -e "s%msb.onap.org:8082/%${MULTICLOUDSIM_IP}:8082/%g" /tmp/conductor/properties/conductor.conf + +AAFSIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' aafsim` +echo "AAFSIM_IP=${AAFSIM_IP}" + +# change AAF reference to the local instance +sed -i -e "s%localhost:8100/%${AAFSIM_IP}:8100/%g" /tmp/conductor/properties/conductor.conf + +#SMS +sed -i -e "s%aaf-sms.onap:10443%${SMS_IP}:10443%g" /tmp/conductor/properties/conductor.conf +#Preload secrets +docker exec --user root -i sms /bin/sh -c "mkdir -p /preload/config" +docker cp /tmp/sms/properties/has.json sms:/preload/config/has.json +docker exec --user root -i sms /bin/sh -c "/sms/bin/preload -cacert /sms/certs/aaf_root_ca.cer -jsondir /preload/config -serviceport 10443 -serviceurl http://localhost" +docker logs vault + +#onboard conductor into music +echo "Query MUSIC to check for reachability. Query Version" +curl -vvvvv --noproxy "*" --request GET http://${MUSIC_IP}:8080/MUSIC/rest/v2/version -H "Content-Type: application/json" + +echo "Onboard conductor into music" +curl -vvvvv --noproxy "*" --request POST http://${MUSIC_IP}:8080/MUSIC/rest/v2/admin/onboardAppWithMusic -H "Content-Type: application/json" -H "Authorization: Basic Y29uZHVjdG9yOmMwbmR1Y3Qwcg==" --data @${WORKSPACE}/tests/has/data/onboard.json + +docker run -d --name cond-cont --user root -v ${COND_CONF}:/usr/local/bin/conductor.conf -v ${LOG_CONF}:/usr/local/bin/log.conf -v ${BUNDLE}:/usr/local/bin/AAF_RootCA.cer ${IMAGE_NAME}:${IMAGE_VER} python /usr/local/bin/conductor-controller --config-file=/usr/local/bin/conductor.conf +sleep 15 +docker run -d --name cond-api --user root -p "8091:8091" -v ${COND_CONF}:/usr/local/bin/conductor.conf -v ${LOG_CONF}:/usr/local/bin/log.conf -v ${BUNDLE}:/usr/local/bin/AAF_RootCA.cer ${IMAGE_NAME}:${IMAGE_VER} python /usr/local/bin/conductor-api --port=8091 -- --config-file=/usr/local/bin/conductor.conf +sleep 15 +docker run -d --name cond-solv --user root -v ${COND_CONF}:/usr/local/bin/conductor.conf -v ${LOG_CONF}:/usr/local/bin/log.conf -v ${BUNDLE}:/usr/local/bin/AAF_RootCA.cer ${IMAGE_NAME}:${IMAGE_VER} python /usr/local/bin/conductor-solver --config-file=/usr/local/bin/conductor.conf +sleep 15 +docker run -d --name cond-resv --user root -v ${COND_CONF}:/usr/local/bin/conductor.conf -v ${LOG_CONF}:/usr/local/bin/log.conf -v ${BUNDLE}:/usr/local/bin/AAF_RootCA.cer ${IMAGE_NAME}:${IMAGE_VER} python /usr/local/bin/conductor-reservation --config-file=/usr/local/bin/conductor.conf +sleep 5 +docker run -d --name cond-data --user root -v ${COND_CONF}:/usr/local/bin/conductor.conf -v ${LOG_CONF}:/usr/local/bin/log.conf -v ${BUNDLE}:/usr/local/bin/AAF_RootCA.cer ${IMAGE_NAME}:${IMAGE_VER} python /usr/local/bin/conductor-data --config-file=/usr/local/bin/conductor.conf +sleep 15 + +COND_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' cond-api` +${WORKSPACE}/scripts/wait_for_port.sh ${COND_IP} 8091 + +echo "inspect docker things for tracing purpose" +docker inspect cond-data +docker inspect cond-cont +docker inspect cond-api +docker inspect cond-solv +docker inspect cond-resv + +echo "dump music content just after conductor is started" +docker exec music-db /usr/bin/nodetool status +docker exec music-db /usr/bin/cqlsh -unelson24 -pwinman123 -e 'SELECT * FROM system_schema.keyspaces' +docker exec music-db /usr/bin/cqlsh -unelson24 -pwinman123 -e 'SELECT * FROM admin.keyspace_master' diff --git a/csit/scripts/has_teardown_script.sh b/csit/scripts/has_teardown_script.sh new file mode 100755 index 0000000..bef28b4 --- /dev/null +++ b/csit/scripts/has_teardown_script.sh @@ -0,0 +1,34 @@ +#!/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 "print meaningful data before scratching everything" +docker exec music-db /usr/bin/cqlsh -unelson24 -pwinman123 -e 'SELECT * FROM system_schema.keyspaces' +docker exec music-db /usr/bin/cqlsh -unelson24 -pwinman123 -e 'SELECT * FROM admin.keyspace_master' +docker exec music-db /usr/bin/cqlsh -unelson24 -pwinman123 -e 'SELECT * FROM conductor.plans' + +echo "optf/has scripts docker containers killing"; +docker stop cond-api +docker stop cond-solv +docker stop cond-cont +docker stop cond-data +docker stop cond-resv + +docker rm cond-api +docker rm cond-solv +docker rm cond-cont +docker rm cond-data +docker rm cond-resv + diff --git a/csit/scripts/music-properties/log4j.properties b/csit/scripts/music-properties/log4j.properties new file mode 100644 index 0000000..1312e9b --- /dev/null +++ b/csit/scripts/music-properties/log4j.properties @@ -0,0 +1,3 @@ +# No longer needed, please see the logback properties + + diff --git a/csit/scripts/music-properties/music.properties b/csit/scripts/music-properties/music.properties new file mode 100644 index 0000000..02fb52d --- /dev/null +++ b/csit/scripts/music-properties/music.properties @@ -0,0 +1,17 @@ +my.public.ip=localhost +all.public.ips=localhost +my.id=0 +all.ids=0 +####################################### +# Optional current values are defaults +####################################### +zookeeper.host=music-zk +cassandra.host=music-db +#music.ip=localhost +#debug=true +#music.rest.ip=localhost +#lock.lease.period=6000 +cassandra.user=nelson24 +cassandra.password=winman123 + + diff --git a/csit/scripts/music/cql/admin.cql b/csit/scripts/music/cql/admin.cql new file mode 100644 index 0000000..df13f32 --- /dev/null +++ b/csit/scripts/music/cql/admin.cql @@ -0,0 +1,34 @@ +CREATE KEYSPACE IF NOT EXISTS admin + WITH REPLICATION = { + 'class' : 'SimpleStrategy', + 'replication_factor': 1 + } + AND DURABLE_WRITES = true; + +CREATE TABLE IF NOT EXISTS admin.keyspace_master ( + uuid uuid, + keyspace_name text, + application_name text, + is_api boolean, + password text, + username text, + is_aaf boolean, + PRIMARY KEY (uuid) +); + +CREATE TABLE IF NOT EXISTS admin.notification_master ( + id uuid, + current_notifier text, + endpoint_password blob, + endpoint_userid text, + notify_delete_on text, + notify_insert_on text, + notify_to_endpoint text, + notify_update_on text, + notifyon text PRIMARY KEY, + request text +); + + + +describe keyspace admin; diff --git a/csit/scripts/music/cql/admin_pw.cql b/csit/scripts/music/cql/admin_pw.cql new file mode 100644 index 0000000..02de61e --- /dev/null +++ b/csit/scripts/music/cql/admin_pw.cql @@ -0,0 +1,2 @@ +CREATE ROLE IF NOT EXISTS nelson24 WITH PASSWORD = 'winman123' AND SUPERUSER = True AND LOGIN = True; +ALTER ROLE cassandra WITH PASSWORD = 'SomeLongRandomStringNoonewillthinkof'; diff --git a/csit/scripts/music/cql/extra/test.cql b/csit/scripts/music/cql/extra/test.cql new file mode 100644 index 0000000..6a58720 --- /dev/null +++ b/csit/scripts/music/cql/extra/test.cql @@ -0,0 +1 @@ +DESCRIBE keyspace admin; \ No newline at end of file diff --git a/csit/scripts/music_script.sh b/csit/scripts/music_script.sh new file mode 100755 index 0000000..878d717 --- /dev/null +++ b/csit/scripts/music_script.sh @@ -0,0 +1,173 @@ +#!/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 "### This is ${WORKSPACE}/scripts/music_script.sh" +# +# add here whatever commands is needed to prepare the music setup for optf-has CSIT testing +# + +# +# add here all the configuration steps eventually needed to be carried out for music CSIT testing +# +echo "########## music configuration step ##########"; +CASS_IMG=nexus3.onap.org:10001/onap/music/cassandra_3_11:3.0.23 +CASS_IMG_JOB=nexus3.onap.org:10001/onap/music/cassandra_job:3.0.23 +TOMCAT_IMG=nexus3.onap.org:10001/library/tomcat:8.5 +ZK_IMG=nexus3.onap.org:10001/library/zookeeper:3.4 +BUSYBOX_IMG=nexus3.onap.org:10001/library/busybox:latest +MUSIC_IMG=nexus3.onap.org:10001/onap/music/music:3.0.23 +TT=10 +WORK_DIR=/tmp/music +CASS_USERNAME=nelson24 +CASS_PASSWORD=winman123 +MUSIC_SOURCE_PROPERTIES=${WORKSPACE}/scripts/music-properties +MUSIC_PROPERTIES=/tmp/music/properties +MUSIC_LOGS=/tmp/music/logs +CQL_FILES=${WORKSPACE}/scripts/music/cql +MUSIC_TRIGGER_DIR=/tmp/triggers +TRIGGER_JAR=musictrigger-0.1.0.jar +TRIGGER_JAR_URL=https://nexus.onap.org/service/local/repositories/autorelease-72298/content/org/onap/music/musictrigger/0.1.0/musictrigger-0.1.0.jar + +mkdir -p ${MUSIC_PROPERTIES} +mkdir -p ${MUSIC_LOGS} +mkdir -p ${MUSIC_LOGS}/MUSIC +mkdir -p /tmp/triggers + +# Get Trigger +echo "########## Get Trigger Jar ##########" +curl -o $MUSIC_TRIGGER_DIR/$TRIGGER_JAR $TRIGGER_JAR_URL + +cp ${MUSIC_SOURCE_PROPERTIES}/* ${WORK_DIR}/properties + +# Create Volume for mapping war file and tomcat +echo "########## create music-vol ##########" +docker volume create --name music-vol; + +# Create a network for all the containers to run in. +echo "########## create music-net ##########" +docker network create music-net; + +# Start Cassandra +echo "########## Start Cassandra (music-db) ##########" +docker run -d --name music-db --network music-net -p "7000:7000" -p "7001:7001" -p "7199:7199" -p "9042:9042" -p "9160:9160" \ +-v $MUSIC_TRIGGER_DIR/$TRIGGER_JAR:/etc/cassandra/triggers/$TRIGGER_JAR \ +${CASS_IMG}; + +# See if cassandra is up. +echo "########## Running Test to see if Cassandra is up ##########" +CASSA_IP=`docker inspect -f '{{ $network := index .NetworkSettings.Networks "music-net" }}{{ $network.IPAddress}}' music-db` +echo "CASSANDRA_IP=${CASSA_IP}" +${WORKSPACE}/scripts/wait_for_port.sh ${CASSA_IP} 9042 + +# Sleep 60 seconds to ensure Cassandra is up and running. +sleep 60; + +# Check to see if Keyspaces are there. +docker exec music-db cqlsh -u cassandra -p cassandra -e "DESCRIBE keyspaces;" + +# Load data into Cassandra via Cassandra Job +echo "########## Running Cassandra Job (music-job) to load cql files ##########" +docker run -d --name music-job --network music-net \ +-v $CQL_FILES/admin.cql:/cql/admin.cql \ +-v $CQL_FILES/admin_pw.cql:/cql/admin_pw.cql \ +-v $CQL_FILES/extra:/cql/extra \ +-e PORT=9042 \ +-e CASS_HOSTNAME=music-db \ +-e USERNAME=$CASS_USERNAME \ +-e PASSWORD=$CASS_PASSWORD \ +$CASS_IMG_JOB + +sleep 70; + +# Logs +echo "########## Cassandra Job logs ##########" +docker logs music-job +# Check to see if Keyspaces are there. +# "############## Check if new username and password work ##########" +docker exec music-db cqlsh -u $CASS_USERNAME -p $CASS_PASSWORD -e "DESCRIBE keyspaces;" +# Check to see if Keyspaces are there. +# "############## Check if original username and password work ##########" +docker exec music-db cqlsh -u cassandra -p cassandra -e "DESCRIBE keyspaces;" +# Check to see if Keyspaces are there. +# "############## Check if new cassandra username and password work ##########" +docker exec music-db cqlsh -u cassandra -p SomeLongRandomStringNoonewillthinkof -e "DESCRIBE keyspaces;" + + +# Start Music war +echo "########## Start music-war ##########" +docker run -d --name music-war -v music-vol:/app ${MUSIC_IMG}; + +# Start Zookeeper +echo "########## Start zookeeper (music-zk) ##########" +docker run -d --name music-zk --network music-net -p "2181:2181" -p "2888:2888" -p "3888:3888" ${ZK_IMG}; + +ZOO_IP=`docker inspect -f '{{ $network := index .NetworkSettings.Networks "music-net" }}{{ $network.IPAddress}}' music-zk` +echo "ZOOKEEPER_IP=${ZOO_IP}" + +# Delay between Cassandra/Zookeeper and Tomcat +sleep 120; + +# Start Up tomcat - Needs to have properties,logs dir and war file volume mapped. +echo "########## Start Tomcat (music-tomcat) ##########" +docker run -d --name music-tomcat --network music-net -p "8080:8080" -v music-vol:/usr/local/tomcat/webapps -v ${WORK_DIR}/properties:/opt/app/music/etc:ro -v ${WORK_DIR}/logs:/opt/app/music/logs ${TOMCAT_IMG}; + +# Connect tomcat to host bridge network so that its port can be seen. +echo "########## Create Bridge for Tomcat ##########" +docker network connect bridge music-tomcat; + +TOMCAT_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' music-tomcat` +echo "TOMCAT_IP=${TOMCAT_IP}" + +${WORKSPACE}/scripts/wait_for_port.sh ${TOMCAT_IP} 8080 + +sleep 20; +echo "########## TOMCAT Logs ##########" +docker logs music-tomcat +# Needed only if we need to look at localhost logs. +echo "########## MUSIC localhost Log ##########" +docker exec music-tomcat /bin/bash -c "cat /usr/local/tomcat/logs/localhost*" + +echo "########## MUSIC Log ##########" +ls -al $MUSIC_LOGS/MUSIC +docker exec music-tomcat /bin/bash -c "cat /opt/app/music/logs/MUSIC/music.log" +#echo "########## MUSIC error log ##########" +#docker exec music-tomcat /bin/bash -c "cat /opt/app/music/logs/MUSIC/error.log" + +echo "########## inspect docker things for tracing purpose ##########" +docker inspect music-db +docker inspect music-zk +docker inspect music-tomcat +docker inspect music-war +docker volume inspect music-vol +docker network inspect music-net + +echo "########## dump music content just after music is started ##########" +docker exec music-db /usr/bin/nodetool status +docker exec music-db /usr/bin/cqlsh -unelson24 -pwinman123 -e 'SELECT * FROM system_schema.keyspaces' +docker exec music-db /usr/bin/cqlsh -unelson24 -pwinman123 -e 'DESCRIBE keyspace admin' +docker exec music-db /usr/bin/cqlsh -unelson24 -pwinman123 -e 'SELECT * FROM admin.keyspace_master' + + +# +# add here all ROBOT_VARIABLES settings +# +echo "########## music robot variables settings ##########"; +ROBOT_VARIABLES="-v MUSIC_HOSTNAME:http://${TOMCAT_IP} -v MUSIC_PORT:8080 -v COND_HOSTNAME:http://localhost -v COND_PORT:8091" + +echo ${ROBOT_VARIABLES} + + + diff --git a/csit/scripts/music_teardown_script.sh b/csit/scripts/music_teardown_script.sh new file mode 100755 index 0000000..2e7d707 --- /dev/null +++ b/csit/scripts/music_teardown_script.sh @@ -0,0 +1,61 @@ +#!/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 music CSIT testing +# +echo "dump music.log files" +ls -alF /tmp/music +ls -alFR /tmp/music +ls -alF /tmp/music/properties +cat /tmp/music/properties/music.properties +echo "===== MUSIC log ==================" +docker exec music-tomcat /bin/bash -c "cat /opt/app/music/logs/MUSIC/music.log" +#cat /tmp/music/logs/MUSIC/music.log +echo "===== MUSIC error log ==================" +docker exec music-tomcat /bin/bash -c "cat /opt/app/music/logs/MUSIC/error.log" +#cat /tmp/music/logs/MUSIC/error.log + +echo "##########################################################"; +echo "#"; +echo "# music scripts docker containers killing"; +echo "#"; +echo "##########################################################"; +docker stop music-tomcat +docker stop music-war +docker stop music-zk +docker stop music-job +docker stop music-db + +docker rm music-zk +docker rm music-tomcat +docker rm music-war +docker rm music-job +docker rm music-db + +docker network rm music-net; +sleep 5; + +docker volume rm music-vol + +#rm -Rf /tmp/music + + + + + diff --git a/csit/scripts/setup-sms.sh b/csit/scripts/setup-sms.sh new file mode 100755 index 0000000..ae6bd2f --- /dev/null +++ b/csit/scripts/setup-sms.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# +# Copyright 2018 Intel Corporation +# +# 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. +# + +# Not sure why this is needed. +source ${WORKSPACE}/scripts/common_functions.sh + +CONFIG_FILE=$(pwd)/config/smsconfig.json + +mkdir -p $(pwd)/config + +docker login -u docker -p docker nexus3.onap.org:10001 +docker pull nexus3.onap.org:10001/onap/aaf/sms +docker pull docker.io/vault:1.3.3 + +# +# Running vault in dev server mode here for CSIT +# In HELM it runs in production mode +# +docker run -e "VAULT_DEV_ROOT_TOKEN_ID=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" \ + -e SKIP_SETCAP=true \ + --name vault -d -p 8200:8200 vault:1.3.3 + +SMSDB_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' vault) +cat << EOF > $CONFIG_FILE +{ + "cafile": "auth/selfsignedca.pem", + "servercert": "auth/server.cert", + "serverkey": "auth/server.key", + + "smsdbaddress": "http://$SMSDB_IP:8200", + "vaulttoken": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + "disable_tls": true +} +EOF + +cat $CONFIG_FILE + +docker run --workdir /sms -v $CONFIG_FILE:/sms/smsconfig.json \ + --name sms -d -p 10443:10443 --user root nexus3.onap.org:10001/onap/aaf/sms + +SMS_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sms) + +echo "###### WAITING FOR ALL CONTAINERS TO COME UP" +sleep 20 +for i in {1..20}; do + curl -sS -m 1 http://${SMSDB_IP}:8200/v1/sys/seal-status && break + echo sleep $i + sleep $i +done + +# +# add here all ROBOT_VARIABLES settings +# +echo "# sms robot variables settings"; +ROBOT_VARIABLES="-v SMS_HOSTNAME:http://${SMS_IP} -v SMS_PORT:10443" + +echo ${ROBOT_VARIABLES} diff --git a/csit/scripts/simulator_script.sh b/csit/scripts/simulator_script.sh new file mode 100755 index 0000000..f403e67 --- /dev/null +++ b/csit/scripts/simulator_script.sh @@ -0,0 +1,103 @@ +#!/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 "### This is ${WORKSPACE}/scripts/simulator_script.sh" +# +# add here whatever commands is needed to prepare the optf/has CSIT testing +# +if [ ${USER} != 'jenkins' ]; then + + # add proxy settings into this script when you work behind a proxy + ${WORKSPACE}/scripts/has_proxy_settings.sh ${WORK_DIR} + +fi + +# prepare aaisim +cd ${WORKSPACE}/../conductor/conductor/tests/functional/simulators/ + +# run aaisim +./run_aaisim.sh + +AAISIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' aaisim` +echo "AAISIM_IP=${AAISIM_IP}" + +${WORKSPACE}/scripts/wait_for_port.sh ${AAISIM_IP} 8081 + +# prepare multicloudsim +cd ${WORKSPACE}/../conductor/conductor/tests/functional/simulators/multicloudsim/ + +# check Dockerfile content +cat ./Dockerfile + +# build multicloudsim +docker build -t multicloudsim . + +# run multicloudsim +docker run -d --name multicloudsim -p 8082:8082 multicloudsim + +MULTICLOUDSIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' multicloudsim` +echo "MULTICLOUDSIM_IP=${MULTICLOUDSIM_IP}" + +${WORKSPACE}/scripts/wait_for_port.sh ${MULTICLOUDSIM_IP} 8082 + + +# prepare sdcsim +cd ${WORKSPACE}/../conductor/conductor/tests/functional/simulators/sdcsim/ + +# check Dockerfile content +cat ./Dockerfile + +# build multicloudsim +docker build -t sdcsim . + +# run multicloudsim +docker run -d --name sdcsim -p 9595:9595 sdcsim + +SDCSIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' sdcsim` +echo "SDCSIM_IP=${SDCSIM_IP}" + +${WORKSPACE}/scripts/wait_for_port.sh ${SDCSIM_IP} 9595 + + +# prepare aafsim +echo "simulator_script: prepare aafsim " +cd ${WORKSPACE}/../conductor/conductor/tests/functional/simulators/aafsim/ + +# check Dockerfile content +echo "simulator_script: Dockerfile " +cat ./Dockerfile + +# build aafsim +echo "simulator_script: build docker " +docker build -t aafsim . + +# run aafsim +echo "simulator_script: run docker " +docker run -d --name aafsim -p 8100:8100 aafsim + +AAFSIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' aafsim` +echo "simulator_script: AAFSIM_IP=${AAFSIM_IP}" + +#echo "simulator_script: wait_for_port" +${WORKSPACE}/scripts/wait_for_port.sh ${AAFSIM_IP} 8100 + +# wait a while before continuing +sleep 2 + +echo "inspect docker things for tracing purpose" +docker inspect aaisim +docker inspect multicloudsim +docker inspect aafsim diff --git a/csit/scripts/simulator_teardown_script.sh b/csit/scripts/simulator_teardown_script.sh new file mode 100755 index 0000000..14b3886 --- /dev/null +++ b/csit/scripts/simulator_teardown_script.sh @@ -0,0 +1,26 @@ +#!/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 "optf/has scripts docker containers killing"; +docker stop aaisim +docker stop multicloudsim +docker stop aafsim +docker stop sdcsim + +docker rm aaisim +docker rm multicloudsim +docker rm aafsim +docker rm sdcsim \ No newline at end of file diff --git a/csit/scripts/wait_for_port.sh b/csit/scripts/wait_for_port.sh new file mode 100755 index 0000000..10f08de --- /dev/null +++ b/csit/scripts/wait_for_port.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +if [[ $# -ne 2 ]]; then + echo "Usage: wait-for-port hostname port" >&2 + exit 1 +fi + +host=$1 +port=$2 + +echo "Waiting for $host port $port open" +until telnet $host $port /dev/null | grep -q '^Connected'; do + sleep 1 +done + +echo "$host port $port is open" + +exit 0 diff --git a/csit/tests/has/__init__.robot b/csit/tests/has/__init__.robot new file mode 100644 index 0000000..fb654d7 --- /dev/null +++ b/csit/tests/has/__init__.robot @@ -0,0 +1,4 @@ +*** Settings *** +Documentation Integration - Suite 1 + + diff --git a/csit/tests/has/data/healthcheck.json b/csit/tests/has/data/healthcheck.json new file mode 100644 index 0000000..926bb28 --- /dev/null +++ b/csit/tests/has/data/healthcheck.json @@ -0,0 +1,19 @@ +{ + "consistencyInfo": { + "type": "eventual" + }, + "values": { + "created": 1479482603641, + "message": "", + "name": "foo", + "recommend_max": 1, + "solution": "{\"healthcheck\": \" healthcheck\"}", + "status": "solved", + "template": "{\"healthcheck\": \"healthcheck\"}", + "timeout": 3600, + "translation": "{\"healthcheck\": \" healthcheck\"}", + "updated": 1484324150629 + } +} + + diff --git a/csit/tests/has/data/nsi_selection_template_with_create.json b/csit/tests/has/data/nsi_selection_template_with_create.json new file mode 100644 index 0000000..acf53ff --- /dev/null +++ b/csit/tests/has/data/nsi_selection_template_with_create.json @@ -0,0 +1,151 @@ +{ + "files": {}, + "limit": 10, + "name": "urllc_sample", + "num_solution": "1", + "template": { + "constraints": { + "URLLC_Threshold": { + "demands": [ + "URLLC" + ], + "properties": { + "evaluate": [ + { + "attribute": "latency", + "operator": "lte", + "threshold": { + "get_param": "latency" + }, + "unit": "ms" + }, + { + "attribute": "reliability", + "operator": "gte", + "threshold": { + "get_param": "reliability" + }, + "unit": "" + } + ] + }, + "type": "threshold" + } + }, + "demands": { + "URLLC": [ + { + "default_attributes": { + "creation_cost": 0.1 + }, + "filtering_attributes": { + "service-function": "shared", + "model-invariant-id": "21d57d4b-52ad-4d3c-a798-248b5bb9124a", + "model-version-id": "bfba363e-e39c-4bd9-a9d5-1371c28f4d22", + "service-role": "nsi" + }, + "inventory_provider": "aai", + "inventory_type": "nsi", + "unique": "true" + }, + { + "default_attributes": { + "creation_cost": 0.9 + }, + "filtering_attributes": { + "service_profile": { + "latency": {"value": {"get_param": "latency"}, "operator": "lte"}, + "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"} + }, + "subnets":{ + "core": { + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "core_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "core_reliability" + } + ] + } + }, + "ran": { + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "ran_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "ran_reliability" + } + ] + } + }, + "transport": { + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "tn_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "tn_reliability" + } + ] + } + } + } + }, + "inventory_provider": "generator", + "inventory_type": "slice_profiles", + "unique": "true" + } + ] + }, + "homing_template_version": "2020-08-13", + "optimization": { + "goal": "maximize", + "operation_function": { + "operands": [ + { + "function": "attribute", + "params": { + "attribute": "creation_cost", + "demand": "URLLC" + } + } + ], + "operator": "sum" + } + }, + "parameters": { + "core_latency": 10, + "core_reliability": 99.9, + "latency": 30, + "ran_latency": 7, + "ran_reliability": 99.9, + "reliability": 99.9, + "tn_latency": 10, + "tn_reliability": 99.9 + } + }, + "timeout": 1200 +} diff --git a/csit/tests/has/data/nsi_selection_template_with_nonsi.json b/csit/tests/has/data/nsi_selection_template_with_nonsi.json new file mode 100644 index 0000000..b4e625a --- /dev/null +++ b/csit/tests/has/data/nsi_selection_template_with_nonsi.json @@ -0,0 +1,151 @@ +{ + "files": {}, + "limit": 10, + "name": "urllc_sample", + "num_solution": "1", + "template": { + "constraints": { + "URLLC_Threshold": { + "demands": [ + "URLLC" + ], + "properties": { + "evaluate": [ + { + "attribute": "latency", + "operator": "lte", + "threshold": { + "get_param": "latency" + }, + "unit": "ms" + }, + { + "attribute": "reliability", + "operator": "gte", + "threshold": { + "get_param": "reliability" + }, + "unit": "" + } + ] + }, + "type": "threshold" + } + }, + "demands": { + "URLLC": [ + { + "default_attributes": { + "creation_cost": 0.1 + }, + "filtering_attributes": { + "service-function": "shared", + "model-invariant-id": "21d57d4b-52ad-4d3c-a798-248b5bb9124a", + "model-version-id": "637762da-0764-43cc-8b9a-535085770821", + "service-role": "nsi" + }, + "inventory_provider": "aai", + "inventory_type": "nsi", + "unique": "true" + }, + { + "default_attributes": { + "creation_cost": 0.9 + }, + "filtering_attributes": { + "service_profile": { + "latency": {"value": {"get_param": "latency"}, "operator": "lte"}, + "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"} + }, + "subnets":{ + "core": { + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "core_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "core_reliability" + } + ] + } + }, + "ran": { + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "ran_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "ran_reliability" + } + ] + } + }, + "transport": { + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "tn_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "tn_reliability" + } + ] + } + } + } + }, + "inventory_provider": "generator", + "inventory_type": "slice_profiles", + "unique": "true" + } + ] + }, + "homing_template_version": "2020-08-13", + "optimization": { + "goal": "minimize", + "operation_function": { + "operands": [ + { + "function": "attribute", + "params": { + "attribute": "creation_cost", + "demand": "URLLC" + } + } + ], + "operator": "sum" + } + }, + "parameters": { + "core_latency": 10, + "core_reliability": 99.9, + "latency": 30, + "ran_latency": 7, + "ran_reliability": 99.9, + "reliability": 99.9, + "tn_latency": 10, + "tn_reliability": 99.9 + } + }, + "timeout": 1200 +} diff --git a/csit/tests/has/data/nsi_selection_template_with_reuse.json b/csit/tests/has/data/nsi_selection_template_with_reuse.json new file mode 100644 index 0000000..3cce5f9 --- /dev/null +++ b/csit/tests/has/data/nsi_selection_template_with_reuse.json @@ -0,0 +1,152 @@ +{ + "files": {}, + "limit": 10, + "name": "urllc_sample", + "num_solution": "1", + "template": { + "constraints": { + "URLLC_Threshold": { + "demands": [ + "URLLC" + ], + "properties": { + "evaluate": [ + { + "attribute": "latency", + "operator": "lte", + "threshold": { + "get_param": "latency" + }, + "unit": "ms" + }, + { + "attribute": "reliability", + "operator": "gte", + "threshold": { + "get_param": "reliability" + }, + "unit": "" + } + ] + }, + "type": "threshold" + } + }, + "demands": { + "URLLC": [ + { + "default_attributes": { + "creation_cost": 0.1 + }, + "filtering_attributes": { + "service-function": "shared", + "model-invariant-id": "21d57d4b-52ad-4d3c-a798-248b5bb9124a", + "model-version-id": "bfba363e-e39c-4bd9-a9d5-1371c28f4d22", + "service-role": "nsi" + }, + "inventory_provider": "aai", + "inventory_type": "nsi", + "unique": "true" + }, + { + "default_attributes": { + "creation_cost": 0.9 + }, + "filtering_attributes": { + "service_profile": { + "latency": {"value": {"get_param": "latency"}, "operator": "lte"}, + "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"} + }, + "subnets":{ + "core": { + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "core_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "core_reliability" + } + ] + } + }, + "ran": { + + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "ran_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "ran_reliability" + } + ] + } + }, + "transport": { + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "tn_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "tn_reliability" + } + ] + } + } + } + }, + "inventory_provider": "generator", + "inventory_type": "slice_profiles", + "unique": "true" + } + ] + }, + "homing_template_version": "2020-08-13", + "optimization": { + "goal": "minimize", + "operation_function": { + "operands": [ + { + "function": "attribute", + "params": { + "attribute": "creation_cost", + "demand": "URLLC" + } + } + ], + "operator": "sum" + } + }, + "parameters": { + "core_latency": 10, + "core_reliability": 99.9, + "latency": 30, + "ran_latency": 7, + "ran_reliability": 99.9, + "reliability": 99.9, + "tn_latency": 10, + "tn_reliability": 99.9 + } + }, + "timeout": 1200 +} diff --git a/csit/tests/has/data/nssi_selection_template.json b/csit/tests/has/data/nssi_selection_template.json new file mode 100644 index 0000000..e165694 --- /dev/null +++ b/csit/tests/has/data/nssi_selection_template.json @@ -0,0 +1,75 @@ +{ + "files": {}, + "limit": 10, + "name": "urllc_sample", + "num_solution": "1", + "timeout": 1200, + "template": { + "homing_template_version": "2020-08-13", + "parameters": { + "latency": 30, + "reliability": 99.9 + }, + "demands": { + "URLLC_core": [ + { + "default_attributes": { + "creation_cost": 0.1 + }, + "filtering_attributes": { + "service-function": "shared", + "model-invariant-id": "c343a533-c045-4ec0-bbb6-f30eb8eb5a41", + "model-version-id": "8d770214-d3e7-43ea-b7a6-9b235dcbcd34", + "service-role": "nssi" + }, + "inventory_provider": "aai", + "inventory_type": "nssi", + "unique": "true" + } + ] + }, + "constraints": { + "URLLC_Threshold": { + "demands": [ + "URLLC_core" + ], + "properties": { + "evaluate": [ + { + "attribute": "latency", + "operator": "lte", + "threshold": { + "get_param": "latency" + }, + "unit": "ms" + }, + { + "attribute": "reliability", + "operator": "gte", + "threshold": { + "get_param": "reliability" + }, + "unit": "" + } + ] + }, + "type": "threshold" + } + }, + "optimization": { + "goal": "minimize", + "operation_function": { + "operands": [ + { + "function": "attribute", + "params": { + "attribute": "latency", + "demand": "URLLC_core" + } + } + ], + "operator": "sum" + } + } + } +} diff --git a/csit/tests/has/data/nssi_selection_template_unmatched.json b/csit/tests/has/data/nssi_selection_template_unmatched.json new file mode 100644 index 0000000..23500c5 --- /dev/null +++ b/csit/tests/has/data/nssi_selection_template_unmatched.json @@ -0,0 +1,76 @@ +{ + "files": {}, + "limit": 10, + "name": "urllc_sample", + "num_solution": "1", + "timeout": 1200, + "template": { + "homing_template_version": "2020-08-13", + "parameters": { + "latency": 5, + "reliability": 99.9 + }, + "demands": { + "URLLC_core": [ + { + "default_attributes": { + "creation_cost": 0.1 + }, + "filtering_attributes": { + "service-function": "shared", + "model-invariant-id": "c343a533-c045-4ec0-bbb6-f30eb8eb5a41", + "model-version-id": "8d770214-d3e7-43ea-b7a6-9b235dcbcd34", + "service-role": "nssi" + }, + "inventory_provider": "aai", + "inventory_type": "nssi", + "unique": "true" + } + ] + }, + "constraints": { + "URLLC_Threshold": { + "demands": [ + "URLLC_core" + ], + "properties": { + "evaluate": [ + { + "attribute": "latency", + "operator": "lte", + "threshold": { + "get_param": "latency" + }, + "unit": "ms" + }, + { + "attribute": "reliability", + "operator": "gte", + "threshold": { + "get_param": "reliability" + }, + "unit": "" + } + + ] + }, + "type": "threshold" + } + }, + "optimization": { + "goal": "minimize", + "operation_function": { + "operands": [ + { + "function": "attribute", + "params": { + "attribute": "latency", + "demand": "URLLC_core" + } + } + ], + "operator": "sum" + } + } + } +} diff --git a/csit/tests/has/data/nst_selection_template.json b/csit/tests/has/data/nst_selection_template.json new file mode 100644 index 0000000..4181914 --- /dev/null +++ b/csit/tests/has/data/nst_selection_template.json @@ -0,0 +1,55 @@ +{ + "name":"urllc_sample", + "files":{ + + }, + "limit":10, + "num_solution":"1", + "timeout":1200, + "template":{ + "homing_template_version":"2020-08-13", + "demands":{ + "nst_demand":[ + { + "inventory_provider":"aai", + "inventory_type":"nst", + "unique":"true", + "region":"RegionOne", + "filtering_attributes":{ + "model-role":"nst" + } + } + ] + }, + "constraints":{ + "nst_Threshold":{ + "type":"threshold", + "demands":[ + "nst_demand" + ], + "properties":{ + "evaluate":[ + { + "attribute":"latency", + "operator":"lte", + "threshold":30, + "unit":"ms" + } + ] + } + } }, + "optimization":{ + "goal": "minimize", + "operation_function": { + "operator": "sum", + "operands": [{ + "function": "attribute", + "params": { + "demand": "nst_demand", + "attribute": "latency" + } + }] + } + } + } +} \ No newline at end of file diff --git a/csit/tests/has/data/onboard.json b/csit/tests/has/data/onboard.json new file mode 100644 index 0000000..a4939c4 --- /dev/null +++ b/csit/tests/has/data/onboard.json @@ -0,0 +1,6 @@ +{ + "appname": "conductor", + "userId": "conductor", + "isAAF": "false", + "password": "c0nduct0r" +} diff --git a/csit/tests/has/data/plan_with_hpa.json b/csit/tests/has/data/plan_with_hpa.json new file mode 100644 index 0000000..2198577 --- /dev/null +++ b/csit/tests/has/data/plan_with_hpa.json @@ -0,0 +1,260 @@ +{ + "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":[ + { + "id":"vg_1", + "type":"vnfc", + "directives":[ + { + "type": "flavor_directives", + "attributes":[ + { + "attribute_name":"flavor_label_1", + "attribute_value":"" + } + ] + } + ], + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "directives": [], + "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", + "directives": [], + "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", + "directives": [], + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"logicalCpuThreadPinningPolicy", + "hpa-attribute-value":"prefer", + "operator":"=" + }, + { + "hpa-attribute-key":"logicalCpuPinningPolicy", + "hpa-attribute-value":"dedicated", + "operator":"=" + } + ] + } + ] + }, + { + "id":"vg_2", + "type":"vnfc", + "directives":[ + { + "type":"flavor_directives", + "attributes":[ + { + "attribute_name":"flavor_label_2", + "attribute_value":"" + } + ] + } + ], + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "directives":[], + "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", + "directives":[], + "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", + "directives":[], + "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/csit/tests/has/data/plan_with_hpa_requirements_mandatory.json b/csit/tests/has/data/plan_with_hpa_requirements_mandatory.json new file mode 100644 index 0000000..bb613ab --- /dev/null +++ b/csit/tests/has/data/plan_with_hpa_requirements_mandatory.json @@ -0,0 +1,193 @@ +{ + "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":[ + { + "id":"vg_1", + "type":"vnfc", + "directives":[ + { + "type":"flavor_directives", + "attributes":[ + { + "attribute_name":"flavor_label_1", + "attribute_value":"" + } + ] + } + ], + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "directives":[], + "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", + "directives":[], + "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" + } + ] + } + ] + }, + { + "id":"vg_2", + "type":"vnfc", + "directives":[ + { + "type":"flavor_directives", + "attributes":[ + { + "attribute_name":"flavor_label_2", + "attribute_value":"" + } + ] + } + ], + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "directives":[], + "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", + "directives":[], + "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/csit/tests/has/data/plan_with_hpa_requirements_optionals.json b/csit/tests/has/data/plan_with_hpa_requirements_optionals.json new file mode 100644 index 0000000..50c23ee --- /dev/null +++ b/csit/tests/has/data/plan_with_hpa_requirements_optionals.json @@ -0,0 +1,247 @@ +{ + "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":[ + { + "id":"vg_1", + "type":"vnfc", + "directives":[ + { + "type":"flavor_directives", + "attributes":[ + { + "attribute_name":"flavor_label_1", + "attribute_value":"" + } + ] + } + ], + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "directives":[], + "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", + "directives":[], + "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", + "directives":[], + "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" + } + ] + } + ] + }, + { + "id":"vg_2", + "type":"vnfc", + "directives":[ + { + "type":"flavor_directives", + "attributes":[ + { + "attribute_name":"flavor_label_2", + "attribute_value":"" + } + ] + } + ], + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "directives":[], + "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", + "directives":[], + "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", + "directives":[], + "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/csit/tests/has/data/plan_with_hpa_score_multi_objective.json b/csit/tests/has/data/plan_with_hpa_score_multi_objective.json new file mode 100644 index 0000000..4a6d3bc --- /dev/null +++ b/csit/tests/has/data/plan_with_hpa_score_multi_objective.json @@ -0,0 +1,267 @@ +{ + "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": [ + { + "id":"vg_1", + "type":"vnfc", + "directives":[ + { + "type":"flavor_directives", + "attributes":[ + { + "attribute_name":"flavor_label_1", + "attribute_value":"" + } + ] + } + ], + "flavorProperties": [ + { + "hpa-feature": "basicCapabilities", + "hpa-version": "v1", + "architecture": "generic", + "mandatory": "True", + "directives":[], + "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", + "directives":[], + "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", + "directives":[], + "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" + } + ] + } + ] + }, + { + "id":"vg_2", + "type":"vnfc", + "directives":[ + { + "type":"flavor_directives", + "attributes":[ + { + "attribute_name":"flavor_label_2", + "attribute_value":"" + } + ] + } + ], + "flavorProperties": [ + { + "hpa-feature": "basicCapabilities", + "hpa-version": "v1", + "architecture": "generic", + "mandatory": "True", + "directives":[], + "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", + "directives":[], + "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", + "directives":[], + "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": [ + { + "product": [ + 100, + { + "distance_between": [ + "customer_loc", + "vG" + ] + } + ] + }, + { + "product": [ + 200, + { + "hpa_score": [ + "vG" + ] + } + ] + } + ] + } + } + }, + "timeout": 5, + "limit": 3 +} diff --git a/csit/tests/has/data/plan_with_hpa_simple.json b/csit/tests/has/data/plan_with_hpa_simple.json new file mode 100644 index 0000000..d343dc8 --- /dev/null +++ b/csit/tests/has/data/plan_with_hpa_simple.json @@ -0,0 +1,156 @@ +{ + "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":[ + { + "id":"vg_1", + "type":"vnfc", + "directives":[ + { + "type":"flavor_directives", + "attributes":[ + { + "attribute_name":"flavor_label_1", + "attribute_value":"" + } + ] + } + ], + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "directives":[], + "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", + "directives":[], + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"dataProcessingAccelerationLibrary", + "hpa-attribute-value":"v18.02", + "operator":"=" + } + ] + } + ] + }, + { + "id":"vg_2", + "type":"vnfc", + "directives":[ + { + "type":"flavor_directives", + "attributes":[ + { + "attribute_name":"flavor_label_2", + "attribute_value":"" + } + ] + } + ], + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "directives":[], + "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/csit/tests/has/data/plan_with_hpa_unmatched.json b/csit/tests/has/data/plan_with_hpa_unmatched.json new file mode 100644 index 0000000..e95eced --- /dev/null +++ b/csit/tests/has/data/plan_with_hpa_unmatched.json @@ -0,0 +1,143 @@ +{ + "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":[ + { + "id":"vg_1", + "type":"vnfc", + "directives":[ + { + "type":"flavor_directives", + "attributes":[ + { + "attribute_name":"flavor_label_1", + "attribute_value":"" + } + ] + } + ], + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "directives":[], + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"60", + "operator":"=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"64", + "operator":"=", + "unit":"GB" + } + ] + } + ] + }, + { + "id":"vg_2", + "type":"vnfc", + "directives":[ + { + "type":"flavor_directives", + "attributes":[ + { + "attribute_name":"flavor_label_2", + "attribute_value":"" + } + ] + } + ], + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory":"True", + "directives":[], + "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/csit/tests/has/data/plan_with_lati_and_longi.json b/csit/tests/has/data/plan_with_lati_and_longi.json new file mode 100644 index 0000000..5e35d6a --- /dev/null +++ b/csit/tests/has/data/plan_with_lati_and_longi.json @@ -0,0 +1,41 @@ +{ + "name":"onap template with lati and longi without constraints and without optimizations", + "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, + "physical_location":"DLLSTX233", + "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":{ + + }, + "optimization":{ + + } + } +} + diff --git a/csit/tests/has/data/plan_with_short_distance_constraint.json b/csit/tests/has/data/plan_with_short_distance_constraint.json new file mode 100644 index 0000000..68a7e11 --- /dev/null +++ b/csit/tests/has/data/plan_with_short_distance_constraint.json @@ -0,0 +1,64 @@ +{ + "name":"onap template with short distance constraint", + "template":{ + "homing_template_version":"2017-10-10", + "parameters":{ + "service_name":"Residential vCPE", + "service_id":"vcpe_service_id", + "customer_lat":25.395968, + "customer_long":-51.135344, + "physical_location":"DLLSTX233", + "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":{ + "distance-vg":{ + "type":"distance_to_location", + "demands":[ + "vG" + ], + "properties":{ + "distance":"< 1 km", + "location":"customer_loc" + } + } + }, + "optimization":{ + "minimize": { + "sum": [ + { + "distance_between": [ + "customer_loc", + "vG" + ] + }, + { + "distance_between": [ + "customer_loc", + "vG" + ] + } + ] + } + } + } +} diff --git a/csit/tests/has/data/plan_with_vim_fit.json b/csit/tests/has/data/plan_with_vim_fit.json new file mode 100644 index 0000000..00a5991 --- /dev/null +++ b/csit/tests/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/csit/tests/has/data/plan_with_wrong_distance_constraint.json b/csit/tests/has/data/plan_with_wrong_distance_constraint.json new file mode 100644 index 0000000..9f25c2d --- /dev/null +++ b/csit/tests/has/data/plan_with_wrong_distance_constraint.json @@ -0,0 +1,63 @@ +{ + "name":"onap template with wrong distance constraint", + "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, + "physical_location":"DLLSTX233", + "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":{ + "distance-vg":{ + "demands":[ + "vG" + ], + "properties":{ + "distance":"< 1 km", + "location":"customer_loc" + } + } + }, + "optimization":{ + "minimize": { + "sum": [ + { + "distance_between": [ + "customer_loc", + "vG" + ] + }, + { + "distance_between": [ + "customer_loc", + "vG" + ] + } + ] + } + } + } +} diff --git a/csit/tests/has/data/plan_with_wrong_version.json b/csit/tests/has/data/plan_with_wrong_version.json new file mode 100644 index 0000000..c0618bf --- /dev/null +++ b/csit/tests/has/data/plan_with_wrong_version.json @@ -0,0 +1,41 @@ +{ + "name":"onap template with wrong version", + "template":{ + "homing_template_version":"xxxx-yy-zz", + "parameters":{ + "service_name":"Residential vCPE", + "service_id":"vcpe_service_id", + "customer_lat":45.395968, + "customer_long":-71.135344, + "physical_location":"DLLSTX233", + "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":{ + + }, + "optimization":{ + + } + } +} + diff --git a/csit/tests/has/data/plan_without_demand_section.json b/csit/tests/has/data/plan_without_demand_section.json new file mode 100644 index 0000000..fe5d2fa --- /dev/null +++ b/csit/tests/has/data/plan_without_demand_section.json @@ -0,0 +1,33 @@ +{ + "name":"onap template without demand section", + "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, + "physical_location":"DLLSTX233", + "REQUIRED_MEM":4, + "REQUIRED_DISK":100, + "pnf_id":"some_pnf_id" + }, + "locations":{ + "customer_loc":{ + "latitude":{ + "get_param":"customer_lat" + }, + "longitude":{ + "get_param":"customer_long" + } + } + }, + "constraints":{ + + }, + "optimization":{ + + } + } +} + diff --git a/csit/tests/has/optf_has_test.robot b/csit/tests/has/optf_has_test.robot new file mode 100644 index 0000000..6085bce --- /dev/null +++ b/csit/tests/has/optf_has_test.robot @@ -0,0 +1,726 @@ +*** Settings *** +Library OperatingSystem +Library RequestsLibrary +Library json + +*** Variables *** +${MESSAGE} {"ping": "ok"} +${BASIC} Basic +${Music_AUTHVALUE} Y29uZHVjdG9yOmMwbmR1Y3Qwcg== +${HAS_AUTHVALUE} YWRtaW4xOnBsYW4uMTU= +${Music_Auth} ${BASIC} ${Music_AUTHVALUE} +${HAS_Auth} ${BASIC} ${HAS_AUTHVALUE} +${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} +${generatedAID} +${resultStatus} + +*** Test Cases *** +Check Cassandra Docker Container + [Documentation] It checks cassandra docker container is running + ${rc} ${output}= Run and Return RC and Output docker ps + Log To Console ********************* + Log To Console retrurn_code = ${rc} + Log To Console output = ${output} + Should Be Equal As Integers ${rc} 0 + Should Contain ${output} music-db + +Check Zookeeper Docker Container + [Documentation] It checks zookeeper docker container is running + ${rc} ${output}= Run and Return RC and Output docker ps + Log To Console ********************* + Log To Console retrurn_code = ${rc} + Log To Console output = ${output} + Should Be Equal As Integers ${rc} 0 + Should Contain ${output} music-zk + +Check Tomcat Docker Container + [Documentation] It checks tomcat docker container is running + ${rc} ${output}= Run and Return RC and Output docker ps + Log To Console ********************* + Log To Console retrurn_code = ${rc} + Log To Console output = ${output} + Should Be Equal As Integers ${rc} 0 + Should Contain ${output} music-tomcat + +Check Music War Docker Container + [Documentation] It checks music.war docker container is running + ${rc} ${output}= Run and Return RC and Output docker ps + Log To Console ********************* + Log To Console retrurn_code = ${rc} + Log To Console output = ${output} + Should Be Equal As Integers ${rc} 0 + Should Contain ${output} music-war + +Get Music Version + [Documentation] It sends a REST GET request to retrieve the Music.war version + Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json + ${resp}= Get Request musicaas /MUSIC/rest/v2/version 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 + +Check ConductorApi Docker Container + [Documentation] It checks conductor-api docker container is running + ${rc} ${output}= Run and Return RC and Output docker ps + Log To Console ********************* + Log To Console retrurn_code = ${rc} + Log To Console output = ${output} + Should Be Equal As Integers ${rc} 0 + Should Contain ${output} cond-api + +Check ConductorController Docker Container + [Documentation] It checks conductor-controller docker container is running + ${rc} ${output}= Run and Return RC and Output docker ps + Log To Console ********************* + Log To Console retrurn_code = ${rc} + Log To Console output = ${output} + Should Be Equal As Integers ${rc} 0 + Should Contain ${output} cond-cont + +Check ConductorSolver Docker Container + [Documentation] It checks conductor-solver docker container is running + ${rc} ${output}= Run and Return RC and Output docker ps + Log To Console ********************* + Log To Console retrurn_code = ${rc} + Log To Console output = ${output} + Should Be Equal As Integers ${rc} 0 + Should Contain ${output} cond-solv + +Check ConductorReservation Docker Container + [Documentation] It checks conductor-reservation docker container is running + ${rc} ${output}= Run and Return RC and Output docker ps + Log To Console ********************* + Log To Console retrurn_code = ${rc} + Log To Console output = ${output} + Should Be Equal As Integers ${rc} 0 + Should Contain ${output} cond-resv + +Check ConductorData Docker Container + [Documentation] It checks conductor-data docker container is running + ${rc} ${output}= Run and Return RC and Output docker ps + Log To Console ********************* + Log To Console retrurn_code = ${rc} + Log To Console output = ${output} + Should Be Equal As Integers ${rc} 0 + Should Contain ${output} cond-data + +Get Root Url + [Documentation] It sends a REST GET request to root url + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json + ${resp}= Get Request optf-cond / 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 + Sleep 10s Wait For 10 seconds + +Conductor AddHealthcheck Row Into Music + [Documentation] It sends a REST PUT request to Music to inject healthcheck plan + Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}healthcheck.json + &{headers}= Create Dictionary ns=conductor Authorization=${Music_Auth} userId=conductor password=c0nduct0r Content-Type=application/json Accept=application/json + ${resp}= Put Request musicaas /MUSIC/rest/v2/keyspaces/conductor/tables/plans/rows?id=healthcheck data=${data} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + Log To Console body = ${resp.text} + ${response_json} json.loads ${resp.content} + Should Be Equal As Integers ${resp.status_code} 200 + Sleep 5s Wait Injection effectiveness + +Healthcheck + [Documentation] It sends a REST GET request to healthcheck url + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json + ${resp}= Get Request optf-cond /v1/plans/healthcheck 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 + +SendPlanWithWrongVersion + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_wrong_version.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 10s Wait Plan Resolution + +GetPlanWithWrongVersion + [Documentation] It sends a REST GET request to capture error + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 error ${resultStatus} + +SendPlanWithoutDemandSection + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_without_demand_section.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 10s Wait Plan Resolution + +GetPlanWithoutDemandSection + [Documentation] It sends a REST GET request to capture error + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 error ${resultStatus} + +SendPlanWithWrongConstraint + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_wrong_distance_constraint.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 10s Wait Plan Resolution + +GetPlanWithWrongConstraint + [Documentation] It sends a REST GET request to capture error + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 error ${resultStatus} + + +SendPlanWithLatiAndLongi + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_lati_and_longi.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 + +GetPlanWithLatiAndLongi + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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} + +SendPlanWithShortDistanceConstraint + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_short_distance_constraint.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 + +GetPlanWithShortDistanceConstraint + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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} + +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 Authorization=${HAS_Auth} 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 Authorization=${HAS_Auth} 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 Authorization=${HAS_Auth} 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 Authorization=${HAS_Auth} 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 Authorization=${HAS_Auth} 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 Authorization=${HAS_Auth} 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 Authorization=${HAS_Auth} 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 Authorization=${HAS_Auth} 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 Authorization=${HAS_Auth} 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 Authorization=${HAS_Auth} 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 Authorization=${HAS_Auth} 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 Authorization=${HAS_Auth} 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} + +# HPA Score Multi objective Optimization +SendPlanWithHpaScoreMultiObj + [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_score_multi_objective.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 + +GetPlanWithHpaScoreMultiObj + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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']} + ${vim-id}= Convert To String ${response_json['plans'][0]['recommendations'][0]['vG']['candidate']['vim-id']} + # ${hpa_score}= Convert To String ${response_json['plans'][0]['recommendations']['vG']['hpa_score']} + 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} + Should Be Equal HPA-cloud_cloud-region-1 ${vim-id} + +# NSI selection template +SendPlanWithNsiSelection + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}nsi_selection_template_with_reuse.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 + +GetPlanWithNsiSelection + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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']} + ${instance_name}= Convert To String ${response_json['plans'][0]['recommendations'][0]['URLLC']['candidate']['instance_name']} + 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} + Should Be Equal nsi_test_0211 ${instance_name} + +SendPlanWithNsiSelectionSliceProfile + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}nsi_selection_template_with_create.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 + +GetPlanWithNsiSelectionSliceProfile + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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']} + ${candidate_type}= Convert To String ${response_json['plans'][0]['recommendations'][0]['URLLC']['candidate']['inventory_type']} + 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} + Should Be Equal slice_profiles ${candidate_type} + +SendPlanWithNoNsi + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}nsi_selection_template_with_nonsi.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 + +GetPlanWithNoNsi + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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']} + ${candidate_type}= Convert To String ${response_json['plans'][0]['recommendations'][0]['URLLC']['candidate']['inventory_type']} + 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} + Should Be Equal slice_profiles ${candidate_type} + +SendPlanWithNssiSelection + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}nssi_selection_template.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 + +GetPlanWithNssiSelection + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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']} + ${instance_name}= Convert To String ${response_json['plans'][0]['recommendations'][0]['URLLC_core']['candidate']['instance_name']} + 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} + Should Be Equal nssi_test_0211 ${instance_name} + +SendPlanWithNssiSelectionUnmatched + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}nssi_selection_template_unmatched.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 + +GetPlanWithNssiSelectionUnmatched + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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} + +# NST selection template +SendPlanWithNSTSelection + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}nst_selection_template.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 + +GetPlanWithNsTSelection + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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']} + ${instance_name}= Convert To String ${response_json['plans'][0]['recommendations'][0]['nst_demand']['candidate']['model_name']} + 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} + Should Be Equal EmbbNst ${instance_name} + + +*** Keywords *** + + -- cgit 1.2.3-korg