diff options
Diffstat (limited to 'test/csit')
123 files changed, 3588 insertions, 142 deletions
diff --git a/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/docker-compose.yml b/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/docker-compose.yml new file mode 100644 index 000000000..66cbde22f --- /dev/null +++ b/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/docker-compose.yml @@ -0,0 +1,78 @@ +version: "3" + +networks: + ves-hv-default: + external: + name: $CONTAINERS_NETWORK + +services: + zookeeper: + image: wurstmeister/zookeeper + ports: + - "2181:2181" + networks: + - ves-hv-default + + kafka: + image: wurstmeister/kafka + ports: + - "9092:9092" + environment: + KAFKA_ADVERTISED_HOST_NAME: "kafka" + KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true' + KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181" + KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka:9092" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + depends_on: + - zookeeper + networks: + - ves-hv-default + + consul: + image: progrium/consul + ports: + - "8500:8500" + environment: + - CONSUL_BIND_INTERFACE=eth0 + networks: + ves-hv-default: + aliases: + - consul + command: ["-server", "-bootstrap"] + + ves-hv-collector: + image: $DOCKER_REGISTRY/onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-main:latest + ports: + - "6060:6060" + - "6061:6061/tcp" + entrypoint: ["java", "-Dio.netty.leakDetection.level=paranoid", "-cp", "*:", "org.onap.dcae.collectors.veshv.main.MainKt"] + command: ["--listen-port", "6061","--config-url", "http://consul:8500/v1/kv/veshv-config"] + healthcheck: + interval: 10s + timeout: 5s + retries: 2 + test: "curl --request GET --fail --silent --show-error localhost:6060/health/ready && nc -vz localhost 6061" + depends_on: + - kafka + volumes: + - ./ssl/:/etc/ves-hv/ + networks: + - ves-hv-default + + dcae-app-simulator: + image: $DOCKER_REGISTRY/onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-dcae-app-simulator:latest + ports: + - "6063:6063/tcp" + command: ["--listen-port", "6063", "--kafka-bootstrap-servers", "kafka:9092", "--kafka-topics", "ves_hvRanMeas"] + healthcheck: + interval: 10s + timeout: 5s + retries: 2 + test: "curl --request GET --fail --silent --show-error localhost:6063/healthcheck" + depends_on: + - kafka + networks: + ves-hv-default: + aliases: + - dcae-app-simulator
\ No newline at end of file diff --git a/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/setup.sh b/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/setup.sh new file mode 100755 index 000000000..6b527fc22 --- /dev/null +++ b/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/setup.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +set -euo pipefail + +pip uninstall -y docker-py +pip install docker + +COMPOSE_VERSION=1.22.0 +COMPOSE_LOCATION='/usr/local/bin/docker-compose' +sudo curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m) -o ${COMPOSE_LOCATION} +sudo chmod +x ${COMPOSE_LOCATION} + + +echo "Removing not used docker networks" +docker network prune -f + +export CONTAINERS_NETWORK=ves-hv-default +echo "Creating network for containers: ${CONTAINERS_NETWORK}" +docker network create ${CONTAINERS_NETWORK} + +cd ssl +make FILE=client +make FILE=server +make FILE=invalid_client CA=invalid_trust +cd .. + +export DOCKER_REGISTRY="nexus3.onap.org:10001" +docker-compose up -d + +mkdir ${WORKSPACE}/archives/containers_logs + +export ROBOT_VARIABLES="--pythonpath ${WORKSPACE}/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries"
\ No newline at end of file diff --git a/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/ssl/Makefile b/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/ssl/Makefile new file mode 100644 index 000000000..5fddc6b1d --- /dev/null +++ b/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/ssl/Makefile @@ -0,0 +1,32 @@ +FILE=sample +CA_PASSWD=onap +SUBJ=/C=PL/ST=DL/L=Wroclaw/O=Nokia/OU=MANO +CA=trust + +sign: $(FILE).crt + +clean: + rm -f *.crt *.key *.srl *.csr + +generate-ca-certificate: $(CA).crt + +generate-private-key: $(FILE).key + +create-public-key: $(FILE).pub + +create-sign-request: $(FILE).csr + +$(CA).crt: + openssl req -new -x509 -keyout $(CA).key -out $(CA).crt -days 365 -passout pass:$(CA_PASSWD) -subj "$(SUBJ)" + +$(FILE).key: + openssl genpkey -algorithm RSA -out $(FILE).key -pkeyopt rsa_keygen_bits:2048 + +$(FILE).pub: $(FILE).key + openssl x509 -req -days 360 -in client.csr -CA $(CA).crt -CAkey $(CA).key -CAcreateserial -out client.crt + +$(FILE).csr: $(FILE).key + openssl req -new -sha256 -key $(FILE).key -out $(FILE).csr -subj "$(SUBJ)" + +$(FILE).crt: $(CA).crt $(FILE).csr + openssl x509 -req -days 360 -in $(FILE).csr -CA $(CA).crt -CAkey $(CA).key -out $(FILE).crt -CAcreateserial -passin pass:$(CA_PASSWD)
\ No newline at end of file diff --git a/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/ssl/README.md b/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/ssl/README.md new file mode 100644 index 000000000..174c16641 --- /dev/null +++ b/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/ssl/README.md @@ -0,0 +1,18 @@ +# Generating SSL certificates + +Typical usage: + +```shell +make FILE=client +make FILE=server +``` + +Will generate CA certificate and signed client and server certificates. + +More "low-level" usage: + +```shell +make generate-ca-certificate +make generate-private-key FILE=client +make sign FILE=client +``` diff --git a/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/teardown.sh b/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/teardown.sh new file mode 100755 index 000000000..84d36667e --- /dev/null +++ b/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/teardown.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +cd ssl +make clean +cd .. + +docker-compose logs > ${WORKSPACE}/archives/containers_logs/docker-compose.log +docker-compose down +docker-compose rm -f + +docker network rm ${CONTAINERS_NETWORK}
\ No newline at end of file diff --git a/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/testplan.txt b/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/testplan.txt new file mode 100644 index 000000000..e9a7f6366 --- /dev/null +++ b/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/testplan.txt @@ -0,0 +1,4 @@ +# Test suites are relative paths under [integration.git]/test/csit/tests/. +# Place the suites in run order. +dcaegen2-collectors-hv-ves/testcases + diff --git a/test/csit/plans/dcaegen2/prh-testsuites/setup.sh b/test/csit/plans/dcaegen2/prh-testsuites/setup.sh index 058ed20bd..a5ce48b52 100644 --- a/test/csit/plans/dcaegen2/prh-testsuites/setup.sh +++ b/test/csit/plans/dcaegen2/prh-testsuites/setup.sh @@ -9,6 +9,9 @@ export AAI_SIMULATOR="aai_simulator" cd ${WORKSPACE}/test/csit/tests/dcaegen2/prh-testcases/resources/ docker login -u docker -p docker nexus3.onap.org:10001 +pip uninstall -y docker-py +pip uninstall -y docker +pip install -U docker docker-compose up -d --build # Wait for initialization of Docker containers @@ -37,7 +40,7 @@ echo PRH_IP=${PRH_IP} echo DMAAP_SIMULATOR_IP=${DMAAP_SIMULATOR_IP} echo AAI_SIMULATOR_IP=${AAI_SIMULATOR_IP} -# Wait for initialization of docker services +# Wait for initialization of PRH services for i in {1..10}; do curl -sS -m 1 localhost:8100/heartbeat && break echo sleep ${i} @@ -53,5 +56,3 @@ docker start prh # #Pass any variables required by Robot test suites in ROBOT_VARIABLES ROBOT_VARIABLES="-v DMAAP_SIMULATOR:${DMAAP_SIMULATOR_IP}:2222 -v AAI_SIMULATOR:${AAI_SIMULATOR_IP}:3333 -v PRH:${PRH_IP}:8100" - -pip install docker==2.7.0 diff --git a/test/csit/plans/dmaap-buscontroller/ssl/setup.sh b/test/csit/plans/dmaap-buscontroller/ssl/setup.sh new file mode 100755 index 000000000..e40f62dea --- /dev/null +++ b/test/csit/plans/dmaap-buscontroller/ssl/setup.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# +# ============LICENSE_START======================================================= +# org.onap.dmaap +# ================================================================================ +# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# 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. +# ============LICENSE_END========================================================= +# +# + + +# Place the scripts in run order: +source ${WORKSPACE}/test/csit/scripts/dmaap-buscontroller/start-mock.sh +start_mock "aaf" +AAF_IP=${IP} +start_mock "mrc" 3905 +MRC_IP=${IP} +start_mock "drps" 8443 +DRPS_IP=${IP} + +source ${WORKSPACE}/test/csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh +dmaapbc_launch $AAF_IP $MRC_IP $DRPS_IP +DMAAPBC_IP=${IP} + + +echo "AAF_IP=$AAF_IP MRC_IP=$MRC_IP DRPS_IP=$DRPS_IP DMAAPBC_IP=$DMAAPBC_IP" + +# Pass any variables required by Robot test suites in ROBOT_VARIABLES +ROBOT_VARIABLES="-v AAF_IP:${AAF_IP} -v MRC_IP:${MRC_IP} -v DRPS_IP:${DRPS_IP} -v DMAAPBC_IP:${DMAAPBC_IP}" + +set -x +${WORKSPACE}/test/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh ${DMAAPBC_IP} ${DRPS_IP} ${MRC_IP} https +set +x diff --git a/test/csit/plans/dmaap-buscontroller/ssl/teardown.sh b/test/csit/plans/dmaap-buscontroller/ssl/teardown.sh new file mode 100644 index 000000000..1b041a425 --- /dev/null +++ b/test/csit/plans/dmaap-buscontroller/ssl/teardown.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# ============LICENSE_START======================================================= +# org.onap.dmaap +# ================================================================================ +# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# 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. +# ============LICENSE_END========================================================= +# +# +kill-instance.sh aaf-mock +kill-instance.sh drps-mock +kill-instance.sh mrc-mock +kill-instance.sh dmaapbc + diff --git a/test/csit/plans/dmaap-buscontroller/ssl/testplan.txt b/test/csit/plans/dmaap-buscontroller/ssl/testplan.txt new file mode 100644 index 000000000..e106e7b66 --- /dev/null +++ b/test/csit/plans/dmaap-buscontroller/ssl/testplan.txt @@ -0,0 +1,4 @@ +# Test suites are relative paths under [integration.git]/test/csit/tests/. +# Place the suites in run order. +dmaap-buscontroller/ssl_suite + diff --git a/test/csit/plans/dmaap-buscontroller/with_dr/setup.sh b/test/csit/plans/dmaap-buscontroller/with_dr/setup.sh new file mode 100755 index 000000000..7cefa7270 --- /dev/null +++ b/test/csit/plans/dmaap-buscontroller/with_dr/setup.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# +# ============LICENSE_START======================================================= +# org.onap.dmaap +# ================================================================================ +# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# 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. +# ============LICENSE_END========================================================= +# +# + +source ${SCRIPTS}/common_functions.sh + + +if [ "$USE_EXISTING_DMAAP" = "Y" ] +then + ROBOT_VARIABLES="-v AAF_IP:0.0.0 -v MRC_IP:0.0.0.0 -v DRPS_IP:172.17.0.3 -v DMAAPBC_IP:172.17.0.4" +else + + # Place the scripts in run order: + source ${WORKSPACE}/test/csit/scripts/dmaap-buscontroller/dr-launch.sh + dmaap_dr_launch + DRPS_IP=${IP} + + #source ${WORKSPACE}/test/csit/scripts/dmaap-buscontroller/start-mock.sh + #start_mock "aaf" + #AAF_IP=${IP} + AAF_IP=0.0.0.0 + #start_mock "drps" + #DRPS_IP=${IP} + MRC_IP=0.0.0.0 + + source ${WORKSPACE}/test/csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh + dmaapbc_launch $AAF_IP $MRC_IP $DRPS_IP + DMAAPBC_IP=${IP} + + + echo "AAF_IP=$AAF_IP MRC_IP=$MRC_IP DRPS_IP=$DRPS_IP DMAAPBC_IP=$DMAAPBC_IP" + + # Pass any variables required by Robot test suites in ROBOT_VARIABLES + ROBOT_VARIABLES="-v AAF_IP:${AAF_IP} -v MRC_IP:${MRC_IP} -v DRPS_IP:${DRPS_IP} -v DMAAPBC_IP:${DMAAPBC_IP}" + set -x + ${WORKSPACE}/test/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh ${DMAAPBC_IP} ${DRPS_IP} ${MRC_IP} https + set +x +fi + diff --git a/test/csit/plans/dmaap-buscontroller/with_dr/teardown.sh b/test/csit/plans/dmaap-buscontroller/with_dr/teardown.sh new file mode 100755 index 000000000..23ae60a10 --- /dev/null +++ b/test/csit/plans/dmaap-buscontroller/with_dr/teardown.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# ============LICENSE_START======================================================= +# org.onap.dmaap +# ================================================================================ +# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# 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. +# ============LICENSE_END========================================================= + +if [ "$KEEP_DMAAP" != "Y" ] +then +kill-instance.sh dmaapbc +cd $WORKSPACE/archives/dmaapdr/datarouter/docker-compose/ +docker-compose down -v +fi diff --git a/test/csit/plans/dmaap-buscontroller/with_dr/testplan.txt b/test/csit/plans/dmaap-buscontroller/with_dr/testplan.txt new file mode 100755 index 000000000..04c6838d4 --- /dev/null +++ b/test/csit/plans/dmaap-buscontroller/with_dr/testplan.txt @@ -0,0 +1,2 @@ +# Place the suites in run order. +dmaap-buscontroller/with_dr diff --git a/test/csit/plans/dmaap-buscontroller/with_mr/setup.sh b/test/csit/plans/dmaap-buscontroller/with_mr/setup.sh index 3b604fe99..bcd19b5ac 100755 --- a/test/csit/plans/dmaap-buscontroller/with_mr/setup.sh +++ b/test/csit/plans/dmaap-buscontroller/with_mr/setup.sh @@ -31,9 +31,9 @@ else MRC_IP=${IP} source ${WORKSPACE}/test/csit/scripts/dmaap-buscontroller/start-mock.sh - #start_mock "aaf" - #AAF_IP=${IP} - AAF_IP=0.0.0.0 + start_mock "aaf" + AAF_IP=${IP} + #AAF_IP=0.0.0.0 #start_mock "drps" #DRPS_IP=${IP} DRPS_IP=0.0.0.0 diff --git a/test/csit/plans/dmaap-buscontroller/with_mr/teardown.sh b/test/csit/plans/dmaap-buscontroller/with_mr/teardown.sh index f35b02259..3feebe07c 100644 --- a/test/csit/plans/dmaap-buscontroller/with_mr/teardown.sh +++ b/test/csit/plans/dmaap-buscontroller/with_mr/teardown.sh @@ -25,5 +25,6 @@ if [ "$KEEP_DMAAP" != "Y" ] then dmaap_mr_teardown kill-instance.sh dmaapbc +kill-instance.sh aaf-mock fi diff --git a/test/csit/plans/dmaap-datarouter/dr-suite/setup.sh b/test/csit/plans/dmaap-datarouter/dr-suite/setup.sh new file mode 100755 index 000000000..e5debfc2b --- /dev/null +++ b/test/csit/plans/dmaap-datarouter/dr-suite/setup.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +source ${SCRIPTS}/common_functions.sh + +# Clone DMaaP Data Router repo +mkdir -p $WORKSPACE/archives/dmaapdr +cd $WORKSPACE/archives/dmaapdr + +git clone --depth 1 https://gerrit.onap.org/r/dmaap/datarouter -b master +cd datarouter +git pull +cd $WORKSPACE/archives/dmaapdr/datarouter/docker-compose/ + +sed -i 's/10003/10001/g' docker-compose.yml +# start DMaaP DR containers with docker compose and configuration from docker-compose.yml +docker login -u docker -p docker nexus3.onap.org:10001 +docker-compose up -d + +# Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb +for i in {1..50}; do + if [ $(docker inspect --format '{{ .State.Running }}' datarouter-node) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' datarouter-prov) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' mariadb) ] + then + echo "DR Service Running" + break + else + echo sleep $i + sleep $i + fi +done + +DR_PROV_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-prov) +DR_NODE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-node) +DR_GATEWAY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' datarouter-prov) + +echo DR_PROV_IP=${DR_PROV_IP} +echo DR_NODE_IP=${DR_NODE_IP} +echo DR_GATEWAY_IP=${DR_GATEWAY_IP} + +docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/NODES?val=dmaap-dr-node\|$DR_GATEWAY_IP" +docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$DR_GATEWAY_IP" + +#Pass any variables required by Robot test suites in ROBOT_VARIABLES +ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DR_NODE_IP:${DR_NODE_IP}" diff --git a/test/csit/plans/dmaap-datarouter/dr-suite/teardown.sh b/test/csit/plans/dmaap-datarouter/dr-suite/teardown.sh new file mode 100755 index 000000000..033a00156 --- /dev/null +++ b/test/csit/plans/dmaap-datarouter/dr-suite/teardown.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +cd $WORKSPACE/archives/dmaapdr/datarouter/docker-compose/ +docker-compose down -v diff --git a/test/csit/plans/dmaap-datarouter/dr-suite/testplan.txt b/test/csit/plans/dmaap-datarouter/dr-suite/testplan.txt new file mode 100755 index 000000000..8349a0566 --- /dev/null +++ b/test/csit/plans/dmaap-datarouter/dr-suite/testplan.txt @@ -0,0 +1,2 @@ +# Place the suites in run order. +dmaap-datarouter/dr-suite diff --git a/test/csit/plans/multicloud-pike/functionality1/setup.sh b/test/csit/plans/multicloud-pike/functionality1/setup.sh new file mode 100644 index 000000000..57e818124 --- /dev/null +++ b/test/csit/plans/multicloud-pike/functionality1/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# +# Copyright (c) 2017-2018 Intel, Inc. +# +# 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. + +pushd ${SCRIPTS} + +# start multicloud-pike +./run-instance.sh nexus3.onap.org:10001/onap/multicloud/openstack-pike:latest multicloud-pike +SERVICE_IP=$(./get-instance-ip.sh multicloud-pike) +SERVICE_PORT=9007 +popd + +if [[ $no_proxy && $no_proxy != *$SERVICE_IP* ]]; then + export no_proxy+=$no_proxy,$SERVICE_IP +fi + +for i in {1..50}; do + curl -sS ${SERVICE_IP}:${SERVICE_PORT} && break + echo sleep $i + sleep $i +done + +# Pass any variables required by Robot test suites in ROBOT_VARIABLES +ROBOT_VARIABLES+="-v SERVICE_IP:${SERVICE_IP} " +ROBOT_VARIABLES+="-v SERVICE_PORT:${SERVICE_PORT} " diff --git a/test/csit/plans/multicloud-pike/functionality1/teardown.sh b/test/csit/plans/multicloud-pike/functionality1/teardown.sh new file mode 100644 index 000000000..13b70628c --- /dev/null +++ b/test/csit/plans/multicloud-pike/functionality1/teardown.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# +# Copyright (c) 2017-2018 Intel, Inc. +# +# 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. + +# This script is sourced by run-csit.sh after Robot test completion. +kill-instance.sh multicloud-pike diff --git a/test/csit/plans/multicloud-pike/functionality1/testplan.txt b/test/csit/plans/multicloud-pike/functionality1/testplan.txt new file mode 100644 index 000000000..7f4601647 --- /dev/null +++ b/test/csit/plans/multicloud-pike/functionality1/testplan.txt @@ -0,0 +1,3 @@ +# Test suites are relative paths under [integration.git]/test/csit/tests/. +# Place the suites in run order. +multicloud-pike/provision/sanity_test_multicloud.robot diff --git a/test/csit/plans/multicloud-pike/hpa-discovery/setup.sh b/test/csit/plans/multicloud-pike/hpa-discovery/setup.sh new file mode 100644 index 000000000..cbcc302eb --- /dev/null +++ b/test/csit/plans/multicloud-pike/hpa-discovery/setup.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# +# Copyright 2018 Intel Corporation, Inc +# 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. + +cd ${SCRIPTS} + +source common_functions.sh + +generic_sim_path=${WORKSPACE}/test/csit/scripts/multicloud-pike/generic_sim +multicloud_provision_path=${WORKSPACE}/test/csit/tests/multicloud-pike/provision +# start generic simulator for openstack mock and AAI mock +if [[ -z $(docker images -q generic_sim) ]]; then + pushd $generic_sim_path + docker build -t generic_sim . + popd +fi + +function start_simulator () +{ + local service_name=$1 + local service_port=$2 + + ./run-instance.sh generic_sim $service_name "-v ${multicloud_provision_path}/${service_name}/:/tmp/generic_sim/ -v ${generic_sim_path}/${service_name}/:/etc/generic_sim/ -p $service_port:8080" + wait_for_service_init localhost:$service_port + bypass_ip_adress $service_name +} + +start_simulator nova 8774 +start_simulator glance 9292 +start_simulator cinder 8776 +start_simulator keystone 5000 +start_simulator aai 8443 + +# start multicloud-pike +./run-instance.sh nexus3.onap.org:10001/onap/multicloud/openstack-pike multicloud-pike "-t -e AAI_SERVICE_URL=http://aai:8080/aai -e no_proxy=$no_proxy -p 9007:9007" +SERVICE_IP=$(./get-instance-ip.sh multicloud-pike) +SERVICE_PORT=9007 + +docker network create hpa-net +for container in aai keystone glance cinder nova multicloud-pike; do + docker network connect hpa-net $container +done + +bypass_ip_adress $SERVICE_IP +wait_for_service_init ${SERVICE_IP}:${SERVICE_PORT} + +# Pass any variables required by Robot test suites in ROBOT_VARIABLES +ROBOT_VARIABLES+="-v SERVICE_IP:${SERVICE_IP} " +ROBOT_VARIABLES+="-v SERVICE_PORT:${SERVICE_PORT} " diff --git a/test/csit/plans/multicloud-pike/hpa-discovery/teardown.sh b/test/csit/plans/multicloud-pike/hpa-discovery/teardown.sh new file mode 100644 index 000000000..7d6c95350 --- /dev/null +++ b/test/csit/plans/multicloud-pike/hpa-discovery/teardown.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# +# Copyright 2018 Intel Corporation, Inc +# 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. + +for container in aai keystone cinder glance nova multicloud-pike; do + kill-instance.sh $container +done +docker network rm hpa-net diff --git a/test/csit/plans/multicloud-pike/hpa-discovery/testplan.txt b/test/csit/plans/multicloud-pike/hpa-discovery/testplan.txt new file mode 100644 index 000000000..5914cbbac --- /dev/null +++ b/test/csit/plans/multicloud-pike/hpa-discovery/testplan.txt @@ -0,0 +1,3 @@ +# Test suites are relative paths under [integration.git]/test/csit/tests/. +# Place the suites in run order. +multicloud-pike/provision/hpa_multicloud.robot diff --git a/test/csit/plans/music/music-test-plan/setup.sh b/test/csit/plans/music/music-test-plan/setup.sh index ddfdfc023..ce5d1085a 100755 --- a/test/csit/plans/music/music-test-plan/setup.sh +++ b/test/csit/plans/music/music-test-plan/setup.sh @@ -27,7 +27,7 @@ source ${WORKSPACE}/test/csit/scripts/music/music-scripts/music_script.sh echo "# music configuration step"; CASS_IMG=nexus3.onap.org:10001/onap/music/cassandra_music:latest -TOMCAT_IMG=nexus3.onap.org:10001/library/tomcat:8.0 +TOMCAT_IMG=nexus3.onap.org:10001/library/tomcat:8.5 ZK_IMG=nexus3.onap.org:10001/library/zookeeper:3.4 MUSIC_IMG=nexus3.onap.org:10001/onap/music/music:latest WORK_DIR=/tmp/music @@ -38,6 +38,8 @@ MUSIC_PROPERTIES=/tmp/music/properties MUSIC_LOGS=/tmp/music/logs mkdir -p ${MUSIC_PROPERTIES} mkdir -p ${MUSIC_LOGS} +mkdir -p ${MUSIC_LOGS}/MUSIC + cp ${MUSIC_SOURCE_PROPERTIES}/* ${WORK_DIR}/properties @@ -77,6 +79,19 @@ echo "TOMCAT_IP=${TOMCAT_IP}" ${WORKSPACE}/test/csit/scripts/music/music-scripts/wait_for_port.sh ${TOMCAT_IP} 8080 +sleep 20; +echo "get the tomcat logs to make sure its running music properly" +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 @@ -89,6 +104,7 @@ 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' diff --git a/test/csit/plans/music/music-test-plan/teardown.sh b/test/csit/plans/music/music-test-plan/teardown.sh index e9982ae27..a5f74238c 100755 --- a/test/csit/plans/music/music-test-plan/teardown.sh +++ b/test/csit/plans/music/music-test-plan/teardown.sh @@ -19,6 +19,18 @@ # # 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"; @@ -39,13 +51,6 @@ sleep 5; docker volume rm music-vol -echo "dump music.log files" -ls -alF /tmp/music -ls -alF /tmp/music/properties -cat /tmp/music/properties/music.properties -cat /tmp/music/logs/MUSIC/music.log -cat /tmp/music/logs/MUSIC/error.log - #rm -Rf /tmp/music diff --git a/test/csit/plans/vfc-gvnfm-vnflcm/sanity-check/setup.sh b/test/csit/plans/vfc-gvnfm-vnflcm/sanity-check/setup.sh index 63782a9f5..f82f228a2 100755 --- a/test/csit/plans/vfc-gvnfm-vnflcm/sanity-check/setup.sh +++ b/test/csit/plans/vfc-gvnfm-vnflcm/sanity-check/setup.sh @@ -32,6 +32,10 @@ docker run -d -p 80:80 -e CONSUL_IP=$MSB_CONSUL_IP -e SDCLIENT_IP=$MSB_DISCOVERY MSB_IAG_IP=`get-instance-ip.sh msb_internal_apigateway` echo MSB_IAG_IP=${MSB_IAG_IP} +docker run -d -p 3306:3306 --name vfc-db -v /var/lib/mysql nexus3.onap.org:10001/onap/vfc/db +VFC_DB_IP=`get-instance-ip.sh vfc-db` +echo VFC_DB_IP=${VFC_DB_IP} + # Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway) for i in {1..10}; do curl -sS -m 1 ${MSB_CONSUL_IP}:8500 && curl -sS -m 1 ${MSB_DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IAG_IP}:80 && break @@ -39,12 +43,19 @@ for i in {1..10}; do sleep $i done +# Wait for initialization(3306 DB) +for i in {1..3}; do + curl -sS -m 1 ${VFC_DB_IP}:3306 && break + echo sleep $i + sleep $i +done + # wait for container initalization echo sleep 30 sleep 30 # start vfc-vnflcm -docker run -d --name vfc-vnflcm -v /var/lib/mysql -e MSB_ADDR=${MSB_IAG_IP}:80 nexus3.onap.org:10001/onap/vfc/vnflcm +docker run -d --name vfc-vnflcm -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/vfc/vnflcm VNFLCM_IP=`get-instance-ip.sh vfc-vnflcm` # Wait for initialization diff --git a/test/csit/plans/vfc-gvnfm-vnflcm/sanity-check/teardown.sh b/test/csit/plans/vfc-gvnfm-vnflcm/sanity-check/teardown.sh index f78acd37c..aebb2523e 100755 --- a/test/csit/plans/vfc-gvnfm-vnflcm/sanity-check/teardown.sh +++ b/test/csit/plans/vfc-gvnfm-vnflcm/sanity-check/teardown.sh @@ -19,4 +19,5 @@ kill-instance.sh msb_internal_apigateway kill-instance.sh msb_discovery kill-instance.sh msb_consul +kill-instance.sh vfc-db kill-instance.sh vfc-vnflcm diff --git a/test/csit/plans/vfc-gvnfm-vnfmgr/sanity-check/setup.sh b/test/csit/plans/vfc-gvnfm-vnfmgr/sanity-check/setup.sh index 8a3f9af97..3c985aaf1 100755 --- a/test/csit/plans/vfc-gvnfm-vnfmgr/sanity-check/setup.sh +++ b/test/csit/plans/vfc-gvnfm-vnfmgr/sanity-check/setup.sh @@ -32,6 +32,10 @@ docker run -d -p 80:80 -e CONSUL_IP=$MSB_CONSUL_IP -e SDCLIENT_IP=$MSB_DISCOVERY MSB_IAG_IP=`get-instance-ip.sh msb_internal_apigateway` echo MSB_IAG_IP=${MSB_IAG_IP} +docker run -d -p 3306:3306 --name vfc-db nexus3.onap.org:10001/onap/vfc/db +VFC_DB_IP=`get-instance-ip.sh vfc-db` +echo VFC_DB_IP=${VFC_DB_IP} + # Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway) for i in {1..10}; do curl -sS -m 1 ${MSB_CONSUL_IP}:8500 && curl -sS -m 1 ${MSB_DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IAG_IP}:80 && break @@ -39,12 +43,19 @@ for i in {1..10}; do sleep $i done +# Wait for initialization(3306 DB) +for i in {1..3}; do + curl -sS -m 1 ${VFC_DB_IP}:3306 && break + echo sleep $i + sleep $i +done + # wait for container initalization echo sleep 30 sleep 30 # start vfc-vnfmgr -docker run -d --name vfc-vnfmgr -e MSB_ADDR=${MSB_IAG_IP}:80 nexus3.onap.org:10001/onap/vfc/vnfmgr +docker run -d --name vfc-vnfmgr -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/vfc/vnfmgr VNFMGR_IP=`get-instance-ip.sh vfc-vnfmgr` for i in {1..10}; do curl -sS -m 1 ${VNFMGR_IP}:8803 && break diff --git a/test/csit/plans/vfc-gvnfm-vnfmgr/sanity-check/teardown.sh b/test/csit/plans/vfc-gvnfm-vnfmgr/sanity-check/teardown.sh index 572c2f336..cfabe42d4 100755 --- a/test/csit/plans/vfc-gvnfm-vnfmgr/sanity-check/teardown.sh +++ b/test/csit/plans/vfc-gvnfm-vnfmgr/sanity-check/teardown.sh @@ -19,4 +19,5 @@ kill-instance.sh msb_internal_apigateway kill-instance.sh msb_discovery kill-instance.sh msb_consul +kill-instance.sh vfc-db kill-instance.sh vfc-vnfmgr diff --git a/test/csit/plans/vfc-gvnfm-vnfres/sanity-check/setup.sh b/test/csit/plans/vfc-gvnfm-vnfres/sanity-check/setup.sh index e976f9281..a0ea986df 100755 --- a/test/csit/plans/vfc-gvnfm-vnfres/sanity-check/setup.sh +++ b/test/csit/plans/vfc-gvnfm-vnfres/sanity-check/setup.sh @@ -31,6 +31,10 @@ docker run -d -p 80:80 -e CONSUL_IP=$MSB_CONSUL_IP -e SDCLIENT_IP=$MSB_DISCOVERY MSB_IAG_IP=`get-instance-ip.sh msb_internal_apigateway` echo MSB_IAG_IP=${MSB_IAG_IP} +docker run -d -p 3306:3306 --name vfc-db nexus3.onap.org:10001/onap/vfc/db +VFC_DB_IP=`get-instance-ip.sh vfc-db` +echo VFC_DB_IP=${VFC_DB_IP} + # Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway) for i in {1..10}; do curl -sS -m 1 ${MSB_CONSUL_IP}:8500 && curl -sS -m 1 ${MSB_DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IAG_IP}:80 && break @@ -38,11 +42,18 @@ for i in {1..10}; do sleep $i done +# Wait for initialization(3306 DB) +for i in {1..3}; do + curl -sS -m 1 ${VFC_DB_IP}:3306 && break + echo sleep $i + sleep $i +done + # wait for container initalization echo sleep 60 sleep 60 # start vfc-vnfres -docker run -d --name vfc-vnfres -v /var/lib/mysql -e MSB_ADDR=${MSB_IAG_IP}:80 nexus3.onap.org:10001/onap/vfc/vnfres +docker run -d --name vfc-vnfres -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/vfc/vnfres VNFRES_IP=`get-instance-ip.sh vfc-vnfres` # Wait for initialization diff --git a/test/csit/plans/vfc-gvnfm-vnfres/sanity-check/teardown.sh b/test/csit/plans/vfc-gvnfm-vnfres/sanity-check/teardown.sh index edd857da6..09db55b5a 100755 --- a/test/csit/plans/vfc-gvnfm-vnfres/sanity-check/teardown.sh +++ b/test/csit/plans/vfc-gvnfm-vnfres/sanity-check/teardown.sh @@ -19,4 +19,5 @@ kill-instance.sh msb_internal_apigateway kill-instance.sh msb_discovery kill-instance.sh msb_consul +kill-instance.sh vfc-db kill-instance.sh vfc-vnfres diff --git a/test/csit/plans/vfc-nfvo-catalog/sanity-check/setup.sh b/test/csit/plans/vfc-nfvo-catalog/sanity-check/setup.sh index 3576e234d..d839fa554 100644 --- a/test/csit/plans/vfc-nfvo-catalog/sanity-check/setup.sh +++ b/test/csit/plans/vfc-nfvo-catalog/sanity-check/setup.sh @@ -33,6 +33,10 @@ docker run -d -p 80:80 -e CONSUL_IP=$CONSUL_IP -e SDCLIENT_IP=$DISCOVERY_IP -e " MSB_IP==`get-instance-ip.sh msb_internal_apigateway` echo MSB_IP=${MSB_IP} +docker run -d -p 3306:3306 --name vfc-db -v /var/lib/mysql nexus3.onap.org:10001/onap/vfc/db +VFC_DB_IP=`get-instance-ip.sh vfc-db` +echo VFC_DB_IP=${VFC_DB_IP} + # Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway) for i in {1..10}; do curl -sS -m 1 ${CONSUL_IP}:8500 && curl -sS -m 1 ${DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IP}:80 && break @@ -40,12 +44,19 @@ for i in {1..10}; do sleep $i done +# Wait for initialization(3306 DB) +for i in {1..3}; do + curl -sS -m 1 ${VFC_DB_IP}:3306 && break + echo sleep $i + sleep $i +done + # Need some time so service info can be synced from discovery to api gateway echo sleep 60 sleep 60 # start vfc-catalog -docker run -d --name vfc-catalog -v /var/lib/mysql -e MSB_ADDR=${DISCOVERY_IP}:10081 nexus3.onap.org:10001/onap/vfc/catalog +docker run -d --name vfc-catalog -v /var/lib/mysql -e MSB_ADDR=${DISCOVERY_IP}:10081 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/vfc/catalog CATALOG_IP=`get-instance-ip.sh vfc-catalog` for i in {1..10}; do curl -sS -m 1 ${CATALOG_IP}:8806 && break diff --git a/test/csit/plans/vfc-nfvo-catalog/sanity-check/teardown.sh b/test/csit/plans/vfc-nfvo-catalog/sanity-check/teardown.sh index 68d5b60e4..d498e34c6 100644 --- a/test/csit/plans/vfc-nfvo-catalog/sanity-check/teardown.sh +++ b/test/csit/plans/vfc-nfvo-catalog/sanity-check/teardown.sh @@ -19,4 +19,5 @@ kill-instance.sh msb_internal_apigateway kill-instance.sh msb_discovery kill-instance.sh msb_consul +kill-instance.sh vfc-db kill-instance.sh vfc-catalog diff --git a/test/csit/plans/vfc-nfvo-lcm/sanity-check/setup.sh b/test/csit/plans/vfc-nfvo-lcm/sanity-check/setup.sh index 74b0ab61d..7a739bada 100755 --- a/test/csit/plans/vfc-nfvo-lcm/sanity-check/setup.sh +++ b/test/csit/plans/vfc-nfvo-lcm/sanity-check/setup.sh @@ -32,6 +32,10 @@ docker run -d -p 80:80 -e CONSUL_IP=$MSB_CONSUL_IP -e SDCLIENT_IP=$MSB_DISCOVERY MSB_IAG_IP=`get-instance-ip.sh msb_internal_apigateway` echo MSB_IAG_IP=${MSB_IAG_IP} +docker run -d -p 3306:3306 --name vfc-db -v /var/lib/mysql nexus3.onap.org:10001/onap/vfc/db +VFC_DB_IP=`get-instance-ip.sh vfc-db` +echo VFC_DB_IP=${VFC_DB_IP} + # Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway) for i in {1..10}; do curl -sS -m 1 ${MSB_CONSUL_IP}:8500 && curl -sS -m 1 ${MSB_DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IAG_IP}:80 && break @@ -39,12 +43,25 @@ for i in {1..10}; do sleep $i done +# Wait for initialization(3306 DB) +for i in {1..3}; do + curl -sS -m 1 ${VFC_DB_IP}:3306 && break + echo sleep $i + sleep $i +done + +docker ps > 1.txt +cat 1.txt +echo "****************************" +docker logs -f vfc-db > 2.txt & +cat 2.txt + # Need some time so service info can be synced from discovery to api gateway echo sleep 60 sleep 60 # start vfc-nslcm -docker run -d --name vfc-nslcm -v /var/lib/mysql -e MSB_ADDR=${MSB_IAG_IP}:80 nexus3.onap.org:10001/onap/vfc/nslcm +docker run -d --name vfc-nslcm -v /var/lib/mysql -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/vfc/nslcm NSLCM_IP=`get-instance-ip.sh vfc-nslcm` # Wait for initialization @@ -54,5 +71,15 @@ for i in {1..10}; do sleep $i done +curl http://${NSLCM_IP}:8403/api/nslcm/v1/swagger.json + +docker logs -f vfc-nslcm > 3.txt & +cat 3.txt + +docker cp vfc-nslcm:/service/vfc/nfvo/lcm/logs/runtime_lcm.log ./ +cat runtime_lcm.log + + + # Pass any variables required by Robot test suites in ROBOT_VARIABLES ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v NSLCM_IP:${NSLCM_IP} -v SCRIPTS:${SCRIPTS}" diff --git a/test/csit/plans/vfc-nfvo-lcm/sanity-check/teardown.sh b/test/csit/plans/vfc-nfvo-lcm/sanity-check/teardown.sh index c74850d36..6ddf75576 100755 --- a/test/csit/plans/vfc-nfvo-lcm/sanity-check/teardown.sh +++ b/test/csit/plans/vfc-nfvo-lcm/sanity-check/teardown.sh @@ -19,4 +19,5 @@ kill-instance.sh msb_internal_apigateway kill-instance.sh msb_discovery kill-instance.sh msb_consul +kill-instance.sh vfc-db kill-instance.sh vfc-nslcm diff --git a/test/csit/plans/vid/healthCheck/setup.sh b/test/csit/plans/vid/healthCheck/setup.sh index a117a6c78..ce308cfa3 100644 --- a/test/csit/plans/vid/healthCheck/setup.sh +++ b/test/csit/plans/vid/healthCheck/setup.sh @@ -32,4 +32,3 @@ echo BE_IP=${BE_IP} # Pass any variables required by Robot test suites in ROBOT_VARIABLES ROBOT_VARIABLES="-v BE_IP:${BE_IP}" - diff --git a/test/csit/plans/vnfsdk-pkgtools/sanity-check/setup.sh b/test/csit/plans/vnfsdk-pkgtools/sanity-check/setup.sh index 7e109b7c0..3921bb0a9 100755 --- a/test/csit/plans/vnfsdk-pkgtools/sanity-check/setup.sh +++ b/test/csit/plans/vnfsdk-pkgtools/sanity-check/setup.sh @@ -24,7 +24,9 @@ cd $WORKSPACE/archives git clone -b master --single-branch http://gerrit.onap.org/r/vnfsdk/pkgtools.git pkgtools cd $WORKSPACE/archives/pkgtools git pull -python setup.py install +echo "To install vnfsdk pkgtools git head revision: $(git rev-parse HEAD)" +python setup.py egg_info +pip install . pip freeze | tee $WORKSPACE/archives/_pip-freeze-after-setup.txt diff --git a/test/csit/plans/vnfsdk-pkgtools/sanity-check/testplan.txt b/test/csit/plans/vnfsdk-pkgtools/sanity-check/testplan.txt index f47c44ed0..05ff05a24 100644 --- a/test/csit/plans/vnfsdk-pkgtools/sanity-check/testplan.txt +++ b/test/csit/plans/vnfsdk-pkgtools/sanity-check/testplan.txt @@ -1,3 +1,4 @@ # Test suites are relative paths under [integration.git]/test/csit/tests/. # Place the suites in run order. vnfsdk-pkgtools/tosca-metadata/create_open.robot +vnfsdk-pkgtools/tosca-metadata/create_validate_digest_signing.robot diff --git a/test/csit/run-csit.sh b/test/csit/run-csit.sh index 4b2a57181..a048a0d69 100755 --- a/test/csit/run-csit.sh +++ b/test/csit/run-csit.sh @@ -105,9 +105,10 @@ pip install --upgrade ${ROBOT_VENV}/src/onap/testsuite/python-testing-utils pip freeze # install chrome driver +google-chrome --version if [ ! -x ${ROBOT_VENV}/bin/chromedriver ]; then pushd ${ROBOT_VENV}/bin - wget -N http://chromedriver.storage.googleapis.com/2.27/chromedriver_linux64.zip + wget -N http://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip unzip chromedriver_linux64.zip chmod +x chromedriver popd diff --git a/test/csit/scripts/clamp/python-lib/CustomSeleniumLibrary.py b/test/csit/scripts/clamp/python-lib/CustomSeleniumLibrary.py new file mode 100755 index 000000000..ad11b1152 --- /dev/null +++ b/test/csit/scripts/clamp/python-lib/CustomSeleniumLibrary.py @@ -0,0 +1,20 @@ +from Selenium2Library import Selenium2Library +from selenium.webdriver.common.keys import Keys +import time + +class CustomSeleniumLibrary(Selenium2Library): + def insert_into_prompt(self, text): + alert = None + try: + time.sleep(5) + listOfFields = text.split(" ") + allInOneString="" + for temp in listOfFields: + allInOneString=allInOneString+temp+Keys.TAB + + alert= self._current_browser().switch_to_alert() + alert.send_keys(allInOneString) + except WebDriverException: + raise RuntimeError('There were no alert') + + diff --git a/test/csit/scripts/clamp/start_clamp_containers.sh b/test/csit/scripts/clamp/start_clamp_containers.sh index dc0b4fe41..23b1705e5 100755 --- a/test/csit/scripts/clamp/start_clamp_containers.sh +++ b/test/csit/scripts/clamp/start_clamp_containers.sh @@ -32,7 +32,7 @@ TIME_OUT=600 INTERVAL=5 TIME=0 while [ "$TIME" -lt "$TIME_OUT" ]; do - response=$(curl --write-out '%{http_code}' --silent --output /dev/null -vk --key config/org.onap.clamp.keyfile https://localhost:8443/restservices/clds/v1/clds/healthcheck); echo $response + response=$(curl --write-out '%{http_code}' --silent --output /dev/null -vk --key config/org.onap.clamp.keyfile https://localhost:8443/restservices/clds/v1/healthcheck); echo $response if [ "$response" == "200" ]; then echo Clamp and its database well started in $TIME seconds diff --git a/test/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh b/test/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh index 96ac40f18..804603f2b 100755 --- a/test/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh +++ b/test/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh @@ -3,6 +3,21 @@ # $1 is the IP address of the buscontroller # $2 is the IP address of the DRPS # $3 is the IP address of the MRC +# $4 is the protocol (defaults to http) + +PROTO=${4:-http} +if [ "$PROTO" = "http" ] +then + PORT=8080 + CURLOPT="-v" + MRPORT=3904 + DRPORT=8080 +else + PORT=8443 + CURLOPT="-v -k" + MRPORT=3905 + DRPORT=8443 +fi # INITIALIZE: dmaap object JSON=/tmp/$$.dmaap @@ -10,7 +25,7 @@ cat << EOF > $JSON { "version": "1", "topicNsRoot": "org.onap.dmaap", - "drProvUrl": "http://${2}:8080", + "drProvUrl": "${PROTO}://dmaap-dr-prov:${DRPORT}", "dmaapName": "onapCSIT", "bridgeAdminTopic": "MM_AGENT_PROV" @@ -18,7 +33,7 @@ cat << EOF > $JSON EOF echo "Initializing /dmaap endpoint" -curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/dmaap +curl ${CURLOPT} -X POST -d @${JSON} -H "Content-Type: application/json" ${PROTO}://$1:${PORT}/webapi/dmaap @@ -35,7 +50,7 @@ cat << EOF > $JSON EOF echo "Initializing /dcaeLocations endpoint" -curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/dcaeLocations +curl ${CURLOPT} -X POST -d @${JSON} -H "Content-Type: application/json" ${PROTO}://$1:${PORT}/webapi/dcaeLocations # INITIALIZE: MR object in 1 site @@ -52,10 +67,10 @@ cat << EOF > $JSON "dcaeLocationName": "csit-sanfrancisco", "fqdn": "$DOCKER_HOST", "topicProtocol" : "http", - "topicPort": "3904" + "topicPort": "${MRPORT}" } EOF echo "Initializing /mr_clusters endpoint" -curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/mr_clusters +curl ${CURLOPT} -X POST -d @${JSON} -H "Content-Type: application/json" ${PROTO}://$1:${PORT}/webapi/mr_clusters diff --git a/test/csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh b/test/csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh index 688ce7d45..317c17f18 100755 --- a/test/csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh +++ b/test/csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh @@ -12,7 +12,16 @@ function dmaapbc_launch() { TMP_CFG=/tmp/docker-databus-controller.conf . ./onapCSIT.env > $TMP_CFG - docker run -d --name $CONTAINER_NAME -v $TMP_CFG:/opt/app/config/conf $TAG + ADDHOSTS="" + if [ ! -z "$2" ] + then + ADDHOSTS="$ADDHOSTS --add-host=message-router:$2" + fi + if [ ! -z "$3" ] + then + ADDHOSTS="$ADDHOSTS --add-host=dmaap-dr-prov:$3" + fi + docker run -d $ADDHOSTS --name $CONTAINER_NAME -v $TMP_CFG:/opt/app/config/conf $TAG IP=`get-instance-ip.sh ${CONTAINER_NAME}` # Wait for initialization diff --git a/test/csit/scripts/dmaap-buscontroller/dr-launch.sh b/test/csit/scripts/dmaap-buscontroller/dr-launch.sh new file mode 100644 index 000000000..abc0aae87 --- /dev/null +++ b/test/csit/scripts/dmaap-buscontroller/dr-launch.sh @@ -0,0 +1,59 @@ + +#!/bin/bash + +#!/bin/bash + +# script to launch DMaaP DR docker containers +# sets global var IP with assigned IP address of DR Prov + +function dmaap_dr_launch() { + IP="" + + + # This next section was copied from scripts/dmaap-datarouter/dr-suite/setup.sh + # and slightly modified... + + # Clone DMaaP Data Router repo + mkdir -p $WORKSPACE/archives/dmaapdr + cd $WORKSPACE/archives/dmaapdr + + git clone --depth 1 https://gerrit.onap.org/r/dmaap/datarouter -b master + cd datarouter + git pull + cd $WORKSPACE/archives/dmaapdr/datarouter/docker-compose/ + + sed -i 's/10003/10001/g' docker-compose.yml + # start DMaaP DR containers with docker compose and configuration from docker-compose.yml + docker login -u docker -p docker nexus3.onap.org:10001 + docker-compose up -d + + # Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb + for i in {1..50}; do + if [ $(docker inspect --format '{{ .State.Running }}' datarouter-node) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' datarouter-prov) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' mariadb) ] + then + echo "DR Service Running" + break + else + echo sleep $i + sleep $i + fi + done + + DR_PROV_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-prov) + DR_NODE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-node) + DR_GATEWAY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' datarouter-prov) + + echo DR_PROV_IP=${DR_PROV_IP} + echo DR_NODE_IP=${DR_NODE_IP} + echo DR_GATEWAY_IP=${DR_GATEWAY_IP} + + docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/NODES?val=dmaap-dr-node\|$DR_GATEWAY_IP" + docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$DR_GATEWAY_IP" + + #Pass any variables required by Robot test suites in ROBOT_VARIABLES + ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DR_NODE_IP:${DR_NODE_IP}" + + IP=${DR_GATEWAY_IP} +} diff --git a/test/csit/scripts/dmaap-buscontroller/onapCSIT.env b/test/csit/scripts/dmaap-buscontroller/onapCSIT.env index 58432e6a7..db865818e 100644 --- a/test/csit/scripts/dmaap-buscontroller/onapCSIT.env +++ b/test/csit/scripts/dmaap-buscontroller/onapCSIT.env @@ -8,7 +8,7 @@ # Only need to set values where defaults aren't appropriate # cat <<!EOF -DMAAPBC_INT_HTTPS_PORT=0 +DMAAPBC_INT_HTTPS_PORT=8443 DMAAPBC_PG_ENABLED=false DMAAPBC_INSTANCE_NAME=ONAP-CSIT DMAAPBC_AAF_URL=https://${1}:1080/proxy/ diff --git a/test/csit/scripts/dmaap-message-router/dmaap-mr-launch.sh b/test/csit/scripts/dmaap-message-router/dmaap-mr-launch.sh index c439a97ad..64f1720b6 100755 --- a/test/csit/scripts/dmaap-message-router/dmaap-mr-launch.sh +++ b/test/csit/scripts/dmaap-message-router/dmaap-mr-launch.sh @@ -31,6 +31,7 @@ source ${SCRIPTS}/common_functions.sh # (kafka and zk containers are not called externally) function dmaap_mr_launch() { + COMPOSE_PREFIX=docker-compose # Clone DMaaP Message Router repo mkdir -p $WORKSPACE/archives/dmaapmr cd $WORKSPACE/archives/dmaapmr @@ -45,12 +46,13 @@ function dmaap_mr_launch() { # start DMaaP MR containers with docker compose and configuration from docker-compose.yml docker login -u docker -p docker nexus3.onap.org:10001 docker-compose up -d + docker ps # Wait for initialization of Docker contaienr for DMaaP MR, Kafka and Zookeeper for i in {1..50}; do - if [ $(docker inspect --format '{{ .State.Running }}' dockercompose_dmaap_1) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' dockercompose_zookeeper_1) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' dockercompose_dmaap_1) ] + if [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_zookeeper_1) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] then echo "DMaaP Service Running" break @@ -61,10 +63,10 @@ function dmaap_mr_launch() { done - DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dockercompose_dmaap_1) + DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_dmaap_1) IP=${DMAAP_MR_IP} - KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dockercompose_kafka_1) - ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dockercompose_zookeeper_1) + KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_kafka_1) + ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_zookeeper_1) echo DMAAP_MR_IP=${DMAAP_MR_IP} echo IP=${IP} @@ -84,9 +86,9 @@ function dmaap_mr_launch() { # Wait for initialization of Docker containers for i in {1..50}; do - if [ $(docker inspect --format '{{ .State.Running }}' dockercompose_dmaap_1) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' dockercompose_zookeeper_1) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' dockercompose_dmaap_1) ] + if [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_zookeeper_1) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] then echo "DMaaP Service Running" break diff --git a/test/csit/scripts/dmaap-message-router/dmaap-mr-teardown.sh b/test/csit/scripts/dmaap-message-router/dmaap-mr-teardown.sh index f57385707..ac6d798c9 100755 --- a/test/csit/scripts/dmaap-message-router/dmaap-mr-teardown.sh +++ b/test/csit/scripts/dmaap-message-router/dmaap-mr-teardown.sh @@ -18,7 +18,7 @@ # function dmaap_mr_teardown() { -kill-instance.sh dockercompose_dmaap_1 -kill-instance.sh dockercompose_kafka_1 -kill-instance.sh dockercompose_zookeeper_1 +kill-instance.sh docker-compose_dmaap_1 +kill-instance.sh docker-compose_kafka_1 +kill-instance.sh docker-compose_zookeeper_1 } diff --git a/test/csit/scripts/externalapi-nbi/start_nbi_containers.sh b/test/csit/scripts/externalapi-nbi/start_nbi_containers.sh index 61026d7b0..1d1d0fd3e 100644 --- a/test/csit/scripts/externalapi-nbi/start_nbi_containers.sh +++ b/test/csit/scripts/externalapi-nbi/start_nbi_containers.sh @@ -16,8 +16,8 @@ NEXUS_USERNAME=docker NEXUS_PASSWD=docker -NEXUS_DOCKER_REPO=nexus3.onap.org:10001 -DOCKER_IMAGE_VERSION=latest +export NEXUS_DOCKER_REPO=nexus3.onap.org:10001 +export DOCKER_IMAGE_VERSION=latest echo "This is ${WORKSPACE}/test/csit/scripts/externalapi-nbi/start_nbi_containers.sh" diff --git a/test/csit/scripts/multicloud-pike/generic_sim/Dockerfile b/test/csit/scripts/multicloud-pike/generic_sim/Dockerfile new file mode 100644 index 000000000..688b58afe --- /dev/null +++ b/test/csit/scripts/multicloud-pike/generic_sim/Dockerfile @@ -0,0 +1,12 @@ +FROM python:2.7 + +EXPOSE 8080 + +RUN mkdir -p /{tmp,etc}/generic_sim + +WORKDIR /opt/generic_sim/ + +COPY . . +RUN pip install --no-cache-dir -r requirements.txt + +CMD [ "python", "generic_sim.py" ] diff --git a/test/csit/scripts/multicloud-pike/generic_sim/aai/responses.yml b/test/csit/scripts/multicloud-pike/generic_sim/aai/responses.yml new file mode 100644 index 000000000..276280729 --- /dev/null +++ b/test/csit/scripts/multicloud-pike/generic_sim/aai/responses.yml @@ -0,0 +1,189 @@ +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne: + GET: + body: '{"cloud-owner":"CloudOwner","cloud-region-id":"RegionOne","cloud-type":"openstack","owner-defined-type":"t1","cloud-region-version":"RegionOne","identity-url":"http://keystone:8080/v3","cloud-zone":"z1","complex-name":"clli1","sriov-automation":false,"cloud-extra-info":"","resource-version":"1524845154715"}' + content_type: application/json + status_code: 200 + PUT: + body: '' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/availability-zones/availability-zone/internal: + GET: + body: '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource + not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/availability-zones/availability-zone/internal","Node + Not Found:No Node of type availability-zone found at: cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/availability-zones/availability-zone/internal","ERR.5.4.6114"]}}}' + content_type: application/json + status_code: 200 + PUT: + body: '' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/availability-zones/availability-zone/nova: + GET: + body: '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource + not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/availability-zones/availability-zone/nova","Node + Not Found:No Node of type availability-zone found at: cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/availability-zones/availability-zone/nova","ERR.5.4.6114"]}}}' + content_type: application/json + status_code: 200 + PUT: + body: '' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/100: + GET: + body: '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource + not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/100","Node + Not Found:No Node of type flavor found at: cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/100","ERR.5.4.6114"]}}}' + content_type: application/json + status_code: 200 + PUT: + body: '' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/110: + GET: + body: '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource + not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/110","Node + Not Found:No Node of type flavor found at: cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/110","ERR.5.4.6114"]}}}' + content_type: application/json + status_code: 200 + PUT: + body: '' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/111: + GET: + body: '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource + not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/111","Node + Not Found:No Node of type flavor found at: cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/111","ERR.5.4.6114"]}}}' + content_type: application/json + status_code: 200 + PUT: + body: '' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/112: + GET: + body: '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource + not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/112","Node + Not Found:No Node of type flavor found at: cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/112","ERR.5.4.6114"]}}}' + content_type: application/json + status_code: 200 + PUT: + body: '' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/113: + GET: + body: '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource + not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/113","Node + Not Found:No Node of type flavor found at: cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/113","ERR.5.4.6114"]}}}' + content_type: application/json + status_code: 200 + PUT: + body: '' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/114: + GET: + body: '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource + not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/114","Node + Not Found:No Node of type flavor found at: cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/114","ERR.5.4.6114"]}}}' + content_type: application/json + status_code: 200 + PUT: + body: '' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/115: + GET: + body: '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource + not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/115","Node + Not Found:No Node of type flavor found at: cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/115","ERR.5.4.6114"]}}}' + content_type: application/json + status_code: 200 + PUT: + body: '' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/116: + GET: + body: '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource + not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/116","Node + Not Found:No Node of type flavor found at: cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/116","ERR.5.4.6114"]}}}' + content_type: application/json + status_code: 200 + PUT: + body: '' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/117: + GET: + body: '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource + not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/117","Node + Not Found:No Node of type flavor found at: cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/117","ERR.5.4.6114"]}}}' + content_type: application/json + status_code: 200 + PUT: + body: '' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/images/image/660709df-e90b-471f-ac57-d8c2555e573d: + GET: + body: '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource + not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/images/image/660709df-e90b-471f-ac57-d8c2555e573d","Node + Not Found:No Node of type image found at: cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/images/image/660709df-e90b-471f-ac57-d8c2555e573d","ERR.5.4.6114"]}}}' + content_type: application/json + status_code: 200 + PUT: + body: '' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/3543226ffed44daf90a2f71f36c00b8d: + GET: + body: '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource + not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/3543226ffed44daf90a2f71f36c00b8d","Node + Not Found:No Node of type tenant found at: cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/3543226ffed44daf90a2f71f36c00b8d","ERR.5.4.6114"]}}}' + content_type: application/json + status_code: 200 + PUT: + body: '' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/b8f5d85bbcd84af28d7caa62d39f05c7: + GET: + body: '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource + not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/b8f5d85bbcd84af28d7caa62d39f05c7","Node + Not Found:No Node of type tenant found at: cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/b8f5d85bbcd84af28d7caa62d39f05c7","ERR.5.4.6114"]}}}' + content_type: application/json + status_code: 200 + PUT: + body: '' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne: + GET: + body: '{"cloud-owner":"CloudOwner","cloud-region-id":"RegionOne","cloud-type":"openstack","owner-defined-type":"t1","cloud-region-version":"RegionOne","identity-url":"http://multicloud-pike:80/api/multicloud-titanium_cloud/v0/CloudOwner_RegionOne/identity/v2.0","cloud-zone":"z1","complex-name":"clli1","sriov-automation":false,"cloud-extra-info":"","resource-version":"1524845276291"}' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/esr-system-info-list: + GET: + body: '{"esr-system-info":[{"esr-system-info-id":"4ce895ad-82f7-4476-b5eb-d19d19585da2","service-url":"http://keystone:8080/v3","user-name":"admin","password":"secret","system-type":"VIM","ssl-insecure":true,"cloud-domain":"Default","default-tenant":"admin","resource-version":"1524845155617"}]}' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/pservers/pserver/compute-0: + GET: + body: '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource + not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","cloud-infrastructure/pservers/pserver/compute-0","Node + Not Found:No Node of type pserver found at: cloud-infrastructure/pservers/pserver/compute-0","ERR.5.4.6114"]}}}' + content_type: application/json + status_code: 200 + PUT: + body: '' + content_type: application/json + status_code: 200 +aai/v13/cloud-infrastructure/pservers/pserver/compute-0/relationship-list/relationship: + PUT: + body: '' + content_type: application/json + status_code: 200 diff --git a/test/csit/scripts/multicloud-pike/generic_sim/cinder/responses.yml b/test/csit/scripts/multicloud-pike/generic_sim/cinder/responses.yml new file mode 100644 index 000000000..d9657a5df --- /dev/null +++ b/test/csit/scripts/multicloud-pike/generic_sim/cinder/responses.yml @@ -0,0 +1,5 @@ +/snapshots/detail: + get: + body: '{"snapshots": []}' + content_type: application/json + status_code: 200 diff --git a/test/csit/scripts/multicloud-pike/generic_sim/generic_sim.py b/test/csit/scripts/multicloud-pike/generic_sim/generic_sim.py new file mode 100644 index 000000000..4392b6524 --- /dev/null +++ b/test/csit/scripts/multicloud-pike/generic_sim/generic_sim.py @@ -0,0 +1,109 @@ +# Copyright 2018 Intel Corporation, Inc +# 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. + +import json +import logging + +import web +from web import webapi +import yaml + +urls = ( + '/(.*)','MockController' +) + +def setup_logger(name, log_file, level=logging.DEBUG): + print("Configuring the logger...") + handler = logging.FileHandler(log_file) + formatter = logging.Formatter('%(message)s') + handler.setFormatter(formatter) + + logger = logging.getLogger(name) + logger.setLevel(level) + logger.addHandler(handler) + + return logger + + +class MockResponse: + def __init__(self, http_verb, status_code, + content_type="application/json", body="{}", + headers={}): + self.http_verb = http_verb.lower() + self.status_code = status_code + self.content_type = content_type + self.body = body + self.headers = headers + +def _parse_responses(parsed_responses): + result = {} + for path, responses in parsed_responses.iteritems(): + new_path = path + if path.startswith("/"): + new_path = path[1:] + + result[new_path] = [] + for http_verb, response in responses.iteritems(): + result[new_path].append(MockResponse(http_verb, **response)) + return result + +def load_responses(filename): + print("Loading responses from configuration file..") + with open(filename) as yaml_file: + responses_file = yaml.safe_load(yaml_file) + responses_map = _parse_responses(responses_file) + return responses_map + + +class MockController: + + def _do_action(self, action): + logger.info('{}'.format(web.ctx.env.get('wsgi.input').read())) + action = action.lower() + url = web.ctx['fullpath'] + try: + if url.startswith("/"): + url = url[1:] + response = [ r for r in responses_map[url] if r.http_verb == action][0] + for header, value in response.headers.iteritems(): + web.header(header, value) + web.header('Content-Type', response.content_type) + print(response.body) + return response.body + except: + webapi.NotFound() + + def DELETE(self, url): + return self._do_action("delete") + + def HEAD(self, url): + return self._do_action("head") + + def PUT(self, url): + return self._do_action("put") + + def GET(self, url): + return self._do_action("get") + + def POST(self, url): + return self._do_action("post") + + def PATCH(self, url): + return self._do_action("patch") + + +logger = setup_logger('mock_controller', '/tmp/generic_sim/output.log') +responses_map = load_responses('/etc/generic_sim/responses.yml') +app = web.application(urls, globals()) +if __name__ == "__main__": + app.run() diff --git a/test/csit/scripts/multicloud-pike/generic_sim/glance/responses.yml b/test/csit/scripts/multicloud-pike/generic_sim/glance/responses.yml new file mode 100644 index 000000000..d8422352b --- /dev/null +++ b/test/csit/scripts/multicloud-pike/generic_sim/glance/responses.yml @@ -0,0 +1,73 @@ +/v2/images: + get: + body: '{"images": [{"status": "active", "schema": "/v2/schemas/image", + "virtual_size": null, "description": "", "tags": [], "container_format": + "bare", "created_at": "2018-04-21T06:12:13Z", "disk_format": "raw", + "updated_at": "2018-04-21T06:12:24Z", "visibility": "public", "id": + "660709df-e90b-471f-ac57-d8c2555e573d", "owner": "b8f5d85bbcd84af28d7caa62d39f05c7", + "protected": false, "min_ram": 0, "file": "/v2/images/660709df-e90b-471f-ac57-d8c2555e573d/file", + "checksum": "683f86920d4c922cb5c55d99d646b895", "min_disk": 0, "size": + 1697597440, "self": "/v2/images/660709df-e90b-471f-ac57-d8c2555e573d", "store": + "file", "name": "tis4-centos-guest"}], "first": "/v2/images", "schema": + "/v2/schemas/images"}' + content_type: application/json + status_code: 200 +/v2/schemas/image: + get: + body: '{"additionalProperties": {"type": "string"}, "name": "image", + "links": [{"href": "{self}", "rel": "self"}, {"href": "{file}", + "rel": "enclosure"}, {"href": "{schema}", "rel": "describedby"}], + "properties": {"container_format": {"enum": [null, "ami", "ari", "aki", + "bare", "ovf", "ova", "docker"], "type": ["null", "string"], "description": + "Format of the container"}, "min_ram": {"type": "integer", "description": + "Amount of ram (in MB) required to boot image."}, "ramdisk_id": {"pattern": + "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$", + "type": ["null", "string"], "description": "ID of image stored in Glance + that should be used as the ramdisk when booting an AMI-style image.", "is_base": + false}, "locations": {"items": {"required": ["url", "metadata"], "type": + "object", "properties": {"url": {"type": "string", "maxLength": + 255}, "metadata": {"type": "object"}}}, "type": "array", "description": + "A set of URLs to access the image file kept in external store"}, "file": + {"readOnly": true, "type": "string", "description": "An image file + url"}, "owner": {"type": ["null", "string"], "description": "Owner + of the image", "maxLength": 255}, "id": {"pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$", + "type": "string", "description": "An identifier for the image"}, "size": + {"readOnly": true, "type": ["null", "integer"], "description": "Size + of image file in bytes"}, "os_distro": {"type": "string", "description": + "Common name of operating system distribution as specified in https://docs.openstack.org/python-glanceclient/latest/cli/property-keys.html", + "is_base": false}, "self": {"readOnly": true, "type": "string", "description": + "An image self url"}, "disk_format": {"enum": [null, "ami", "ari", + "aki", "vhd", "vhdx", "vmdk", "raw", "qcow2", "vdi", "iso", + "ploop"], "type": ["null", "string"], "description": "Format of the + disk"}, "os_version": {"type": "string", "description": "Operating + system version as specified by the distributor", "is_base": false}, "direct_url": + {"readOnly": true, "type": "string", "description": "URL to access + the image file kept in external store"}, "schema": {"readOnly": true, "type": + "string", "description": "An image schema url"}, "status": {"readOnly": + true, "enum": ["queued", "saving", "active", "killed", "deleted", + "pending_delete", "deactivated"], "type": "string", "description": + "Status of the image"}, "tags": {"items": {"type": "string", "maxLength": + 255}, "type": "array", "description": "List of strings related to the + image"}, "kernel_id": {"pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$", + "type": ["null", "string"], "description": "ID of image stored in Glance + that should be used as the kernel when booting an AMI-style image.", "is_base": + false}, "visibility": {"enum": ["community", "public", "private", + "shared"], "type": "string", "description": "Scope of image accessibility"}, + "updated_at": {"readOnly": true, "type": "string", "description": + "Date and time of the last image modification"}, "min_disk": {"type": + "integer", "description": "Amount of disk space (in GB) required to boot + image."}, "virtual_size": {"readOnly": true, "type": ["null", "integer"], + "description": "Virtual size of image in bytes"}, "instance_uuid": {"type": + "string", "description": "Metadata which can be used to record which instance + this image is associated with. (Informational only, does not create an instance + snapshot.)", "is_base": false}, "name": {"type": ["null", "string"], + "description": "Descriptive name for the image", "maxLength": 255}, "checksum": + {"readOnly": true, "type": ["null", "string"], "description": "md5 + hash of image contents.", "maxLength": 32}, "created_at": {"readOnly": + true, "type": "string", "description": "Date and time of image registration"}, + "protected": {"type": "boolean", "description": "If true, image will + not be deletable."}, "architecture": {"type": "string", "description": + "Operating system architecture as specified in https://docs.openstack.org/python-glanceclient/latest/cli/property-keys.html", + "is_base": false}}}' + content_type: application/json + status_code: 200 diff --git a/test/csit/scripts/multicloud-pike/generic_sim/keystone/responses.yml b/test/csit/scripts/multicloud-pike/generic_sim/keystone/responses.yml new file mode 100644 index 000000000..422ec7b7b --- /dev/null +++ b/test/csit/scripts/multicloud-pike/generic_sim/keystone/responses.yml @@ -0,0 +1,44 @@ +projects: + get: + body: '{"projects": [{"is_domain": false, "description": "admin tenant", + "links": {"self": "http://keystone:8080/v3/projects/b8f5d85bbcd84af28d7caa62d39f05c7"}, + "enabled": true, "domain_id": "default", "parent_id": "default", "id": + "b8f5d85bbcd84af28d7caa62d39f05c7", "name": "admin"}, {"is_domain": + false, "description": "Tenant for the openstack services", "links": {"self": + "http://keystone:8080/v3/projects/3543226ffed44daf90a2f71f36c00b8d"}, + "enabled": true, "domain_id": "default", "parent_id": "default", "id": + "3543226ffed44daf90a2f71f36c00b8d", "name": "services"}], "links": {"self": + "http://keystone:8080/v3/projects", "next": null, "previous": null}}' + content_type: application/json + status_code: 200 +v3/auth/tokens: + post: + body: '{"token": {"methods": ["password"], "expires_at": "2019-11-06T15:32:17.893769Z", + "user": { "domain": {"id": "default", "name": "Default"}, + "id": "423f19a4ac1e4f48bbb4180756e6eb6c", "name": "admin", "password_expires_at": null }, + "audit_ids": [ "ZzZwkUflQfygX7pdYDBCQQ"], "catalog": [ + { "endpoints": [ + { "id": "1", "interface": "public", "region": "RegionOne", "url": "http://keystone:8080" }, + { "id": "2", "interface": "internal", "region": "RegionOne", "url": "http://keystone:8080" }, + { "id": "3", "interface": "admin", "region": "RegionOne", "url": "http://keystone:8080" } + ], "id": "1", "type": "identity", "name": "keystone"}, + { "endpoints": [ + { "id": "1", "interface": "public", "region": "RegionOne", "url": "http://glance:8080" }, + { "id": "2", "interface": "internal", "region": "RegionOne", "url": "http://glance:8080" }, + { "id": "3", "interface": "admin", "region": "RegionOne", "url": "http://glance:8080" } + ], "id": "2", "type": "image", "name": "glance"}, + { "endpoints": [ + { "id": "1", "interface": "public", "region": "RegionOne", "url": "http://cinder:8080" }, + { "id": "2", "interface": "internal", "region": "RegionOne", "url": "http://cinder:8080" }, + { "id": "3", "interface": "admin", "region": "RegionOne", "url": "http://cinder:8080" } + ], "id": "2", "type": "volumev3", "name": "cinder"}, + { "endpoints": [ + { "id": "1", "interface": "public", "region": "RegionOne", "url": "http://nova:8080" }, + { "id": "2", "interface": "internal", "region": "RegionOne", "url": "http://nova:8080" }, + { "id": "3", "interface": "admin", "region": "RegionOne", "url": "http://nova:8080" } + ], "id": "3", "type": "compute", "name": "nova"}], + "issued_at": "2015-11-06T14:32:17.893797Z"}}' + content_type: application/json + status_code: 200 + headers: + X-Subject-Token: 423f19a4ac1e4f48bbb4180756e6eb6c diff --git a/test/csit/scripts/multicloud-pike/generic_sim/log_parser.py b/test/csit/scripts/multicloud-pike/generic_sim/log_parser.py new file mode 100644 index 000000000..1334e608c --- /dev/null +++ b/test/csit/scripts/multicloud-pike/generic_sim/log_parser.py @@ -0,0 +1,61 @@ +import argparse + +import yaml + + +def _find_aai_response_content(inp): + return inp.split("||||")[1].split("with response content = ")[1] + +def _find_openstack_url(inp): + return inp.split("||||")[1].split("making request with URI:")[1] + +def _find_openstack_response_content(inp): + return inp.split("||||")[1].split("with content:")[1].replace("u'", "'") + +def _add_response(all_responses, url, http_verb, body, status_code=200, content_type="application/json"): + if url not in all_responses.keys(): + all_responses[url] = { + http_verb: { + "status_code": status_code, + "content_type": content_type, + "body": body + } + } + elif http_verb not in all_responses[url].keys(): + all_responses[url][http_verb] = { + "status_code": status_code, + "content_type": content_type, + "body": body + } + +def parse_lines(content, aai_ip): + aai_pattern = "https://%s:30233/" % aai_ip + openstack_pattern = "making request with URI:" + + openstack_responses = {} + aai_responses = {} + for i, line in enumerate(content): + current_line = line.strip() + if aai_pattern in current_line and "DEBUG" not in current_line: + url = current_line.split(" ")[8][:-1].replace(aai_pattern, "") + _add_response(aai_responses, url, current_line.split(" ")[9][:-1], + _find_aai_response_content(content[i + 3])) + elif openstack_pattern in current_line: + _add_response(openstack_responses, + _find_openstack_url(current_line), "get", + _find_openstack_response_content(content[i + 2])) + + return [ + { "file": "nova.yml", "responses": openstack_responses }, + { "file": "aai.yml", "responses": aai_responses } + ] + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='Convert logs to responses YAML tree file.') + parser.add_argument('--log-file', type=argparse.FileType('r'), help="Log file to be parsed", required=True) + parser.add_argument('--aai-ip', help="A&AI IP Address", required=True) + args = parser.parse_args() + + for mock_responses in parse_lines(args.log_file.readlines(), args.aai_ip): + with open(mock_responses["file"], 'w') as yaml_file: + yaml.dump(mock_responses["responses"], yaml_file, default_flow_style=False) diff --git a/test/csit/scripts/multicloud-pike/generic_sim/nova/responses.yml b/test/csit/scripts/multicloud-pike/generic_sim/nova/responses.yml new file mode 100644 index 000000000..944697117 --- /dev/null +++ b/test/csit/scripts/multicloud-pike/generic_sim/nova/responses.yml @@ -0,0 +1,177 @@ +/flavors/110/os-extra_specs: + get: + body: '{"extra_specs": {"hw:cpu_policy": "dedicated", "hw:mem_page_size": + "large", "hw:cpu_sockets": "2", "hw:cpu_threads": "8", "hw:numa_mem.1": + "2048", "hw:numa_mem.0": "2048", "hw:capabilities:cpu_info:features": + "avx,acpi", "aggregate_instance_extra_specs:storage": "local_image", "hw:numa_nodes": + "2", "hw:numa_cpus.0": "0,1", "hw:numa_cpus.1": "2,3,4,5", "hw:cpu_cores": + "4", "hw:cpu_thread_policy": "prefer", "pci_passthrough:alias": "sriov-vf-intel-8086-15b3:4"}}' + content_type: application/json + status_code: 200 +/flavors/111/os-extra_specs: + get: + body: '{"extra_specs": {"aggregate_instance_extra_specs:storage": "local_image"}}' + content_type: application/json + status_code: 200 +/flavors/112/os-extra_specs: + get: + body: '{"extra_specs": {"hw:cpu_policy": "dedicated", "hw:cpu_thread_policy": + "isolate", "aggregate_instance_extra_specs:storage": "local_image"}}' + content_type: application/json + status_code: 200 +/flavors/113/os-extra_specs: + get: + body: '{"extra_specs": {"hw:cpu_cores": "8", "hw:cpu_threads": "16", + "aggregate_instance_extra_specs:storage": "local_image", "hw:cpu_sockets": + "2"}}' + content_type: application/json + status_code: 200 +/flavors/114/os-extra_specs: + get: + body: '{"extra_specs": {"aggregate_instance_extra_specs:storage": "local_image", + "hw:mem_page_size": "small"}}' + content_type: application/json + status_code: 200 +/flavors/115/os-extra_specs: + get: + body: '{"extra_specs": {"hw:numa_mem.1": "1024", "hw:numa_mem.0": "1024", + "aggregate_instance_extra_specs:storage": "local_image", "hw:numa_nodes": + "2", "hw:numa_cpus.0": "0,1", "hw:numa_cpus.1": "2,3"}}' + content_type: application/json + status_code: 200 +/flavors/116/os-extra_specs: + get: + body: '{"extra_specs": {"hw:capabilities:cpu_info:features": "avx,aes", + "aggregate_instance_extra_specs:storage": "local_image"}}' + content_type: application/json + status_code: 200 +/flavors/117/os-extra_specs: + get: + body: '{"extra_specs": {"aggregate_instance_extra_specs:storage": "local_image", + "pci_passthrough:alias": "sriov-vf-intel-8086-15b3:6"}}' + content_type: application/json + status_code: 200 +/flavors/detail: + get: + body: '{"flavors": [{"name": "f.small", "links": [{"href": "http://nova:8080/v2.1/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/100", + "rel": "self"}, {"href": "http://nova:8080/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/100", + "rel": "bookmark"}], "ram": 2048, "OS-FLV-DISABLED:disabled": false, + "vcpus": 2, "swap": "", "os-flavor-access:is_public": true, "rxtx_factor": + 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "disk": 0, "id": "100"}, {"name": + "onap.hpa.all", "links": [{"href": "http://nova:8080/v2.1/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/110", + "rel": "self"}, {"href": "http://nova:8080/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/110", + "rel": "bookmark"}], "ram": 4096, "OS-FLV-DISABLED:disabled": false, + "vcpus": 6, "swap": "", "os-flavor-access:is_public": true, "rxtx_factor": + 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "disk": 0, "id": "110"}, {"name": + "onap.hpa.basic", "links": [{"href": "http://nova:8080/v2.1/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/111", + "rel": "self"}, {"href": "http://nova:8080/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/111", + "rel": "bookmark"}], "ram": 2048, "OS-FLV-DISABLED:disabled": false, + "vcpus": 4, "swap": "", "os-flavor-access:is_public": true, "rxtx_factor": + 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "disk": 0, "id": "111"}, {"name": + "onap.hpa.cpupinning", "links": [{"href": "http://nova:8080/v2.1/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/112", + "rel": "self"}, {"href": "http://nova:8080/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/112", + "rel": "bookmark"}], "ram": 2048, "OS-FLV-DISABLED:disabled": false, + "vcpus": 4, "swap": "", "os-flavor-access:is_public": true, "rxtx_factor": + 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "disk": 0, "id": "112"}, {"name": + "onap.hpa.cputopology", "links": [{"href": "http://nova:8080/v2.1/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/113", + "rel": "self"}, {"href": "http://nova:8080/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/113", + "rel": "bookmark"}], "ram": 2048, "OS-FLV-DISABLED:disabled": false, + "vcpus": 2, "swap": "", "os-flavor-access:is_public": true, "rxtx_factor": + 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "disk": 0, "id": "113"}, {"name": + "onap.hpa.hugepage", "links": [{"href": "http://nova:8080/v2.1/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/114", + "rel": "self"}, {"href": "http://nova:8080/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/114", + "rel": "bookmark"}], "ram": 2048, "OS-FLV-DISABLED:disabled": false, + "vcpus": 2, "swap": "", "os-flavor-access:is_public": true, "rxtx_factor": + 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "disk": 0, "id": "114"}, {"name": + "onap.hpa.numa", "links": [{"href": "http://nova:8080/v2.1/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/115", + "rel": "self"}, {"href": "http://nova:8080/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/115", + "rel": "bookmark"}], "ram": 2048, "OS-FLV-DISABLED:disabled": false, + "vcpus": 4, "swap": "", "os-flavor-access:is_public": true, "rxtx_factor": + 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "disk": 0, "id": "115"}, {"name": + "onap.hpa.instruction", "links": [{"href": "http://nova:8080/v2.1/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/116", + "rel": "self"}, {"href": "http://nova:8080/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/116", + "rel": "bookmark"}], "ram": 2048, "OS-FLV-DISABLED:disabled": false, + "vcpus": 2, "swap": "", "os-flavor-access:is_public": true, "rxtx_factor": + 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "disk": 0, "id": "116"}, {"name": + "onap.hpa.passthrough", "links": [{"href": "http://nova:8080/v2.1/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/117", + "rel": "self"}, {"href": "http://nova:8080/b8f5d85bbcd84af28d7caa62d39f05c7/flavors/117", + "rel": "bookmark"}], "ram": 2048, "OS-FLV-DISABLED:disabled": false, + "vcpus": 2, "swap": "", "os-flavor-access:is_public": true, "rxtx_factor": + 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "disk": 0, "id": "117"}]}' + content_type: application/json + status_code: 200 +/os-availability-zone/detail: + get: + body: '{"availabilityZoneInfo": [{"zoneState": {"available": true}, "hosts": + {"controller-0": {"nova-conductor": {"available": true, "active": true, + "updated_at": "2018-04-27T16:05:25.272674"}, "nova-consoleauth": {"available": + true, "active": true, "updated_at": "2018-04-27T16:05:21.875274"}, "nova-scheduler": + {"available": true, "active": true, "updated_at": "2018-04-27T16:05:25.286846"}}}, + "zoneName": "internal"}, {"zoneState": {"available": false}, "hosts": + null, "zoneName": "nova"}]}' + content_type: application/json + status_code: 200 +/os-hypervisors/detail: + get: + body: '{ + "hypervisors": [{ + "status": "disabled", + "service": { + "host": "compute-0", + "disabled_reason": null, + "id": 11 + }, + "vcpus_used": 0.0, + "hypervisor_type": "QEMU", + "id": 1, + "local_gb_used": 0, + "state": "down", + "hypervisor_hostname": "compute-0", + "host_ip": "192.168.204.162", + "memory_mb": 51562, + "current_workload": 0, + "vcpus": 42, + "free_ram_mb": 51562, + "running_vms": 0, + "free_disk_gb": 1740, + "hypervisor_version": 2010000, + "disk_available_least": 1740, + "local_gb": 1833, + "cpu_info": "{\"vendor\": \"Intel\", \"model\": \"IvyBridge\", \"arch\": \"x86_64\", \"features\": [\"pge\", \"avx\", \"xsaveopt\", \"clflush\", \"sep\", \"syscall\",\"tsc-deadline\",\"dtes64\",\"msr\",\"fsgsbase\",\"xsave\",\"vmx\",\"erms\",\"xtpr\",\"cmov\",\"smep\",\"pcid\",\"est\",\"pat\",\"monitor\",\"smx\",\"pbe\",\"lm\",\"tsc\",\"nx\",\"fxsr\",\"tm\",\"sse4.1\",\"pae\",\"sse4.2\",\"pclmuldq\",\"acpi\",\"vme\",\"popcnt\",\"mmx\",\"osxsave\",\"cx8\",\"mce\",\"de\",\"rdtscp\",\"ht\",\"dca\",\"lahf_lm\",\"pdcm\",\"mca\",\"pdpe1gb\",\"a pic\",\"sse\",\"f16c\",\"pse\",\"ds\",\"invtsc\",\"pni\",\"tm2\",\"aes\",\"sse2\",\"ss\",\"ds_cpl\",\"arat\",\"ssse3\",\"fpu\",\"cx16\",\"pse36\",\"mtrr\",\"rdrand\",\"x2apic\"],\"topology\": {\"cores\": 12,\"cells\": 2,\"threads\": 2,\"sockets\": 1}}", + "memory_mb_used ": 0 + }] +}' + content_type: application/json + status_code: 200 +/os-hypervisors/detail?hypervisor_hostname_pattern=controller-0: + get: + body: '{ + "hypervisors": [{ + "status": "disabled", + "service": { + "host": "compute-0", + "disabled_reason": null, + "id": 11 + }, + "vcpus_used": 0.0, + "hypervisor_type": "QEMU", + "id": 1, + "local_gb_used": 0, + "state": "down", + "hypervisor_hostname": "compute-0", + "host_ip": "192.168.204.162", + "memory_mb": 51562, + "current_workload": 0, + "vcpus": 42, + "free_ram_mb": 51562, + "running_vms": 0, + "free_disk_gb": 1740, + "hypervisor_version": 2010000, + "disk_available_least": 1740, + "local_gb": 1833, + "cpu_info": "{\"vendor\": \"Intel\", \"model\": \"IvyBridge\", \"arch\": \"x86_64\", \"features\": [\"pge\", \"avx\", \"xsaveopt\", \"clflush\", \"sep\", \"syscall\",\"tsc-deadline\",\"dtes64\",\"msr\",\"fsgsbase\",\"xsave\",\"vmx\",\"erms\",\"xtpr\",\"cmov\",\"smep\",\"pcid\",\"est\",\"pat\",\"monitor\",\"smx\",\"pbe\",\"lm\",\"tsc\",\"nx\",\"fxsr\",\"tm\",\"sse4.1\",\"pae\",\"sse4.2\",\"pclmuldq\",\"acpi\",\"vme\",\"popcnt\",\"mmx\",\"osxsave\",\"cx8\",\"mce\",\"de\",\"rdtscp\",\"ht\",\"dca\",\"lahf_lm\",\"pdcm\",\"mca\",\"pdpe1gb\",\"a pic\",\"sse\",\"f16c\",\"pse\",\"ds\",\"invtsc\",\"pni\",\"tm2\",\"aes\",\"sse2\",\"ss\",\"ds_cpl\",\"arat\",\"ssse3\",\"fpu\",\"cx16\",\"pse36\",\"mtrr\",\"rdrand\",\"x2apic\"],\"topology\": {\"cores\": 12,\"cells\": 2,\"threads\": 2,\"sockets\": 1}}", + "memory_mb_used ": 0 + }] +}' + content_type: application/json + status_code: 200 diff --git a/test/csit/scripts/multicloud-pike/generic_sim/requirements.txt b/test/csit/scripts/multicloud-pike/generic_sim/requirements.txt new file mode 100644 index 000000000..ac1d7dd77 --- /dev/null +++ b/test/csit/scripts/multicloud-pike/generic_sim/requirements.txt @@ -0,0 +1,2 @@ +PyYAML +web.py diff --git a/test/csit/scripts/optf-has/has/has-properties/conductor.conf.onap b/test/csit/scripts/optf-has/has/has-properties/conductor.conf.onap index a8e84846c..1f644264b 100644 --- a/test/csit/scripts/optf-has/has/has-properties/conductor.conf.onap +++ b/test/csit/scripts/optf-has/has/has-properties/conductor.conf.onap @@ -252,7 +252,7 @@ music_new_version = True # Base URL for Music REST API without a trailing slash. (string value) server_url = http://localhost:8080/MUSIC/rest/v2 version = v2 -music_version = "2.4.22" +music_version = "3.0.3" aafuser = conductor aafpass = c0nduct0r aafns = conductor diff --git a/test/csit/scripts/optf-has/has/has_script.sh b/test/csit/scripts/optf-has/has/has_script.sh index ee5479e10..08bf0bcb0 100755 --- a/test/csit/scripts/optf-has/has/has_script.sh +++ b/test/csit/scripts/optf-has/has/has_script.sh @@ -63,6 +63,10 @@ echo "MULTICLOUDSIM_IP=${MULTICLOUDSIM_IP}" sed -i -e "s%msb.onap.org:8082/%${MULTICLOUDSIM_IP}:8082/%g" /tmp/conductor/properties/conductor.conf #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" --data @${WORKSPACE}/test/csit/tests/optf-has/has/data/onboard.json docker run -d --name cond-cont -v ${COND_CONF}:/usr/local/bin/conductor.conf -v ${LOG_CONF}:/usr/local/bin/log.conf ${IMAGE_NAME}:latest python /usr/local/bin/conductor-controller --config-file=/usr/local/bin/conductor.conf diff --git a/test/csit/scripts/optf-has/has/music_script.sh b/test/csit/scripts/optf-has/has/music_script.sh index fdd9a3e26..1e978c2f9 100755 --- a/test/csit/scripts/optf-has/has/music_script.sh +++ b/test/csit/scripts/optf-has/has/music_script.sh @@ -51,10 +51,10 @@ docker run -d --name music-db --network music-net -p "7000:7000" -p "7001:7001" CASSA_IP=`docker inspect -f '{{ $network := index .NetworkSettings.Networks "music-net" }}{{ $network.IPAddress}}' music-db` echo "CASSANDRA_IP=${CASSA_IP}" ${WORKSPACE}/test/csit/scripts/optf-has/has/wait_for_port.sh ${CASSA_IP} 9042 - +sleep 60 # Start Music war docker run -d --name music-war -v music-vol:/app ${MUSIC_IMG}; - +sleep 15 # Start Zookeeper docker run -d --name music-zk --network music-net -p "2181:2181" -p "2888:2888" -p "3888:3888" ${ZK_IMG}; #ZOO_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' music-zk` @@ -80,7 +80,7 @@ echo "TOMCAT_IP=${TOMCAT_IP}" ${WORKSPACE}/test/csit/scripts/optf-has/has/wait_for_port.sh ${TOMCAT_IP} 8080 # wait a while to make sure music is totally up and configured -sleep 10 +sleep 60 echo "inspect docker things for tracing purpose" docker inspect music-db diff --git a/test/csit/scripts/policy/script1.sh b/test/csit/scripts/policy/script1.sh index d2229aae8..7bb9731c8 100755 --- a/test/csit/scripts/policy/script1.sh +++ b/test/csit/scripts/policy/script1.sh @@ -160,7 +160,7 @@ INTERVAL=20 TIME=0 while [ "$TIME" -lt "$TIME_OUT" ]; do - curl -i -v -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'ClientAuth: cHl0aG9uOnRlc3Q=' -H 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' -H 'Environment: TEST' -X POST -d '{"policyName": ".*"}' http://${PDP_IP}:8081/pdp/api/getConfig && break + curl -k -i -v -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'ClientAuth: cHl0aG9uOnRlc3Q=' -H 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' -H 'Environment: TEST' -X POST -d '{"policyName": ".*"}' https://${PDP_IP}:8081/pdp/api/getConfig && break echo Sleep: $INTERVAL seconds before testing if Policy is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds sleep $INTERVAL diff --git a/test/csit/scripts/vid/start_vid_containers.sh b/test/csit/scripts/vid/start_vid_containers.sh index d7f6e38ca..c4bdae2de 100644 --- a/test/csit/scripts/vid/start_vid_containers.sh +++ b/test/csit/scripts/vid/start_vid_containers.sh @@ -20,23 +20,13 @@ # ============LICENSE_END============================================ # =================================================================== # ECOMP is a trademark and service mark of AT&T Intellectual Property. -# echo "This is ${WORKSPACE}/test/csit/scripts/vid/start_vid_containers.sh" - -RELEASE=vid:1.1-STAGING-latest -CONFIG_PATH=${WORKSPACE}/data/clone/vid/lf_config - export IP=`ifconfig eth0 | awk -F: '/inet addr/ {gsub(/ .*/,"",$2); print $2}'` -export PREFIX='nexus3.onap.org:10001/openecomp' - -#start Maria-DB -docker run --name vid-mariadb -e MYSQL_DATABASE=vid_openecomp_epsdk -e MYSQL_USER=vidadmin -e MYSQL_PASSWORD=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U -e MYSQL_ROOT_PASSWORD=LF+tp_1WqgSY -v ${CONFIG_PATH}/vid-my.cnf:/etc/mysql/my.cnf -v ${CONFIG_PATH}/vid-pre-init.sql:/docker-entrypoint-initdb.d/vid-pre-init.sql -v /var/lib/mysql -d mariadb:10 - -#start VID server -docker run -e VID_MYSQL_DBNAME=vid_openecomp_epsdk -e VID_MYSQL_PASS=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U --name vid-server -p 8080:8080 --link vid-mariadb:vid-mariadb-docker-instance -d nexus3.onap.org:10001/openecomp/${RELEASE} +cd ${WORKSPACE}/test/csit/tests/vid/resources +docker-compose up -d --build # WAIT 5 minutes maximum and test every 5 seconds if VID up using HealthCheck API diff --git a/test/csit/tests/clamp/APIs/01__Create_CL_Holmes.robot b/test/csit/tests/clamp/APIs/01__Create_CL_Holmes.robot index 1f5473833..ce4c8df66 100644 --- a/test/csit/tests/clamp/APIs/01__Create_CL_Holmes.robot +++ b/test/csit/tests/clamp/APIs/01__Create_CL_Holmes.robot @@ -17,7 +17,7 @@ Create the sessions *** Test Cases *** Get Requests health check ok Create the sessions - ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/healthcheck + ${resp}= Get Request ${clamp_session} /restservices/clds/v1/healthcheck Should Be Equal As Strings ${resp.status_code} 200 Get Requests verify test template found diff --git a/test/csit/tests/clamp/APIs/02__Create_CL_TCA.robot b/test/csit/tests/clamp/APIs/02__Create_CL_TCA.robot index 213c231b8..15ab4b168 100644 --- a/test/csit/tests/clamp/APIs/02__Create_CL_TCA.robot +++ b/test/csit/tests/clamp/APIs/02__Create_CL_TCA.robot @@ -10,14 +10,14 @@ ${passw} password *** Test Cases *** Get Requests health check ok - ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/healthcheck + ${resp}= Get Request ${clamp_session} /restservices/clds/v1/healthcheck Should Be Equal As Strings ${resp.status_code} 200 Get Requests verify test template found ${resp}= Get Request ${clamp_session} /restservices/clds/v1/cldsTempate/template-names Should Be Equal As Strings ${resp.status_code} 200 Should Contain Match ${resp} *templateTCA1* - Should Contain Match ${resp} *templateTCA2* + Should Contain Match ${resp} *CA2* Should Not Contain Match ${resp} *templateTCA99* Put Requests to add Close Loop ClHolmes1 diff --git a/test/csit/tests/clamp/APIs/03__VariousApis.robot b/test/csit/tests/clamp/APIs/03__VariousApis.robot index 50dd78e16..f32728396 100644 --- a/test/csit/tests/clamp/APIs/03__VariousApis.robot +++ b/test/csit/tests/clamp/APIs/03__VariousApis.robot @@ -10,9 +10,9 @@ ${passw} password *** Test Cases *** Get Clamp properties - ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/properties - Dictionary Should Contain Key ${resp.json()} global - Dictionary Should Contain Key ${resp.json()['global']} location + ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/cldsInfo + Dictionary Should Contain Key ${resp.json()} userName + Dictionary Should Contain Key ${resp.json()} permissionReadCl Get Clamp Info ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/cldsInfo diff --git a/test/csit/tests/clamp/APIs/04__Verify_API_Models.robot b/test/csit/tests/clamp/APIs/04__Verify_API_Models.robot index 7b9e2bc16..42c5c43d6 100644 --- a/test/csit/tests/clamp/APIs/04__Verify_API_Models.robot +++ b/test/csit/tests/clamp/APIs/04__Verify_API_Models.robot @@ -51,7 +51,7 @@ Verify TCAModel2 Should Contain Match ${resp} *DC2* Should Contain Match ${resp} *DC3* Should Contain Match ${resp} *Policy4* - Should Contain Match ${resp} *vLoadBalancer* + Should Contain Match ${resp} *tcaPol* Should Contain Match ${resp} *345* Should Contain Match ${resp} *300* Should Contain Match ${resp} *VM* diff --git a/test/csit/tests/clamp/UIs/01__Create_Holmes_model.robot b/test/csit/tests/clamp/UIs/01__Create_Holmes_model.robot index c9b7d8c06..305044cb0 100644 --- a/test/csit/tests/clamp/UIs/01__Create_Holmes_model.robot +++ b/test/csit/tests/clamp/UIs/01__Create_Holmes_model.robot @@ -3,7 +3,7 @@ Library Collections Library RequestsLibrary Library OperatingSystem Library json -Library Selenium2Library +Library ../../../scripts/clamp/python-lib/CustomSeleniumLibrary.py Library XvfbRobot *** Variables *** @@ -22,19 +22,23 @@ Create the sessions *** Test Cases *** Get Requests health check ok Create the sessions - ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/healthcheck + ${resp}= Get Request ${clamp_session} /restservices/clds/v1/healthcheck Should Be Equal As Strings ${resp.status_code} 200 Open Browser # Next line is to be enabled for Headless tests only (jenkins?). To see the tests disable the line. Start Virtual Display 1920 1080 - Open Browser ${BASE_URL}/designer/index.html browser=firefox Set Selenium Speed ${SELENIUM_SPEED_SLOW} + Open Browser ${BASE_URL}/designer/index.html browser=firefox + +Reply to authentication popup + Run Keyword And Ignore Error Insert into prompt ${login} ${passw} + Confirm action + +Good Login to Clamp UI and Verify logged in Set Window Size 1920 1080 ${title}= Get Title Should Be Equal CLDS ${title} - -Good Login to Clamp UI and Verify logged in Wait Until Element Is Visible xpath=//*[@class="navbar-brand logo_name ng-binding"] timeout=60 Element Text Should Be xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=Hello:admin @@ -88,8 +92,3 @@ Save Model from Menu Close Browser Close Browser - -Verify Holmes CL well created - ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/model-names - Should Contain Match ${resp} *HolmesModel1* - Should Not Contain Match ${resp} *HolmesModel99* diff --git a/test/csit/tests/clamp/UIs/02__Create_TCA_model.robot b/test/csit/tests/clamp/UIs/02__Create_TCA_model.robot index 7ee275773..0dc0a8abb 100644 --- a/test/csit/tests/clamp/UIs/02__Create_TCA_model.robot +++ b/test/csit/tests/clamp/UIs/02__Create_TCA_model.robot @@ -3,7 +3,7 @@ Library Collections Library RequestsLibrary Library OperatingSystem Library json -Library Selenium2Library +Library ../../../scripts/clamp/python-lib/CustomSeleniumLibrary.py Library XvfbRobot *** Variables *** @@ -15,19 +15,23 @@ ${BASE_URL} https://localhost:8443 *** Test Cases *** Get Requests health check ok - ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/healthcheck + ${resp}= Get Request ${clamp_session} /restservices/clds/v1/healthcheck Should Be Equal As Strings ${resp.status_code} 200 Open Browser # Next line is to be enabled for Headless tests only (jenkins?). To see the tests disable the line. Start Virtual Display 1920 1080 - Open Browser ${BASE_URL}/designer/index.html browser=firefox Set Selenium Speed ${SELENIUM_SPEED_SLOW} + Open Browser ${BASE_URL}/designer/index.html browser=firefox + +Reply to authentication popup + Run Keyword And Ignore Error Insert into prompt ${login} ${passw} + Confirm action + +Good Login to Clamp UI and Verify logged in Set Window Size 1920 1080 ${title}= Get Title Should Be Equal CLDS ${title} - -Good Login to Clamp UI and Verify logged in Wait Until Element Is Visible xpath=//*[@class="navbar-brand logo_name ng-binding"] timeout=60 Element Text Should Be xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=Hello:admin @@ -88,8 +92,3 @@ Save Model from Menu Close Browser Close Browser - -Verify TCA CL well create - ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/model-names - Should Contain Match ${resp} *TCAModel1* - Should Not Contain Match ${resp} *TCAModel99* diff --git a/test/csit/tests/clamp/UIs/03__Verify_UI_Models.robot b/test/csit/tests/clamp/UIs/03__Verify_UI_Models.robot index 9116964b6..66bc3b15f 100644 --- a/test/csit/tests/clamp/UIs/03__Verify_UI_Models.robot +++ b/test/csit/tests/clamp/UIs/03__Verify_UI_Models.robot @@ -9,6 +9,16 @@ ${login} admin ${passw} password *** Test Cases *** +Verify Holmes CL well created + ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/model-names + Should Contain Match ${resp} *HolmesModel1* + Should Not Contain Match ${resp} *HolmesModel99* + +Verify TCA CL well create + ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/model-names + Should Contain Match ${resp} *TCAModel1* + Should Not Contain Match ${resp} *TCAModel99* + Verify HolmesModel1 ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/model/HolmesModel1 Should Contain Match ${resp} *templateHolmes1* @@ -25,7 +35,7 @@ Verify HolmesModel1 Verify TCAModel1 ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/model/TCAModel1 Should Contain Match ${resp} *templateTCA1* - Should Contain Match ${resp} *c95b0e7c-c1f0-4287-9928-7964c5377a46* + Should Contain Match ${resp} *DESIGN* Should Contain Match ${resp} *vnfRecipe* Should Contain Match ${resp} *DC1* Should Contain Match ${resp} *DC3* diff --git a/test/csit/tests/clamp/UIs/04__Submit_deploy_chain_Holmes.robot b/test/csit/tests/clamp/UIs/04__Submit_deploy_chain_Holmes.robot index a6ccb9947..de10a27c5 100644 --- a/test/csit/tests/clamp/UIs/04__Submit_deploy_chain_Holmes.robot +++ b/test/csit/tests/clamp/UIs/04__Submit_deploy_chain_Holmes.robot @@ -3,7 +3,7 @@ Library Collections Library RequestsLibrary Library OperatingSystem Library json -Library Selenium2Library +Library ../../../scripts/clamp/python-lib/CustomSeleniumLibrary.py Library XvfbRobot *** Variables *** @@ -15,19 +15,23 @@ ${BASE_URL} https://localhost:8443 *** Test Cases *** Get Requests health check ok - ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/healthcheck + ${resp}= Get Request ${clamp_session} /restservices/clds/v1/healthcheck Should Be Equal As Strings ${resp.status_code} 200 Open Browser # Next line is to be enabled for Headless tests only (jenkins?). To see the tests disable the line. Start Virtual Display 1920 1080 - Open Browser ${BASE_URL}/designer/index.html browser=firefox Set Selenium Speed ${SELENIUM_SPEED_SLOW} + Open Browser ${BASE_URL}/designer/index.html browser=firefox + +Reply to authentication popup + Run Keyword And Ignore Error Insert into prompt ${login} ${passw} + Confirm action + +Good Login to Clamp UI and Verify logged in Set Window Size 1920 1080 ${title}= Get Title Should Be Equal CLDS ${title} - -Good Login to Clamp UI and Verify logged in Wait Until Element Is Visible xpath=//*[@class="navbar-brand logo_name ng-binding"] timeout=60 Element Text Should Be xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=Hello:admin diff --git a/test/csit/tests/clamp/UIs/05__Submit_deploy_chain_TCA.robot b/test/csit/tests/clamp/UIs/05__Submit_deploy_chain_TCA.robot index 6330ead92..2b95530ae 100644 --- a/test/csit/tests/clamp/UIs/05__Submit_deploy_chain_TCA.robot +++ b/test/csit/tests/clamp/UIs/05__Submit_deploy_chain_TCA.robot @@ -3,7 +3,7 @@ Library Collections Library RequestsLibrary Library OperatingSystem Library json -Library Selenium2Library +Library ../../../scripts/clamp/python-lib/CustomSeleniumLibrary.py Library XvfbRobot *** Variables *** @@ -15,19 +15,23 @@ ${BASE_URL} https://localhost:8443 *** Test Cases *** Get Requests health check ok - ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/healthcheck + ${resp}= Get Request ${clamp_session} /restservices/clds/v1/healthcheck Should Be Equal As Strings ${resp.status_code} 200 Open Browser # Next line is to be enabled for Headless tests only (jenkins?). To see the tests disable the line. Start Virtual Display 1920 1080 - Open Browser ${BASE_URL}/designer/index.html browser=firefox Set Selenium Speed ${SELENIUM_SPEED_SLOW} + Open Browser ${BASE_URL}/designer/index.html browser=firefox + +Reply to authentication popup + Run Keyword And Ignore Error Insert into prompt ${login} ${passw} + Confirm action + +Good Login to Clamp UI and Verify logged in Set Window Size 1920 1080 ${title}= Get Title Should Be Equal CLDS ${title} - -Good Login to Clamp UI and Verify logged in Wait Until Element Is Visible xpath=//*[@class="navbar-brand logo_name ng-binding"] timeout=60 Element Text Should Be xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=Hello:admin diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/__init__.robot b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/__init__.robot new file mode 100644 index 000000000..c0a96dbc4 --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/__init__.robot @@ -0,0 +1,56 @@ +*** Settings *** +Library DcaeAppSimulatorLibrary +Library ConsulLibrary +Library VesHvContainersUtilsLibrary + +Suite Setup HV-VES Collector Suites Setup + +*** Keywords *** +HV-VES Collector Suites Setup + Log Started Suite: HV-VES + Configure collector + Configure Dcae App + Log Suite setup finished + + +Configure collector + ${CONSUL_API_ACCESS}= Get Consul Api Access Url ${HTTP_METHOD_URL} ${CONSUL_CONTAINER_HOST} ${CONSUL_CONTAINER_PORT} + ${CONSUL_API_URL}= Catenate SEPARATOR= ${CONSUL_API_ACCESS} ${CONSUL_VES_HV_CONFIGURATION_KEY_PATH} + Publish HV VES Configuration In Consul ${CONSUL_API_URL} ${VES_HV_CONFIGURATION_JSON_FILEPATH} + +Configure Dcae App + ${DCAE_APP_API_ACCESS}= Get Dcae App Api Access Url ${HTTP_METHOD_URL} ${DCAE_APP_CONTAINER_HOST} ${DCAE_APP_CONTAINER_PORT} + + ${DCAE_APP_API_MESSAGE_RESET_URL}= Catenate SEPARATOR= ${DCAE_APP_API_ACCESS} ${DCAE_APP_API_MESSAGES_RESET_PATH} + Set Suite Variable ${DCAE_APP_API_MESSAGE_RESET_URL} children=True + + ${DCAE_APP_API_MESSAGES_COUNT_URL}= Catenate SEPARATOR= ${DCAE_APP_API_ACCESS} ${DCAE_APP_API_MESSAGES_COUNT_PATH} + Set Suite Variable ${DCAE_APP_API_MESSAGES_COUNT_URL} children=True + + ${DCAE_APP_API_MESSAGES_VALIDATION_URL}= Catenate SEPARATOR= ${DCAE_APP_API_ACCESS} ${DCAE_APP_API_MESSAGES_VALIDATION_PATH} + Set Suite Variable ${DCAE_APP_API_MESSAGES_VALIDATION_URL} children=True + + ${DCAE_APP_API_TOPIC_CONFIGURATION_URL}= Catenate SEPARATOR= ${DCAE_APP_API_ACCESS} ${DCAE_APP_API_TOPIC_CONFIGURATION_PATH} + Wait until keyword succeeds 10 sec 5 sec + ... Configure Dcae App Simulator To Consume Messages From Topics ${DCAE_APP_API_TOPIC_CONFIGURATION_URL} ${ROUTED_MESSAGES_TOPIC} + + +*** Variables *** +${HTTP_METHOD_URL} http:// + +${CONSUL_CONTAINER_HOST} consul +${CONSUL_CONTAINER_PORT} 8500 +${CONSUL_VES_HV_CONFIGURATION_KEY_PATH} /v1/kv/veshv-config + +${DCAE_APP_CONTAINER_HOST} dcae-app-simulator +${DCAE_APP_CONTAINER_PORT} 6063 +${DCAE_APP_API_TOPIC_CONFIGURATION_PATH} /configuration/topics +${DCAE_APP_API_MESSAGES_RESET_PATH} /messages +${DCAE_APP_API_MESSAGES_PATH} /messages/all +${DCAE_APP_API_MESSAGES_COUNT_PATH} ${DCAE_APP_API_MESSAGES_PATH}/count +${DCAE_APP_API_MESSAGES_VALIDATION_PATH} ${DCAE_APP_API_MESSAGES_PATH}/validate + +${ROUTED_MESSAGES_TOPIC} test-hv-ran-meas + +${VES_HV_RESOURCES} %{WORKSPACE}/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources +${VES_HV_CONFIGURATION_JSON_FILEPATH} ${VES_HV_RESOURCES}/ves-hv-configuration.json diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/authorization.robot b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/authorization.robot new file mode 100644 index 000000000..1b832f27d --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/authorization.robot @@ -0,0 +1,35 @@ +*** Settings *** +Library DcaeAppSimulatorLibrary + +Resource resources/common-keywords.robot + +Suite Setup Client Authorization Suite Setup +Suite Teardown VES-HV Collector Suite Teardown +Test Teardown VES-HV Collector Test Shutdown + +*** Keywords *** +Client Authorization Suite Setup + Log Started Suite: VES-HV Client Authorization + ${XNF_PORTS_LIST}= Create List 7000 + Configure Invalid xNF Simulators On Ports ${XNF_PORTS_LIST} + Log Suite setup finished + + +*** Test Cases *** +Authorization + [Documentation] VES-HV Collector should not authorize XNF with invalid certificate and not route any message + ... to topics + + ${SIMULATORS_LIST}= Get Invalid xNF Simulators 1 + Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_VALID_MESSAGES_REQUEST} + + Wait until keyword succeeds 60 sec 5 sec + ... Assert Dcae App Consumed ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_0} + + +*** Variables *** +${VES_HV_SCENARIOS} %{WORKSPACE}/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios + +${XNF_VALID_MESSAGES_REQUEST} ${VES_HV_SCENARIOS}/authorization/xnf-valid-messages-request.json + +${AMOUNT_0} 0 diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/ConsulLibrary.py b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/ConsulLibrary.py new file mode 100644 index 000000000..52d7e0eab --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/ConsulLibrary.py @@ -0,0 +1,16 @@ +from robot.api import logger +import HttpRequests + +CONSUL_NAME = "Consul" + +class ConsulLibrary: + + def publish_hv_ves_configuration_in_consul(self, consul_url, consul_configuration_filepath): + logger.info("Reading consul configuration file from: " + consul_configuration_filepath) + file = open(consul_configuration_filepath, "rb") + data = file.read() + file.close() + + logger.info("PUT at: " + consul_url) + resp = HttpRequests.session_without_env().put(consul_url, data=data, timeout=5) + HttpRequests.checkStatusCode(resp.status_code, CONSUL_NAME)
\ No newline at end of file diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/DcaeAppSimulatorLibrary.py b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/DcaeAppSimulatorLibrary.py new file mode 100644 index 000000000..ab3b1e21d --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/DcaeAppSimulatorLibrary.py @@ -0,0 +1,46 @@ +import HttpRequests +from robot.api import logger + +DCAE_APP_NAME = "DCAE App" + + +class DcaeAppSimulatorLibrary: + + def configure_dcae_app_simulator_to_consume_messages_from_topics(self, app_url, topics): + logger.info("PUT at: " + app_url) + resp = HttpRequests.session_without_env().put(app_url, data={'topics': topics}, timeout=5) + HttpRequests.checkStatusCode(resp.status_code, DCAE_APP_NAME) + + def assert_DCAE_app_consumed(self, app_url, expected_messages_amount): + logger.info("GET at: " + app_url) + resp = HttpRequests.session_without_env().get(app_url, timeout=5) + HttpRequests.checkStatusCode(resp.status_code, DCAE_APP_NAME) + + assert resp.content == expected_messages_amount, \ + "Messages consumed by simulator: " + resp.content + " expecting: " + expected_messages_amount + + def assert_DCAE_app_consumed_less_equal_than(self, app_url, messages_threshold): + logger.info("GET at: " + app_url) + resp = HttpRequests.session_without_env().get(app_url, timeout=5) + HttpRequests.checkStatusCode(resp.status_code, DCAE_APP_NAME) + + logger.debug("Messages consumed by simulator: " + resp.content + + " expecting more than 0 and less/equal than " + messages_threshold) + + assert 0 < int(resp.content) <= int(messages_threshold), \ + "Messages consumed by simulator: " + resp.content + \ + " expecting more than 0 and less/equal than " + messages_threshold + + def reset_DCAE_app_simulator(self, app_url): + logger.info("DELETE at: " + app_url) + resp = HttpRequests.session_without_env().delete(app_url, timeout=5) + HttpRequests.checkStatusCode(resp.status_code, DCAE_APP_NAME) + + def assert_DCAE_app_consumed_proper_messages(self, app_url, message_filepath): + logger.info("POST at: " + app_url) + file = open(message_filepath, "rb") + data = file.read() + file.close() + + resp = HttpRequests.session_without_env().post(app_url, data=data, timeout=5) + HttpRequests.checkStatusCode(resp.status_code, DCAE_APP_NAME) diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/HttpRequests.py b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/HttpRequests.py new file mode 100644 index 000000000..0d1d928b5 --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/HttpRequests.py @@ -0,0 +1,12 @@ +import requests +from robot.api import logger + +def session_without_env(): + session = requests.Session() + session.trust_env = False + return session + +def checkStatusCode(status_code, server_name): + if status_code != 200: + logger.error("Response status code from " + server_name + ": " + str(status_code)) + raise (Exception(server_name + " returned status code " + status_code))
\ No newline at end of file diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/VesHvContainersUtilsLibrary.py b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/VesHvContainersUtilsLibrary.py new file mode 100644 index 000000000..989a796ce --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/VesHvContainersUtilsLibrary.py @@ -0,0 +1,69 @@ +from time import time + +from robot.api import logger +import os.path +import docker +from io import BytesIO +from os.path import basename +from tarfile import TarFile, TarInfo + +LOCALHOST = "localhost" + + +class VesHvContainersUtilsLibrary: + + def get_consul_api_access_url(self, method, image_name, port): + return self.create_url( + method, + self.get_instance_address(image_name, port) + ) + + def get_xnf_sim_api_access_url(self, method, host): + if is_running_inside_docker(): + return self.create_url(method, host) + else: + logger.info("File `/.dockerenv` not found. Assuming local environment and using localhost.") + port_from_container_name = str(host)[-4:] + return self.create_url(method, LOCALHOST + ":" + port_from_container_name) + + def get_dcae_app_api_access_url(self, method, image_name, port): + return self.create_url( + method, + self.get_instance_address(image_name, port) + ) + + def get_instance_address(self, image_name, port): + if is_running_inside_docker(): + return image_name + ":" + port + else: + logger.info("File `/.dockerenv` not found. Assuming local environment and using localhost.") + return LOCALHOST + ":" + port + + def create_url(self, method, host_address): + return method + host_address + +def is_running_inside_docker(): + return os.path.isfile("/.dockerenv") + +def copy_to_container(container_id, filepaths, path='/etc/ves-hv'): + with create_archive(filepaths) as archive: + docker.APIClient('unix:///var/run/docker.sock') \ + .put_archive(container=container_id, path=(path), data=archive) + + +def create_archive(filepaths): + tarstream = BytesIO() + tarfile = TarFile(fileobj=tarstream, mode='w') + for filepath in filepaths: + file = open(filepath, 'r') + file_data = file.read() + + tarinfo = TarInfo(name=basename(file.name)) + tarinfo.size = len(file_data) + tarinfo.mtime = time() + + tarfile.addfile(tarinfo, BytesIO(file_data)) + + tarfile.close() + tarstream.seek(0) + return tarstream diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/XnfSimulatorLibrary.py b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/XnfSimulatorLibrary.py new file mode 100644 index 000000000..b2466d7ca --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/XnfSimulatorLibrary.py @@ -0,0 +1,126 @@ +from VesHvContainersUtilsLibrary import copy_to_container +import HttpRequests +import os +import docker +from robot.api import logger +from time import sleep + +XNF_SIMULATOR_NAME = "xNF Simulator" +SIMULATOR_IMAGE_NAME = "onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-xnf-simulator" +SIMULATOR_IMAGE_FULL_NAME = os.getenv("DOCKER_REGISTRY") + "/" + SIMULATOR_IMAGE_NAME + ":latest" +WORKSPACE_ENV = os.getenv("WORKSPACE") +certificates_dir_path = WORKSPACE_ENV + "/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/ssl/" +collector_certs_lookup_dir = "/etc/ves-hv/" +ONE_SECOND_IN_NANOS = 10 ** 9 + + +class XnfSimulatorLibrary: + + def start_xnf_simulators(self, list_of_ports, valid_certs=True): + logger.info("Creating " + str(len(list_of_ports)) + " xNF Simulator containers") + dockerClient = docker.from_env() + cert_name_prefix = "" if valid_certs else "invalid_" + self.pullImageIfAbsent(dockerClient) + logger.info("Using image: " + SIMULATOR_IMAGE_FULL_NAME) + simulators_addresses = self.create_simulators(dockerClient, list_of_ports, cert_name_prefix) + self.assert_containers_startup_was_successful(dockerClient) + dockerClient.close() + return simulators_addresses + + def pullImageIfAbsent(self, dockerClient): + try: + dockerClient.images.get(SIMULATOR_IMAGE_FULL_NAME) + except: + logger.console("Image " + SIMULATOR_IMAGE_FULL_NAME + " will be pulled from repository. " + "This can take a while.") + dockerClient.images.pull(SIMULATOR_IMAGE_FULL_NAME) + + def create_simulators(self, dockerClient, list_of_ports, cert_name_prefix): + simulators_addresses = [] + for port in list_of_ports: + container = self.run_simulator(dockerClient, port, + collector_certs_lookup_dir + cert_name_prefix + "client.crt", + collector_certs_lookup_dir + cert_name_prefix + "client.key", + collector_certs_lookup_dir + cert_name_prefix + "trust.crt" + ) + + logger.info("Started container: " + container.name + " " + container.id) + simulators_addresses.append(container.name + ":" + port) + return simulators_addresses + + def run_simulator(self, dockerClient, port, client_crt_path, client_key_path, client_trust_store): + xNF_startup_command = ["--listen-port", port, + "--ves-host", "ves-hv-collector", + "--ves-port", "6061", + "--cert-file", client_crt_path, + "--private-key-file", client_key_path, + "--trust-cert-file", client_trust_store] + xNF_healthcheck_command = { + "interval": 5 * ONE_SECOND_IN_NANOS, + "timeout": 3 * ONE_SECOND_IN_NANOS, + "retries": 1, + "test": ["CMD", "curl", "--request", "GET", + "--fail", "--silent", "--show-error", + "localhost:" + port + "/healthcheck"] + } + logger.info("Startup command: " + str(xNF_startup_command)) + logger.info("Healthcheck command: " + str(xNF_healthcheck_command)) + return dockerClient.containers.run(SIMULATOR_IMAGE_FULL_NAME, + command=xNF_startup_command, + healthcheck=xNF_healthcheck_command, + detach=True, + network="ves-hv-default", + ports={port + "/tcp": port}, + volumes=self.container_volumes(), + name="ves-hv-collector-xnf-simulator" + port) + + def container_volumes(self): + return {certificates_dir_path: {"bind": collector_certs_lookup_dir, "mode": 'rw'}} + + def assert_containers_startup_was_successful(self, dockerClient): + checks_amount = 6 + check_interval_in_seconds = 5 + for _ in range(checks_amount): + sleep(check_interval_in_seconds) + all_containers_healthy = True + for container in self.get_simulators_list(dockerClient): + all_containers_healthy = all_containers_healthy and self.is_container_healthy(container) + if (all_containers_healthy): + return + raise ContainerException("One of xNF simulators containers did not pass the healthcheck.") + + def is_container_healthy(self, container): + container_health = container.attrs['State']['Health']['Status'] + return container_health == 'healthy' and container.status == 'running' + + def stop_and_remove_all_xnf_simulators(self, suite_name): + dockerClient = docker.from_env() + for container in self.get_simulators_list(dockerClient): + logger.info("Stopping and removing container: " + container.id) + log_filename = WORKSPACE_ENV + "/archives/containers_logs/" + \ + suite_name.split(".")[-1] + "_" + container.name + ".log" + file = open(log_filename, "w+") + file.write(container.logs()) + file.close() + container.stop() + container.remove() + dockerClient.close() + + def get_simulators_list(self, dockerClient): + return dockerClient.containers.list(filters={"ancestor": SIMULATOR_IMAGE_FULL_NAME}, all=True) + + def send_messages(self, simulator_url, message_filepath): + logger.info("Reading message to simulator from: " + message_filepath) + + file = open(message_filepath, "rb") + data = file.read() + file.close() + + logger.info("POST at: " + simulator_url) + resp = HttpRequests.session_without_env().post(simulator_url, data=data, timeout=5) + HttpRequests.checkStatusCode(resp.status_code, XNF_SIMULATOR_NAME) + + +class ContainerException(Exception): + def __init__(self, message): + super(ContainerException, self).__init__(message) diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/message-routing.robot b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/message-routing.robot new file mode 100644 index 000000000..6153afa0a --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/message-routing.robot @@ -0,0 +1,93 @@ +*** Settings *** +Library DcaeAppSimulatorLibrary +Library XnfSimulatorLibrary +Library VesHvContainersUtilsLibrary +Library Collections + +Resource resources/common-keywords.robot + +Suite Setup Message Routing Suite Setup +Suite Teardown VES-HV Collector Suite Teardown +Test Teardown VES-HV Collector Test Shutdown + +*** Keywords *** +Message Routing Suite Setup + Log Started Suite: VES-HV Message Routing + ${XNF_PORTS_LIST}= Create List 7000 + Configure Valid xNF Simulators On Ports ${XNF_PORTS_LIST} + Log Suite setup finished + +*** Test Cases *** +Correct Messages Routing + [Documentation] VES-HV Collector should route all valid messages to topics specified in configuration + ... and do not change message payload generated in XNF simulator + + ${SIMULATORS_LIST}= Get Valid xNF Simulators 1 + Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_FIXED_PAYLOAD_REQUEST} + + Wait until keyword succeeds 60 sec 5 sec + ... Assert Dcae App Consumed ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_25000} + Assert Dcae App Consumed Proper Messages ${DCAE_APP_API_MESSAGES_VALIDATION_URL} ${DCAE_FIXED_PAYLOAD_REQUEST} + + +Too big payload message handling + [Documentation] VES-HV Collector should interrupt the stream when encountered message with too big payload + + ${SIMULATORS_LIST}= Get Valid xNF Simulators 1 + Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_TOO_BIG_PAYLOAD_REQUEST} + + Wait until keyword succeeds 60 sec 5 sec + ... Assert Dcae App Consumed Less Equal Than ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_25000} + + +Invalid wire frame message handling + [Documentation] VES-HV Collector should skip messages with invalid wire frame + + ${SIMULATORS_LIST}= Get Valid xNF Simulators 1 + Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_INVALID_WIRE_FRAME_REQUEST} + + Wait until keyword succeeds 60 sec 5 sec + ... Assert Dcae App Consumed ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_50000} + Assert Dcae App Consumed Proper Messages ${DCAE_APP_API_MESSAGES_VALIDATION_URL} ${DCAE_INVALID_WIRE_FRAME_REQUEST} + + +Invalid GPB data message handling + [Documentation] VES-HV Collector should skip messages with invalid GPB data + + ${SIMULATORS_LIST}= Get Valid xNF Simulators 1 + Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_INVALID_GPB_DATA_REQUEST} + + Wait until keyword succeeds 60 sec 5 sec + ... Assert Dcae App Consumed ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_50000} + Assert Dcae App Consumed Proper Messages ${DCAE_APP_API_MESSAGES_VALIDATION_URL} ${DCAE_INVALID_GPB_DATA_REQUEST} + + +Unsupported domain message handling + [Documentation] VES-HV Collector should skip messages with unsupported domain + + ${SIMULATORS_LIST}= Get Valid xNF Simulators 1 + Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_UNSUPPORTED_DOMAIN_REQUEST} + + Wait until keyword succeeds 60 sec 5 sec + ... Assert Dcae App Consumed ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_50000} + Assert Dcae App Consumed Proper Messages ${DCAE_APP_API_MESSAGES_VALIDATION_URL} ${DCAE_UNSUPPORTED_DOMAIN_REQUEST} + +*** Variables *** +${HTTP_METHOD_URL} http:// + +${XNF_SIM_API_PATH} /simulator/async + +${VES_HV_SCENARIOS} %{WORKSPACE}/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios +${XNF_FIXED_PAYLOAD_REQUEST} ${VES_HV_SCENARIOS}/fixed-payload/xnf-fixed-payload-request.json +${XNF_TOO_BIG_PAYLOAD_REQUEST} ${VES_HV_SCENARIOS}/too-big-payload/xnf-too-big-payload-request.json +${XNF_INVALID_WIRE_FRAME_REQUEST} ${VES_HV_SCENARIOS}/invalid-wire-frame/xnf-invalid-wire-frame-request.json +${XNF_INVALID_GPB_DATA_REQUEST} ${VES_HV_SCENARIOS}/invalid-gpb-data/xnf-invalid-gpb-data-request.json +${XNF_UNSUPPORTED_DOMAIN_REQUEST} ${VES_HV_SCENARIOS}/unsupported-domain/xnf-unsupported-domain-request.json + +${DCAE_FIXED_PAYLOAD_REQUEST} ${VES_HV_SCENARIOS}/fixed-payload/dcae-fixed-payload-request.json +${DCAE_INVALID_WIRE_FRAME_REQUEST} ${VES_HV_SCENARIOS}/invalid-wire-frame/dcae-invalid-wire-frame-request.json +${DCAE_INVALID_GPB_DATA_REQUEST} ${VES_HV_SCENARIOS}/invalid-gpb-data/dcae-invalid-gpb-data-request.json +${DCAE_UNSUPPORTED_DOMAIN_REQUEST} ${VES_HV_SCENARIOS}/unsupported-domain/dcae-unsupported-domain-request.json + +${AMOUNT_25000} 25000 +${AMOUNT_50000} 50000 diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/multiple-clients.robot b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/multiple-clients.robot new file mode 100644 index 000000000..862a2bc6a --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/multiple-clients.robot @@ -0,0 +1,35 @@ +*** Settings *** +Library DcaeAppSimulatorLibrary + +Resource resources/common-keywords.robot + +Suite Setup Multiple Clients Handling Suite Setup +Suite Teardown VES-HV Collector Suite Teardown +Test Teardown VES-HV Collector Test Shutdown + +*** Keywords *** +Multiple Clients Handling Suite Setup + Log Started Suite: VES-HV Multiple Clients Handling + ${XNF_PORTS_LIST}= Create List 7000 7001 7002 + Configure Valid xNF Simulators On Ports ${XNF_PORTS_LIST} + Log Suite setup finished + +*** Test Cases *** +Handle Multiple Connections + [Documentation] VES-HV Collector should handle multiple incoming transmissions + + ${SIMULATORS_LIST}= Get Valid xNF Simulators 3 + Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_SMALLER_PAYLOAD_REQUEST} + + Wait until keyword succeeds 60 sec 5 sec + ... Assert Dcae App Consumed ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_15000} + Assert Dcae App Consumed Proper Messages ${DCAE_APP_API_MESSAGES_VALIDATION_URL} ${DCAE_SMALLER_PAYLOAD_REQUEST} + + +*** Variables *** +${VES_HV_SCENARIOS} %{WORKSPACE}/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios + +${XNF_SMALLER_PAYLOAD_REQUEST} ${VES_HV_SCENARIOS}/multiple-simulators-payload/xnf-simulator-smaller-valid-request.json +${DCAE_SMALLER_PAYLOAD_REQUEST} ${VES_HV_SCENARIOS}/multiple-simulators-payload/dcae-smaller-valid-request.json + +${AMOUNT_15000} 15000 diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot new file mode 100644 index 000000000..bc03de232 --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot @@ -0,0 +1,50 @@ +*** Settings *** +Library XnfSimulatorLibrary +Library VesHvContainersUtilsLibrary +Library Collections + +*** Keywords *** +Configure Valid xNF Simulators On Ports + [Arguments] ${XNF_PORTS_LIST} + ${VALID_XNF_SIMULATORS_ADDRESSES}= Start Xnf Simulators ${XNF_PORTS_LIST} ${true} + Set Suite Variable ${VALID_XNF_SIMULATORS_ADDRESSES} + + +Configure Invalid xNF Simulators On Ports + [Arguments] ${XNF_PORTS_LIST} + ${INVALID_XNF_SIMULATORS_ADDRESSES}= Start Xnf Simulators ${XNF_PORTS_LIST} ${false} + Set Suite Variable ${INVALID_XNF_SIMULATORS_ADDRESSES} + + +Get Valid xNF Simulators + [Arguments] ${AMOUNT} + ${SIMULATORS}= Get Slice From List ${VALID_XNF_SIMULATORS_ADDRESSES} 0 ${AMOUNT} + [Return] ${SIMULATORS} + + +Get Invalid xNF Simulators + [Arguments] ${AMOUNT} + ${SIMULATORS}= Get Slice From List ${INVALID_XNF_SIMULATORS_ADDRESSES} 0 ${AMOUNT} + [Return] ${SIMULATORS} + + +Send Messages From xNF Simulators + [Arguments] ${XNF_HOSTS_LIST} ${MESSAGE_FILEPATH} + :FOR ${HOST} IN @{XNF_HOSTS_LIST} + \ ${XNF_SIM_API_ACCESS}= Get xNF Sim Api Access Url ${HTTP_METHOD_URL} ${HOST} + \ ${XNF_SIM_API_URL}= Catenate SEPARATOR= ${XNF_SIM_API_ACCESS} ${XNF_SIM_API_PATH} + \ Send messages ${XNF_SIM_API_URL} ${MESSAGE_FILEPATH} + + +VES-HV Collector Test Shutdown + Reset DCAE App Simulator ${DCAE_APP_API_MESSAGE_RESET_URL} + + +VES-HV Collector Suite Teardown + Stop And Remove All Xnf Simulators ${SUITE NAME} + +*** Variables *** +${HTTP_METHOD_URL} http:// + +${XNF_SIM_API_PATH} /simulator/async + diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/authorization/xnf-valid-messages-request.json b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/authorization/xnf-valid-messages-request.json new file mode 100644 index 000000000..c71793d7d --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/authorization/xnf-valid-messages-request.json @@ -0,0 +1,23 @@ +[ + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "VALID", + "messagesAmount": 500000 + } +]
\ No newline at end of file diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/fixed-payload/dcae-fixed-payload-request.json b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/fixed-payload/dcae-fixed-payload-request.json new file mode 100644 index 000000000..fb53f50ec --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/fixed-payload/dcae-fixed-payload-request.json @@ -0,0 +1,23 @@ +[ + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "FIXED_PAYLOAD", + "messagesAmount": 25000 + } +] diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/fixed-payload/xnf-fixed-payload-request.json b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/fixed-payload/xnf-fixed-payload-request.json new file mode 100644 index 000000000..fb53f50ec --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/fixed-payload/xnf-fixed-payload-request.json @@ -0,0 +1,23 @@ +[ + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "FIXED_PAYLOAD", + "messagesAmount": 25000 + } +] diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/invalid-gpb-data/dcae-invalid-gpb-data-request.json b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/invalid-gpb-data/dcae-invalid-gpb-data-request.json new file mode 100644 index 000000000..772b03bef --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/invalid-gpb-data/dcae-invalid-gpb-data-request.json @@ -0,0 +1,23 @@ +[ + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "VALID", + "messagesAmount": 50000 + } +] diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/invalid-gpb-data/xnf-invalid-gpb-data-request.json b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/invalid-gpb-data/xnf-invalid-gpb-data-request.json new file mode 100644 index 000000000..d9cb4c2ec --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/invalid-gpb-data/xnf-invalid-gpb-data-request.json @@ -0,0 +1,65 @@ +[ + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "VALID", + "messagesAmount": 25000 + }, + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "INVALID_GPB_DATA", + "messagesAmount": 100 + }, + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "VALID", + "messagesAmount": 25000 + } +] diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/invalid-wire-frame/dcae-invalid-wire-frame-request.json b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/invalid-wire-frame/dcae-invalid-wire-frame-request.json new file mode 100644 index 000000000..772b03bef --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/invalid-wire-frame/dcae-invalid-wire-frame-request.json @@ -0,0 +1,23 @@ +[ + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "VALID", + "messagesAmount": 50000 + } +] diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/invalid-wire-frame/xnf-invalid-wire-frame-request.json b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/invalid-wire-frame/xnf-invalid-wire-frame-request.json new file mode 100644 index 000000000..88d4e325d --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/invalid-wire-frame/xnf-invalid-wire-frame-request.json @@ -0,0 +1,65 @@ +[ + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "VALID", + "messagesAmount": 25000 + }, + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "INVALID_WIRE_FRAME", + "messagesAmount": 100 + }, + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "VALID", + "messagesAmount": 25000 + } +] diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/multiple-simulators-payload/dcae-smaller-valid-request.json b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/multiple-simulators-payload/dcae-smaller-valid-request.json new file mode 100644 index 000000000..9d34a7e24 --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/multiple-simulators-payload/dcae-smaller-valid-request.json @@ -0,0 +1,23 @@ +[ + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "FIXED_PAYLOAD", + "messagesAmount": 15000 + } +]
\ No newline at end of file diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/multiple-simulators-payload/xnf-simulator-smaller-valid-request.json b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/multiple-simulators-payload/xnf-simulator-smaller-valid-request.json new file mode 100644 index 000000000..625737e56 --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/multiple-simulators-payload/xnf-simulator-smaller-valid-request.json @@ -0,0 +1,23 @@ +[ + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "FIXED_PAYLOAD", + "messagesAmount": 5000 + } +]
\ No newline at end of file diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/too-big-payload/xnf-too-big-payload-request.json b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/too-big-payload/xnf-too-big-payload-request.json new file mode 100644 index 000000000..b1c727a0c --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/too-big-payload/xnf-too-big-payload-request.json @@ -0,0 +1,65 @@ +[ + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "VALID", + "messagesAmount": 25000 + }, + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "TOO_BIG_PAYLOAD", + "messagesAmount": 100 + }, + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "VALID", + "messagesAmount": 25000 + } +] diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/unsupported-domain/dcae-unsupported-domain-request.json b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/unsupported-domain/dcae-unsupported-domain-request.json new file mode 100644 index 000000000..772b03bef --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/unsupported-domain/dcae-unsupported-domain-request.json @@ -0,0 +1,23 @@ +[ + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "VALID", + "messagesAmount": 50000 + } +] diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/unsupported-domain/xnf-unsupported-domain-request.json b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/unsupported-domain/xnf-unsupported-domain-request.json new file mode 100644 index 000000000..e37e20d19 --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/unsupported-domain/xnf-unsupported-domain-request.json @@ -0,0 +1,65 @@ +[ + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "VALID", + "messagesAmount": 25000 + }, + { + "commonEventHeader": { + "version": "sample-version", + "domain": "FAULT", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "VALID", + "messagesAmount": 100 + }, + { + "commonEventHeader": { + "version": "sample-version", + "domain": "HVRANMEAS", + "sequence": 1, + "priority": 1, + "eventId": "sample-event-id", + "eventName": "sample-event-name", + "eventType": "sample-event-type", + "startEpochMicrosec": 120034455, + "lastEpochMicrosec": 120034455, + "nfNamingCode": "sample-nf-naming-code", + "nfcNamingCode": "sample-nfc-naming-code", + "reportingEntityId": "sample-reporting-entity-id", + "reportingEntityName": "sample-reporting-entity-name", + "sourceId": "sample-source-id", + "sourceName": "sample-source-name" + }, + "messageType": "VALID", + "messagesAmount": 25000 + } +] diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/ves-hv-configuration.json b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/ves-hv-configuration.json new file mode 100644 index 000000000..3235a0c0e --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/ves-hv-configuration.json @@ -0,0 +1,9 @@ +{ + "kafkaBootstrapServers": "kafka:9092", + "routing": [ + { + "fromDomain": 11, + "toTopic": "test-hv-ran-meas" + } + ] +}
\ No newline at end of file diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/docker-compose.yml b/test/csit/tests/dcaegen2/prh-testcases/resources/docker-compose.yml index 3cac3b41b..b1f84fda2 100644 --- a/test/csit/tests/dcaegen2/prh-testcases/resources/docker-compose.yml +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/docker-compose.yml @@ -25,8 +25,6 @@ services: build: context: simulator dockerfile: DMaaP_simulator - args: - - https_proxy=${HTTPS_PROXY} ports: - "2222:2222" container_name: dmaap_simulator @@ -35,8 +33,6 @@ services: build: context: simulator dockerfile: AAI_simulator - args: - - https_proxy=${HTTPS_PROXY} ports: - "3333:3333" container_name: aai_simulator diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py index ca8bdd1f6..e70d8d30f 100644 --- a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py @@ -1,11 +1,12 @@ -import BaseHTTPServer +from http.server import BaseHTTPRequestHandler +from http.server import HTTPServer import re import sys pnfs = 'Empty' -class AAIHandler(BaseHTTPServer.BaseHTTPRequestHandler): +class AAIHandler(BaseHTTPRequestHandler): def do_PUT(self): if re.search('/set_pnfs', self.path): global pnfs @@ -16,7 +17,7 @@ class AAIHandler(BaseHTTPServer.BaseHTTPRequestHandler): return def do_PATCH(self): - pnfs_name = '/aai/v12/network/pnfs/pnf/' + pnfs + pnfs_name = '/aai/v12/network/pnfs/pnf/' + pnfs.decode() if re.search('wrong_aai_record', self.path): self.send_response(400) self.end_headers() @@ -33,7 +34,7 @@ def _header_200_and_json(self): self.end_headers() -def _main_(handler_class=AAIHandler, server_class=BaseHTTPServer.HTTPServer, protocol="HTTP/1.0"): +def _main_(handler_class=AAIHandler, server_class=HTTPServer, protocol="HTTP/1.0"): if sys.argv[1:]: port = int(sys.argv[1]) @@ -46,7 +47,7 @@ def _main_(handler_class=AAIHandler, server_class=BaseHTTPServer.HTTPServer, pro httpd = server_class(server_address, handler_class) sa = httpd.socket.getsockname() - print "Serving HTTP on", sa[0], "port", sa[1], "..." + print("Serving HTTP on", sa[0], "port", sa[1], "...") httpd.serve_forever() diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator index 9566c47a9..013cd0a65 100644 --- a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator @@ -1,9 +1,7 @@ -FROM python:2 +FROM python:3 ADD AAI.py / -RUN pip install robotframework - EXPOSE 3333 CMD [ "python", "./AAI.py" ] diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py index dd2d19451..210378421 100644 --- a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py @@ -1,12 +1,13 @@ -import BaseHTTPServer +from http.server import BaseHTTPRequestHandler +from http.server import HTTPServer import re import sys -posted_event_from_prh = 'Empty' +posted_event_from_prh = b'Empty' received_event_to_get_method = 'Empty' -class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler): +class DMaaPHandler(BaseHTTPRequestHandler): def do_PUT(self): if re.search('/set_get_event', self.path): global received_event_to_get_method @@ -29,11 +30,9 @@ class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler): if re.search('/events/unauthenticated.SEC_OTHER_OUTPUT/OpenDcae-c12/c12', self.path): _header_200_and_json(self) self.wfile.write(received_event_to_get_method) - self.wfile.close() elif re.search('/events/pnfReady', self.path): _header_200_and_json(self) self.wfile.write(posted_event_from_prh) - self.wfile.close() return @@ -44,7 +43,7 @@ def _header_200_and_json(self): self.end_headers() -def _main_(handler_class=DMaaPHandler, server_class=BaseHTTPServer.HTTPServer, protocol="HTTP/1.0"): +def _main_(handler_class=DMaaPHandler, server_class=HTTPServer, protocol="HTTP/1.0"): if sys.argv[1:]: port = int(sys.argv[1]) @@ -57,7 +56,7 @@ def _main_(handler_class=DMaaPHandler, server_class=BaseHTTPServer.HTTPServer, p httpd = server_class(server_address, handler_class) sa = httpd.socket.getsockname() - print "Serving HTTP on", sa[0], "port", sa[1], "..." + print("Serving HTTP on", sa[0], "port", sa[1], "...") httpd.serve_forever() diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator index 20761e7e8..cf4160c89 100644 --- a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator @@ -1,9 +1,7 @@ -FROM python:2 +FROM python:3 ADD DMaaP.py / -RUN pip install robotframework - EXPOSE 2222 CMD [ "python", "./DMaaP.py" ] diff --git a/test/csit/tests/dmaap-buscontroller/ssl_suite/__init__.robot b/test/csit/tests/dmaap-buscontroller/ssl_suite/__init__.robot new file mode 100644 index 000000000..41c7a0037 --- /dev/null +++ b/test/csit/tests/dmaap-buscontroller/ssl_suite/__init__.robot @@ -0,0 +1,3 @@ +*** Settings *** +Documentation dmaap-buscontroller - Suite 1 + diff --git a/test/csit/tests/dmaap-buscontroller/ssl_suite/test1.robot b/test/csit/tests/dmaap-buscontroller/ssl_suite/test1.robot new file mode 100644 index 000000000..999c6baf8 --- /dev/null +++ b/test/csit/tests/dmaap-buscontroller/ssl_suite/test1.robot @@ -0,0 +1,77 @@ +*** Settings *** +Library OperatingSystem +Library RequestsLibrary +Library HttpLibrary.HTTP +Library Collections +Library String + +*** Variables *** +${MESSAGE} Hello, world! +${DBC_URI} /webapi + +*** Test Cases *** +String Equality Test + Should Be Equal ${MESSAGE} Hello, world! + +Dir Test + [Documentation] Check if /tmp exists + Log ${MESSAGE} + CheckDir /tmp + +Url Test + [Documentation] Check if www.onap.org can be reached + Create Session openo http://www.onap.org + CheckUrl openo / 200 + +HTTPS Heartbeat Test + [Documentation] Check ${DBC_URI}/info SSL endpoint + Create Session heartbeat https://${DMAAPBC_IP}:8443 + CheckUrl heartbeat ${DBC_URI}/info 204 + +HTTPS Dmaap Init Test + [Documentation] Check ${DBC_URI}/dmaap SSL endpoint + Create Session heartbeat https://${DMAAPBC_IP}:8443 + CheckStatus heartbeat ${DBC_URI}/dmaap "VALID" + +HTTPS Dmaap dcaeLocations Test + [Documentation] Check ${DBC_URI}/dcaeLocations SSL endpoint + Create Session heartbeat https://${DMAAPBC_IP}:8443 + CheckStatus0 heartbeat ${DBC_URI}/dcaeLocations "VALID" + +HTTPS Dmaap mr_clusters Test + [Documentation] Check ${DBC_URI}/mr_clusters SSL endpoint + Create Session heartbeat https://${DMAAPBC_IP}:8443 + CheckStatus0 heartbeat ${DBC_URI}/mr_clusters "VALID" + + +*** Keywords *** +CheckDir + [Arguments] ${path} + Directory Should Exist ${path} + +CheckUrl + [Arguments] ${session} ${path} ${expect} + ${resp}= Get Request ${session} ${path} + Should Be Equal As Integers ${resp.status_code} ${expect} + +CheckStatus + [Arguments] ${session} ${path} ${expect} + ${resp}= Get Request ${session} ${path} + log ${resp.content} + ${val}= Get Json value ${resp.content} /status + log ${val} + should be equal as strings ${val} ${expect} + +CheckStatus0 + [Arguments] ${session} ${path} ${expect} + ${resp}= Get Request ${session} ${path} + log ${resp.json()} + log ${resp.content} +# silliness to strip off the brackets returned for a List to get a Dict + ${t1}= Remove String ${resp.content} [ + ${dict}= Remove String ${t1} ] + log ${dict} + ${val}= Get Json value ${dict} /status + log ${val} + should be equal as strings ${val} ${expect} + diff --git a/test/csit/tests/dmaap-buscontroller/with_dr/orig b/test/csit/tests/dmaap-buscontroller/with_dr/orig new file mode 100755 index 000000000..fcac20263 --- /dev/null +++ b/test/csit/tests/dmaap-buscontroller/with_dr/orig @@ -0,0 +1,116 @@ +*** Settings *** +Library OperatingSystem +Library RequestsLibrary +Library requests +Library Collections +Library String + +*** Variables *** +${TARGET_URL} https://${DR_PROV_IP}:8443 +${TARGET_URL_FEED} https://${DR_PROV_IP}:8443/feed/1 +${TARGET_URL_SUBSCRIBE} https://${DR_PROV_IP}:8443/subscribe/1 +${TARGET_URL_SUBSCRIPTION} https://${DR_PROV_IP}:8443/subs/1 +${TARGET_URL_PUBLISH} https://${DR_NODE_IP}:8443/publish/1/csit_test +${CREATE_FEED_DATA} {"name": "CSIT_Test", "version": "m1.0", "description": "CSIT_Test", "business_description": "CSIT_Test", "suspend": false, "deleted": false, "changeowner": true, "authorization": {"classification": "unclassified", "endpoint_addrs": [], "endpoint_ids": [{"password": "rs873m", "id": "rs873m"}]}} +${UPDATE_FEED_DATA} {"name": "CSIT_Test", "version": "m1.0", "description": "UPDATED-CSIT_Test", "business_description": "CSIT_Test", "suspend": true, "deleted": false, "changeowner": true, "authorization": {"classification": "unclassified", "endpoint_addrs": [], "endpoint_ids": [{"password": "rs873m", "id": "rs873m"}]}} +${SUBSCRIBE_DATA} {"delivery":{ "url":"https://${DR_PROV_IP}:8080/", "user":"rs873m", "password":"rs873m", "use100":true}, "metadataOnly":false, "suspend":false, "groupid":29, "subscriber":"sg481n"} +${UPDATE_SUBSCRIPTION_DATA} {"delivery":{ "url":"https://${DR_PROV_IP}:8080/", "user":"sg481n", "password":"sg481n", "use100":true}, "metadataOnly":false, "suspend":true, "groupid":29, "subscriber":"sg481n"} +${FEED_CONTENT_TYPE} application/vnd.att-dr.feed +${SUBSCRIBE_CONTENT_TYPE} application/vnd.att-dr.subscription +${PUBLISH_FEED_CONTENT_TYPE} application/octet-stream + +*** Test Cases *** +Run Feed Creation + [Documentation] Feed Creation + [Timeout] 1 minute + ${resp}= PostCall ${TARGET_URL} ${CREATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m + log ${TARGET_URL} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 201 + log 'JSON Response Code:'${resp} + +Run Subscribe to Feed + [Documentation] Subscribe to Feed + [Timeout] 1 minute + ${resp}= PostCall ${TARGET_URL_SUBSCRIBE} ${SUBSCRIBE_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n + log ${TARGET_URL_SUBSCRIBE} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 201 + log 'JSON Response Code:'${resp} + +Run Publish Feed + [Documentation] Publish to Feed + [Timeout] 1 minute + Sleep 10s Behaviour was noticed where feed was not created in time for publish to be sent + ${resp}= PutCall ${TARGET_URL_PUBLISH} ${CREATE_FEED_DATA} ${PUBLISH_FEED_CONTENT_TYPE} rs873m + log ${TARGET_URL_PUBLISH} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 204 + log 'JSON Response Code:'${resp} + +Run Update Subscription + [Documentation] Update Subscription to suspend and change delivery credentials + [Timeout] 1 minute + ${resp}= PutCall ${TARGET_URL_SUBSCRIPTION} ${UPDATE_SUBSCRIPTION_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n + log ${TARGET_URL_SUBSCRIPTION} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + log 'JSON Response Code:'${resp} + ${resp}= GetCall ${TARGET_URL_SUBSCRIPTION} ${SUBSCRIBE_CONTENT_TYPE} sg481n + log ${resp.text} + Should Contain ${resp.text} "password":"sg481n","user":"sg481n" + log 'JSON Response Code:'${resp} + +Run Update Feed + [Documentation] Update Feed description and suspend + [Timeout] 1 minute + ${resp}= PutCall ${TARGET_URL_FEED} ${UPDATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m + log ${TARGET_URL_FEED} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + log 'JSON Response Code:'${resp} + ${resp}= GetCall ${TARGET_URL_FEED} ${FEED_CONTENT_TYPE} rs873m + log ${resp.text} + Should Contain ${resp.text} "UPDATED-CSIT_Test" + log 'JSON Response Code:'${resp} + +Run Delete Subscription + [Documentation] Delete Subscription + [Timeout] 1 minute + ${resp}= DeleteCall ${TARGET_URL_SUBSCRIPTION} sg481n + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 204 + log 'JSON Response Code:'${resp} + +Run Delete Feed + [Documentation] Delete Feed + [Timeout] 1 minute + ${resp}= DeleteCall ${TARGET_URL_FEED} rs873m + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 204 + log 'JSON Response Code:'${resp} + +*** Keywords *** +PostCall + [Arguments] ${url} ${data} ${content_type} ${user} + ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} + ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests + [Return] ${resp} + +PutCall + [Arguments] ${url} ${data} ${content_type} ${user} + ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} Authorization=Basic cnM4NzNtOnJzODczbQ== + ${resp}= Evaluate requests.put('${url}',data='${data}', headers=${headers},verify=False) requests + [Return] ${resp} + +GetCall + [Arguments] ${url} ${content_type} ${user} + ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} + ${resp}= Evaluate requests.get('${url}', headers=${headers},verify=False) requests + [Return] ${resp} + +DeleteCall + [Arguments] ${url} ${user} + ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} + ${resp}= Evaluate requests.delete('${url}', headers=${headers},verify=False) requests + [Return] ${resp} diff --git a/test/csit/tests/dmaap-buscontroller/with_dr/test1.robot b/test/csit/tests/dmaap-buscontroller/with_dr/test1.robot new file mode 100644 index 000000000..a3aef42b8 --- /dev/null +++ b/test/csit/tests/dmaap-buscontroller/with_dr/test1.robot @@ -0,0 +1,143 @@ +*** Settings *** +Resource ../../common.robot +Library Collections +Library json +Library OperatingSystem +Library RequestsLibrary +Library HttpLibrary.HTTP +Library String + + +*** Variables *** +${MESSAGE} Hello, world! +${DBC_URI} webapi +${DBC_URL} http://${DMAAPBC_IP}:8080/${DBC_URI} +${LOC} csit-sanfrancisco +${PUB_CORE} "dcaeLocationName": "${LOC}", "clientRole": "org.onap.dmaap.client.pub", "action": [ "pub", "view" ] +${SUB_CORE} "dcaeLocationName": "${LOC}", "clientRole": "org.onap.dmaap.client.sub", "action": [ "sub", "view" ] +${PUB} { ${PUB_CORE} } +${SUB} { ${SUB_CORE} } +${FEED1_DATA} { "feedName":"feed1", "feedVersion": "csit", "feedDescription":"generated for CSIT", "owner":"dgl", "asprClassification": "unclassified" } +${FEED2_DATA} { "feedName":"feed2", "feedVersion": "csit", "feedDescription":"generated for CSIT", "owner":"dgl", "asprClassification": "unclassified" } +${PUB2_DATA} { "dcaeLocationName": "${LOC}", "username": "pub2", "userpwd": "topSecret123", "feedId": "2" } +${SUB2_DATA} { "dcaeLocationName": "${LOC}", "username": "sub2", "userpwd": "someSecret123", "deliveryURL": "https://${DMAAPBC_IP}:8443/webapi/noURI", "feedId": "2" } +${TOPIC2_DATA} { "topicName":"singleMRtopic2", "topicDescription":"generated for CSIT", "owner":"dgl", "clients": [ ${PUB}, ${SUB}] } +${TOPIC3_DATA} { "topicName":"singleMRtopic3", "topicDescription":"generated for CSIT", "owner":"dgl"} +#${PUB3_DATA} { "fqtn": "${TOPIC_NS}.singleMRtopic3", ${PUB_CORE} } +#${SUB3_DATA} { "fqtn": "${TOPIC_NS}.singleMRtopic3", ${SUB_CORE} } + + + +*** Test Cases *** +Url Test + [Documentation] Check if www.onap.org can be reached + Create Session sanity http://onap.readthedocs.io + ${resp}= Get Request sanity / + Should Be Equal As Integers ${resp.status_code} 200 + +(DMAAP-441c1) + [Documentation] Create Feed w no clients POST ${DBC_URI}/feeds endpoint + ${resp}= PostCall ${DBC_URL}/feeds ${FEED1_DATA} + Should Be Equal As Integers ${resp.status_code} 200 + +(DMAAP-441c2) + [Documentation] Create Feed w clients POST ${DBC_URI}/feeds endpoint + ${resp}= PostCall ${DBC_URL}/feeds ${FEED2_DATA} + Should Be Equal As Integers ${resp.status_code} 200 + +(DMAAP-441c3) + [Documentation] Add Publisher to existing feed + ${resp}= PostCall ${DBC_URL}/dr_pubs ${PUB2_DATA} + Should Be Equal As Integers ${resp.status_code} 201 + ${tmp}= Get Json Value ${resp.text} /pubId + ${tmp}= Remove String ${tmp} \" + Set Suite Variable ${pubId} ${tmp} + +(DMAAP-441c4) + [Documentation] Add Subscriber to existing feed + ${resp}= PostCall ${DBC_URL}/dr_subs ${SUB2_DATA} + Should Be Equal As Integers ${resp.status_code} 201 + ${tmp}= Get Json Value ${resp.text} /subId + ${tmp}= Remove String ${tmp} \" + Set Suite Variable ${subId} ${tmp} + +(DMAAP-443) + [Documentation] List existing feeds + Create Session get ${DBC_URL} + ${resp}= Get Request get /feeds + Should Be Equal As Integers ${resp.status_code} 200 + +(DMAAP-444) + [Documentation] Delete existing subscriber + ${resp}= DelCall ${DBC_URL}/dr_subs/${subId} + Should Be Equal As Integers ${resp.status_code} 204 + +(DMAAP-445) + [Documentation] Delete existing publisher + ${resp}= DelCall ${DBC_URL}/dr_pubs/${pubId} + Should Be Equal As Integers ${resp.status_code} 204 + +#(DMAAP-294) +# [Documentation] Create Topic w pub and sub clients POST ${DBC_URI}/topics endpoint +# ${resp}= PostCall ${DBC_URL}/topics ${TOPIC2_DATA} +# Should Be Equal As Integers ${resp.status_code} 201 +# +#(DMAAP-295) +# [Documentation] Create Topic w no clients and then add a client POST ${DBC_URI}/mr_clients endpoint +# ${resp}= PostCall ${DBC_URL}/topics ${TOPIC3_DATA} +# Should Be Equal As Integers ${resp.status_code} 201 +# ${resp}= PostCall ${DBC_URL}/mr_clients ${PUB3_DATA} +# Should Be Equal As Integers ${resp.status_code} 200 +# ${resp}= PostCall ${DBC_URL}/mr_clients ${SUB3_DATA} +# Should Be Equal As Integers ${resp.status_code} 200 +# +#(DMAAP-297) +# [Documentation] Query for all topics and specific topic +# Create Session get ${DBC_URL} +# ${resp}= Get Request get /topics +# Should Be Equal As Integers ${resp.status_code} 200 +# ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 +# Should Be Equal As Integers ${resp.status_code} 200 +# +#(DMAAP-301) +# [Documentation] Delete a subscriber +# Create Session get ${DBC_URL} +# ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 +# Should Be Equal As Integers ${resp.status_code} 200 +# ${tmp}= Get Json Value ${resp.text} /clients/1/mrClientId +# ${clientId}= Remove String ${tmp} \" +# ${resp}= DelCall ${DBC_URL}/mr_clients/${clientId} +# Should Be Equal As Integers ${resp.status_code} 204 +# +#(DMAAP-302) +# [Documentation] Delete a publisher +# Create Session get ${DBC_URL} +# ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 +# Should Be Equal As Integers ${resp.status_code} 200 +# ${tmp}= Get Json Value ${resp.text} /clients/0/mrClientId +# ${clientId}= Remove String ${tmp} \" +# ${resp}= DelCall ${DBC_URL}/mr_clients/${clientId} +# Should Be Equal As Integers ${resp.status_code} 204 + + +*** Keywords *** +CheckDir + [Arguments] ${path} + Directory Should Exist ${path} + +CheckUrl + [Arguments] ${session} ${path} ${expect} + ${resp}= Get Request ${session} ${path} + Should Be Equal As Integers ${resp.status_code} ${expect} + +PostCall + [Arguments] ${url} ${data} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests + [Return] ${resp} + +DelCall + [Arguments] ${url} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Evaluate requests.delete('${url}', headers=${headers},verify=False) requests + [Return] ${resp} diff --git a/test/csit/tests/dmaap-datarouter/dr-suite/dr-suite.robot b/test/csit/tests/dmaap-datarouter/dr-suite/dr-suite.robot new file mode 100755 index 000000000..fcac20263 --- /dev/null +++ b/test/csit/tests/dmaap-datarouter/dr-suite/dr-suite.robot @@ -0,0 +1,116 @@ +*** Settings *** +Library OperatingSystem +Library RequestsLibrary +Library requests +Library Collections +Library String + +*** Variables *** +${TARGET_URL} https://${DR_PROV_IP}:8443 +${TARGET_URL_FEED} https://${DR_PROV_IP}:8443/feed/1 +${TARGET_URL_SUBSCRIBE} https://${DR_PROV_IP}:8443/subscribe/1 +${TARGET_URL_SUBSCRIPTION} https://${DR_PROV_IP}:8443/subs/1 +${TARGET_URL_PUBLISH} https://${DR_NODE_IP}:8443/publish/1/csit_test +${CREATE_FEED_DATA} {"name": "CSIT_Test", "version": "m1.0", "description": "CSIT_Test", "business_description": "CSIT_Test", "suspend": false, "deleted": false, "changeowner": true, "authorization": {"classification": "unclassified", "endpoint_addrs": [], "endpoint_ids": [{"password": "rs873m", "id": "rs873m"}]}} +${UPDATE_FEED_DATA} {"name": "CSIT_Test", "version": "m1.0", "description": "UPDATED-CSIT_Test", "business_description": "CSIT_Test", "suspend": true, "deleted": false, "changeowner": true, "authorization": {"classification": "unclassified", "endpoint_addrs": [], "endpoint_ids": [{"password": "rs873m", "id": "rs873m"}]}} +${SUBSCRIBE_DATA} {"delivery":{ "url":"https://${DR_PROV_IP}:8080/", "user":"rs873m", "password":"rs873m", "use100":true}, "metadataOnly":false, "suspend":false, "groupid":29, "subscriber":"sg481n"} +${UPDATE_SUBSCRIPTION_DATA} {"delivery":{ "url":"https://${DR_PROV_IP}:8080/", "user":"sg481n", "password":"sg481n", "use100":true}, "metadataOnly":false, "suspend":true, "groupid":29, "subscriber":"sg481n"} +${FEED_CONTENT_TYPE} application/vnd.att-dr.feed +${SUBSCRIBE_CONTENT_TYPE} application/vnd.att-dr.subscription +${PUBLISH_FEED_CONTENT_TYPE} application/octet-stream + +*** Test Cases *** +Run Feed Creation + [Documentation] Feed Creation + [Timeout] 1 minute + ${resp}= PostCall ${TARGET_URL} ${CREATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m + log ${TARGET_URL} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 201 + log 'JSON Response Code:'${resp} + +Run Subscribe to Feed + [Documentation] Subscribe to Feed + [Timeout] 1 minute + ${resp}= PostCall ${TARGET_URL_SUBSCRIBE} ${SUBSCRIBE_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n + log ${TARGET_URL_SUBSCRIBE} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 201 + log 'JSON Response Code:'${resp} + +Run Publish Feed + [Documentation] Publish to Feed + [Timeout] 1 minute + Sleep 10s Behaviour was noticed where feed was not created in time for publish to be sent + ${resp}= PutCall ${TARGET_URL_PUBLISH} ${CREATE_FEED_DATA} ${PUBLISH_FEED_CONTENT_TYPE} rs873m + log ${TARGET_URL_PUBLISH} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 204 + log 'JSON Response Code:'${resp} + +Run Update Subscription + [Documentation] Update Subscription to suspend and change delivery credentials + [Timeout] 1 minute + ${resp}= PutCall ${TARGET_URL_SUBSCRIPTION} ${UPDATE_SUBSCRIPTION_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n + log ${TARGET_URL_SUBSCRIPTION} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + log 'JSON Response Code:'${resp} + ${resp}= GetCall ${TARGET_URL_SUBSCRIPTION} ${SUBSCRIBE_CONTENT_TYPE} sg481n + log ${resp.text} + Should Contain ${resp.text} "password":"sg481n","user":"sg481n" + log 'JSON Response Code:'${resp} + +Run Update Feed + [Documentation] Update Feed description and suspend + [Timeout] 1 minute + ${resp}= PutCall ${TARGET_URL_FEED} ${UPDATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m + log ${TARGET_URL_FEED} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + log 'JSON Response Code:'${resp} + ${resp}= GetCall ${TARGET_URL_FEED} ${FEED_CONTENT_TYPE} rs873m + log ${resp.text} + Should Contain ${resp.text} "UPDATED-CSIT_Test" + log 'JSON Response Code:'${resp} + +Run Delete Subscription + [Documentation] Delete Subscription + [Timeout] 1 minute + ${resp}= DeleteCall ${TARGET_URL_SUBSCRIPTION} sg481n + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 204 + log 'JSON Response Code:'${resp} + +Run Delete Feed + [Documentation] Delete Feed + [Timeout] 1 minute + ${resp}= DeleteCall ${TARGET_URL_FEED} rs873m + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 204 + log 'JSON Response Code:'${resp} + +*** Keywords *** +PostCall + [Arguments] ${url} ${data} ${content_type} ${user} + ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} + ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests + [Return] ${resp} + +PutCall + [Arguments] ${url} ${data} ${content_type} ${user} + ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} Authorization=Basic cnM4NzNtOnJzODczbQ== + ${resp}= Evaluate requests.put('${url}',data='${data}', headers=${headers},verify=False) requests + [Return] ${resp} + +GetCall + [Arguments] ${url} ${content_type} ${user} + ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} + ${resp}= Evaluate requests.get('${url}', headers=${headers},verify=False) requests + [Return] ${resp} + +DeleteCall + [Arguments] ${url} ${user} + ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} + ${resp}= Evaluate requests.delete('${url}', headers=${headers},verify=False) requests + [Return] ${resp} diff --git a/test/csit/tests/holmes/testcase/RuleMgt/Rule-Mgt.robot b/test/csit/tests/holmes/testcase/RuleMgt/Rule-Mgt.robot index 9ec65854b..55e57ecd4 100644 --- a/test/csit/tests/holmes/testcase/RuleMgt/Rule-Mgt.robot +++ b/test/csit/tests/holmes/testcase/RuleMgt/Rule-Mgt.robot @@ -39,7 +39,7 @@ query_rule_with_existing_id query_rule_with_non_existing_id [Documentation] Query a rule with a non-existing ID. - ${response} queryConditionRule {"ruleid":"invalidid"} + ${response} queryConditionRule {"ruleId":"invalidid"} ${respJson} to json ${response.content} ${count} get from dictionary ${respJson} totalCount run keyword if ${count}!=0 fail @@ -53,7 +53,7 @@ query_rule_with_partial_existing_name query_rule_with_partial_non_existing_name [Documentation] Query rules with (a part of) a non-existing name. - ${response} queryConditionRule {"rulename":"zte2017"} + ${response} queryConditionRule {"ruleName":"zte2017"} ${respJson} to json ${response.content} ${count} get from dictionary ${respJson} totalCount run keyword if ${count}!=0 fail diff --git a/test/csit/tests/multicloud-pike/provision/hpa_multicloud.robot b/test/csit/tests/multicloud-pike/provision/hpa_multicloud.robot new file mode 100644 index 000000000..f96b542b3 --- /dev/null +++ b/test/csit/tests/multicloud-pike/provision/hpa_multicloud.robot @@ -0,0 +1,17 @@ +*** settings *** +Library Collections +Library RequestsLibrary + +*** Variables *** +@{return_ok_list}= 200 201 202 +${queryregistration_url} /api/multicloud-pike/v0/CloudOwner_RegionOne/registry + + +*** Test Cases *** +OcataRegistryTest + [Documentation] Register openstack cloud resources + ${headers} Create Dictionary Content-Type=application/json Accept=application/json + Create Session web_session http://${SERVICE_IP}:${SERVICE_PORT} headers=${headers} + ${resp}= Post Request web_session ${queryregistration_url} + ${response_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${response_code} diff --git a/test/csit/tests/multicloud-pike/provision/sanity_test_multicloud.robot b/test/csit/tests/multicloud-pike/provision/sanity_test_multicloud.robot new file mode 100644 index 000000000..36fcea3f0 --- /dev/null +++ b/test/csit/tests/multicloud-pike/provision/sanity_test_multicloud.robot @@ -0,0 +1,22 @@ +*** settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json + +*** Variables *** +@{return_ok_list}= 200 201 202 +${queryswagger_pike_url} /api/multicloud-pike/v0/swagger.json + + +*** Test Cases *** +OcataSwaggerTest + [Documentation] query swagger info rest test + ${headers} Create Dictionary Content-Type=application/json Accept=application/json + Create Session web_session http://${SERVICE_IP}:${SERVICE_PORT} headers=${headers} + ${resp}= Get Request web_session ${queryswagger_pike_url} + ${response_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${response_code} + ${response_json} json.loads ${resp.content} + ${swagger_version}= Convert To String ${response_json['swagger']} + Should Be Equal ${swagger_version} 2.0 diff --git a/test/csit/tests/music/music-suite/music-test.robot b/test/csit/tests/music/music-suite/music-test.robot index 9f8e435c8..9fc937e49 100644 --- a/test/csit/tests/music/music-suite/music-test.robot +++ b/test/csit/tests/music/music-suite/music-test.robot @@ -5,6 +5,9 @@ Library json *** Variables *** ${MESSAGE} {"ping": "ok"} +${BASIC} Basic +${AUTHVALUE} bXVzaWM6bXVzaWM= +${Authorization} ${BASIC} ${AUTHVALUE} #global variables ${generatedAID} @@ -60,7 +63,7 @@ Music AddOnBoarding [Documentation] It sends a REST POST request to Music to Onboard a new application Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}onboard.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} Content-Type=application/json Accept=application/json ${resp}= Post Request musicaas /MUSIC/rest/v2/admin/onboardAppWithMusic data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -75,7 +78,7 @@ Music CreateKeyspace [Documentation] It sends a REST POST request to Music to create a new keyspace in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}createkeyspace.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Post Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -86,7 +89,7 @@ Music CreateTable [Documentation] It sends a REST POST request to Music to create a new Table in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}createtable.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Post Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace/tables/MusicOnapTable data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -97,7 +100,7 @@ Music InsertRow [Documentation] It sends a REST POST request to Music to create a new row in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}insertrow_eventual.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Post Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace/tables/MusicOnapTable/rows/?row=emp1 data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -107,7 +110,7 @@ Music InsertRow Music ReadRowJustInserted [Documentation] It sends a REST GET request to Music to Read the row just inserted in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Get Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace/tables/MusicOnapTable/rows?name=emp1 headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -118,7 +121,7 @@ Music UpdateRowInAtomicWay [Documentation] It sends a REST PUT request to Music to create a new row in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}updaterow_atomic.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Put Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace/tables/MusicOnapTable/rows?name=emp1 data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -128,7 +131,7 @@ Music UpdateRowInAtomicWay Music ReadRowAfterUpdate [Documentation] It sends a REST GET request to Music to Read the row just inserted in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Get Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace/tables/MusicOnapTable/rows?name=emp1 headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -139,7 +142,7 @@ Music DeleteRow [Documentation] It sends a REST DELETE request to Music to delete a row in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}deleterow_eventual.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Delete Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace/tables/MusicOnapTable/rows?name=emp1 data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -150,7 +153,7 @@ Music DropTable [Documentation] It sends a REST Delete request to Music to drop one existing Table in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}droptable.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Delete Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace/tables/MusicOnapTable data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -161,7 +164,7 @@ Music DropKeyspace [Documentation] It sends a REST DELETE request to Music to drop one existing keyspace in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}dropkeyspace.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Delete Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -173,7 +176,7 @@ Music DeleteOnBoarding [Documentation] It sends a REST DELETE request to Music to remove a previosly onboarded application Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}onboard.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Delete Request musicaas /MUSIC/rest/v2/admin/onboardAppWithMusic data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} diff --git a/test/csit/tests/optf-has/has/optf_has_test.robot b/test/csit/tests/optf-has/has/optf_has_test.robot index 815ffa850..deba6470e 100644 --- a/test/csit/tests/optf-has/has/optf_has_test.robot +++ b/test/csit/tests/optf-has/has/optf_has_test.robot @@ -115,6 +115,7 @@ Get Root Url 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 diff --git a/test/csit/tests/policy/suite1/global_properties.robot b/test/csit/tests/policy/suite1/global_properties.robot index f406bbf3d..911fdaff9 100644 --- a/test/csit/tests/policy/suite1/global_properties.robot +++ b/test/csit/tests/policy/suite1/global_properties.robot @@ -22,9 +22,9 @@ ${GLOBAL_AAI_CLOUD_OWNER} Rackspace ${GLOBAL_BUILD_NUMBER} 31 ${GLOBAL_VM_PRIVATE_KEY} ${EXECDIR}/robot/assets/keys/robot_ssh_private_key.pvt # policy info - everything is from the private oam network (also called ecomp private network) -${GLOBAL_POLICY_SERVER_URL} http://%{PDP_IP}:8081 +${GLOBAL_POLICY_SERVER_URL} https://%{PDP_IP}:8081 ${GLOBAL_POLICY_AUTH} dGVzdHBkcDphbHBoYTEyMw== ${GLOBAL_POLICY_CLIENTAUTH} cHl0aG9uOnRlc3Q= ${GLOBAL_POLICY_HEALTHCHECK_URL} http://%{POLICY_IP}:6969 ${GLOBAL_POLICY_USERNAME} healthcheck -${GLOBAL_POLICY_PASSWORD} zb!XztG34
\ No newline at end of file +${GLOBAL_POLICY_PASSWORD} zb!XztG34 diff --git a/test/csit/tests/sdc/nightly/test1.robot b/test/csit/tests/sdc/nightly/test1.robot index 6d4dc242d..3705d8f5b 100644 --- a/test/csit/tests/sdc/nightly/test1.robot +++ b/test/csit/tests/sdc/nightly/test1.robot @@ -7,9 +7,9 @@ Library json *** Test Cases *** Get Requests health check ok [Tags] get - CreateSession sdc-be http://localhost:8080 + CreateSession sdc-be http://localhost:8181 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request sdc-be /sdc2/rest/healthCheck headers=&{headers} + ${resp}= Get Request sdc-be /sdc1/rest/healthCheck headers=&{headers} Should Be Equal As Strings ${resp.status_code} 200 @{ITEMS}= Copy List ${resp.json()['componentsInfo']} : FOR ${ELEMENT} IN @{ITEMS} diff --git a/test/csit/tests/sdc/sanity/test1.robot b/test/csit/tests/sdc/sanity/test1.robot index 6d4dc242d..3705d8f5b 100644 --- a/test/csit/tests/sdc/sanity/test1.robot +++ b/test/csit/tests/sdc/sanity/test1.robot @@ -7,9 +7,9 @@ Library json *** Test Cases *** Get Requests health check ok [Tags] get - CreateSession sdc-be http://localhost:8080 + CreateSession sdc-be http://localhost:8181 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request sdc-be /sdc2/rest/healthCheck headers=&{headers} + ${resp}= Get Request sdc-be /sdc1/rest/healthCheck headers=&{headers} Should Be Equal As Strings ${resp.status_code} 200 @{ITEMS}= Copy List ${resp.json()['componentsInfo']} : FOR ${ELEMENT} IN @{ITEMS} diff --git a/test/csit/tests/sdc/uiSanity/test1.robot b/test/csit/tests/sdc/uiSanity/test1.robot index 6d4dc242d..3705d8f5b 100644 --- a/test/csit/tests/sdc/uiSanity/test1.robot +++ b/test/csit/tests/sdc/uiSanity/test1.robot @@ -7,9 +7,9 @@ Library json *** Test Cases *** Get Requests health check ok [Tags] get - CreateSession sdc-be http://localhost:8080 + CreateSession sdc-be http://localhost:8181 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request sdc-be /sdc2/rest/healthCheck headers=&{headers} + ${resp}= Get Request sdc-be /sdc1/rest/healthCheck headers=&{headers} Should Be Equal As Strings ${resp.status_code} 200 @{ITEMS}= Copy List ${resp.json()['componentsInfo']} : FOR ${ELEMENT} IN @{ITEMS} diff --git a/test/csit/tests/vid/resources/docker-compose.yml b/test/csit/tests/vid/resources/docker-compose.yml new file mode 100644 index 000000000..93b317001 --- /dev/null +++ b/test/csit/tests/vid/resources/docker-compose.yml @@ -0,0 +1,35 @@ +version: '3' +services: + vid-server: + image: nexus3.onap.org:10001/onap/vid:latest + environment: + - VID_MYSQL_DBNAME=vid_openecomp_epsdk + - VID_MYSQL_PASS=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + - ASDC_CLIENT_REST_HOST=localhost + - ASDC_CLIENT_REST_PORT=8443 + ports: + - "8080:8080" + container_name: vid-server + links: + - vid-mariadb:vid-mariadb-docker-instance + + vid-mariadb: + image: mariadb:10 + environment: + - MYSQL_DATABASE=vid_openecomp_epsdk + - MYSQL_USER=vidadmin + - MYSQL_PASSWORD=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + - MYSQL_ROOT_PASSWORD=LF+tp_1WqgSY + container_name: vid-mariadb + volumes: + - ${WORKSPACE}/data/clone/vid/lf_config/vid-my.cnf:/etc/mysql/my.cnf + - ${WORKSPACE}/data/clone/vid/lf_config/vid-schema.sql:/docker-entrypoint-initdb.d/vid-schema.sql + - /var/lib/mysql + + sdc_simulator: + build: + context: simulators + dockerfile: SDC_simulator + ports: + - "8443:8443" + container_name: sdc_simulator
\ No newline at end of file diff --git a/test/csit/tests/vid/resources/simulators/SDC.py b/test/csit/tests/vid/resources/simulators/SDC.py new file mode 100644 index 000000000..e99a0bdce --- /dev/null +++ b/test/csit/tests/vid/resources/simulators/SDC.py @@ -0,0 +1,37 @@ +import ssl +from http.server import BaseHTTPRequestHandler, HTTPServer + +from sys import argv + +DEFAULT_PORT = 8443 + + +class SDCHandler(BaseHTTPRequestHandler): + + def __init__(self, request, client_address, server): + self.response_on_get = self._read_on_get_response() + super().__init__(request, client_address, server) + + def do_GET(self): + self.send_response(200) + self._set_headers() + + self.wfile.write(self.response_on_get.encode("utf-8")) + return + + def _set_headers(self): + self.send_header('Content-Type', 'application/json') + self.end_headers() + + @staticmethod + def _read_on_get_response(): + with open('sdc_get_response.json', 'r') as file: + return file.read() + + +if __name__ == '__main__': + SDCHandler.protocol_version = "HTTP/1.1" + + httpd = HTTPServer(('', DEFAULT_PORT), SDCHandler) + httpd.socket = ssl.wrap_socket(httpd.socket, server_side=True, certfile='cert.pem', keyfile='key.pem') + httpd.serve_forever() diff --git a/test/csit/tests/vid/resources/simulators/SDC_simulator b/test/csit/tests/vid/resources/simulators/SDC_simulator new file mode 100644 index 000000000..c099787dc --- /dev/null +++ b/test/csit/tests/vid/resources/simulators/SDC_simulator @@ -0,0 +1,15 @@ +FROM alpine:latest + +RUN apk add --no-cache python3 && \ + python3 -m ensurepip && \ + rm -r /usr/lib/python*/ensurepip && \ + pip3 install --upgrade pip setuptools && \ + if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \ + if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \ + rm -r /root/.cache + +ADD SDC.py / + +EXPOSE 8443 + +CMD [ "python", "./SDC.py" ] diff --git a/test/csit/tests/vid/resources/simulators/cert.pem b/test/csit/tests/vid/resources/simulators/cert.pem new file mode 100644 index 000000000..cea1e37a6 --- /dev/null +++ b/test/csit/tests/vid/resources/simulators/cert.pem @@ -0,0 +1,74 @@ +Bag Attributes + friendlyName: 1 + localKeyID: 54 69 6D 65 20 31 35 33 35 36 31 39 34 30 35 39 30 38 +subject=/C=US/ST=Michigan/L=Southfield/O=ATT Services, Inc./OU=ASDC/CN=mtanjv9sdcf51.aic.cip.att.com +issuer=/C=US/O=Symantec Corporation/OU=Symantec Trust Network/CN=Symantec Class 3 Secure Server CA - G4 +-----BEGIN CERTIFICATE----- +MIIGDzCCBPegAwIBAgIQfZLBdhhGhkOBcXuI5oF0gTANBgkqhkiG9w0BAQsFADB+ +MQswCQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAd +BgNVBAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxLzAtBgNVBAMTJlN5bWFudGVj +IENsYXNzIDMgU2VjdXJlIFNlcnZlciBDQSAtIEc0MB4XDTE1MTIwOTAwMDAwMFoX +DTE2MTIwODIzNTk1OVowgYkxCzAJBgNVBAYTAlVTMREwDwYDVQQIDAhNaWNoaWdh +bjETMBEGA1UEBwwKU291dGhmaWVsZDEbMBkGA1UECgwSQVRUIFNlcnZpY2VzLCBJ +bmMuMQ0wCwYDVQQLDARBU0RDMSYwJAYDVQQDDB1tdGFuanY5c2RjZjUxLmFpYy5j +aXAuYXR0LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOup99Ff +gk02lwXv535Y1FCCE8vL47BKj96h6to8rXwwN+9W+xiVEIgDXKOWBC7W8iEP2tOd +Smzi3wsZIivaFh2yPGtj1z0a7WuA7wNw1fJF4WGr4VFaxHbMBaPOZHa3D+iIduWP +H/t6ECEzfGRRtTt+mVCpV8Rx+v/q8d0yO114u/WBtbGGlIPDJcrHLRODnjM+mkjq +EwfoR9qqqjbJhjUkUujGM/qVKm3YAjMIZ1ldteRXUew4xI/Foo6u3hqJwbYIJf3r +fzWCt+fIyktDsm/c1w9HcX+8R0alK90bjC2D5auukIfbmhxd4MR9NBAH0SFleQtw +SQLN6GYMVexhUEECAwEAAaOCAnswggJ3MCgGA1UdEQQhMB+CHW10YW5qdjlzZGNm +NTEuYWljLmNpcC5hdHQuY29tMAkGA1UdEwQCMAAwDgYDVR0PAQH/BAQDAgWgMB0G +A1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBhBgNVHSAEWjBYMFYGBmeBDAEC +AjBMMCMGCCsGAQUFBwIBFhdodHRwczovL2Quc3ltY2IuY29tL2NwczAlBggrBgEF +BQcCAjAZGhdodHRwczovL2Quc3ltY2IuY29tL3JwYTAfBgNVHSMEGDAWgBRfYM9h +kFXfhEMUimAqsvV69EMY7zArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vc3Muc3lt +Y2IuY29tL3NzLmNybDBXBggrBgEFBQcBAQRLMEkwHwYIKwYBBQUHMAGGE2h0dHA6 +Ly9zcy5zeW1jZC5jb20wJgYIKwYBBQUHMAKGGmh0dHA6Ly9zcy5zeW1jYi5jb20v +c3MuY3J0MIIBBQYKKwYBBAHWeQIEAgSB9gSB8wDxAHYA3esdK3oNT6Ygi4GtgWhw +fi6OnQHVXIiNPRHEzbbsvswAAAFRh4XRnAAABAMARzBFAiBXZqph5qeHUUnY8OkH +jJLo454/8c9IBB7asjEYWYoBPQIhAKAwvP8KfqilgawBkuRV7r41P8Xd3Yi72RQO +1Dvpi8rkAHcApLkJkLQYWBSHuxOizGdwCjw1mAT5G9+443fNDsgN3BAAAAFRh4XR +3AAABAMASDBGAiEAon+cZcRpSsuo1aiCtaN3aAG0EqJb/1jJ4m4Q/qo1nEoCIQCr +KrBNyywa4OTmSVSAsyazbnMr5ldimxNORhhtyGeFLDANBgkqhkiG9w0BAQsFAAOC +AQEAG3/Mq8F0wbCpOOMCq4dZwgLENBjor9b9UljQZ+sgt7Nn00bfGdxY4MKtOTiK +9ks/nV9sW0KyvhsZvLPPgdSCnu0MZogWQsKqQDkIkJoHtFRSaYTT1vLAIoKz/dN+ +SBS71EzFH92lMfiFtAjfTrFady0/6z7lp4VZwbXLWjHw6LQESENc29Xw1jpCVkg8 +iB2n/qCFfyw3HuvP+eW2TLmnHOl0tda1vrYKCXT2n7HepiJM3g9yLjb/w3MuxEmw +dj1DqRemXtOUJW0mQXn1mRBjXEunzHoCr3GaeSU6G3RbIzXr34Hsv4IbggkhRula +gQIYidtDmw0PS1kyaFvlhZkd1g== +-----END CERTIFICATE----- +Bag Attributes + friendlyName: CN=Symantec Class 3 Secure Server CA - G4,OU=Symantec Trust Network,O=Symantec Corporation,C=US +subject=/C=US/O=Symantec Corporation/OU=Symantec Trust Network/CN=Symantec Class 3 Secure Server CA - G4 +issuer=/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5 +-----BEGIN CERTIFICATE----- +MIIFODCCBCCgAwIBAgIQUT+5dDhwtzRAQY0wkwaZ/zANBgkqhkiG9w0BAQsFADCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW +ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5IC0gRzUwHhcNMTMxMDMxMDAwMDAwWhcNMjMxMDMwMjM1OTU5WjB+MQsw +CQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNV +BAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxLzAtBgNVBAMTJlN5bWFudGVjIENs +YXNzIDMgU2VjdXJlIFNlcnZlciBDQSAtIEc0MIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEAstgFyhx0LbUXVjnFSlIJluhL2AzxaJ+aQihiw6UwU35VEYJb +A3oNL+F5BMm0lncZgQGUWfm893qZJ4Itt4PdWid/sgN6nFMl6UgfRk/InSn4vnlW +9vf92Tpo2otLgjNBEsPIPMzWlnqEIRoiBAMnF4scaGGTDw5RgDMdtLXO637QYqzu +s3sBdO9pNevK1T2p7peYyo2qRA4lmUoVlqTObQJUHypqJuIGOmNIrLRM0XWTUP8T +L9ba4cYY9Z/JJV3zADreJk20KQnNDz0jbxZKgRb78oMQw7jW2FUyPfG9D72MUpVK +Fpd6UiFjdS8W+cRmvvW1Cdj/JwDNRHxvSz+w9wIDAQABo4IBYzCCAV8wEgYDVR0T +AQH/BAgwBgEB/wIBADAwBgNVHR8EKTAnMCWgI6Ahhh9odHRwOi8vczEuc3ltY2Iu +Y29tL3BjYTMtZzUuY3JsMA4GA1UdDwEB/wQEAwIBBjAvBggrBgEFBQcBAQQjMCEw +HwYIKwYBBQUHMAGGE2h0dHA6Ly9zMi5zeW1jYi5jb20wawYDVR0gBGQwYjBgBgpg +hkgBhvhFAQc2MFIwJgYIKwYBBQUHAgEWGmh0dHA6Ly93d3cuc3ltYXV0aC5jb20v +Y3BzMCgGCCsGAQUFBwICMBwaGmh0dHA6Ly93d3cuc3ltYXV0aC5jb20vcnBhMCkG +A1UdEQQiMCCkHjAcMRowGAYDVQQDExFTeW1hbnRlY1BLSS0xLTUzNDAdBgNVHQ4E +FgQUX2DPYZBV34RDFIpgKrL1evRDGO8wHwYDVR0jBBgwFoAUf9Nlp8Ld7LvwMAnz +Qzn6Aq8zMTMwDQYJKoZIhvcNAQELBQADggEBAF6UVkndji1l9cE2UbYD49qecxny +H1mrWH5sJgUs+oHXXCMXIiw3k/eG7IXmsKP9H+IyqEVv4dn7ua/ScKAyQmW/hP4W +Ko8/xabWo5N9Q+l0IZE1KPRj6S7t9/Vcf0uatSDpCr3gRRAMFJSaXaXjS5HoJJtG +QGX0InLNmfiIEfXzf+YzguaoxX7+0AjiJVgIcWjmzaLmFN5OUiQt/eV5E1PnXi8t +TRttQBVSK/eHiXgSgW7ZTaoteNTCLD0IX4eRnh8OsN4wUmSGiaqdZpwOdgyA8nTY +Kvi4Os7X1g8RvmurFPW9QaAiY4nxug9vKWNmLT+sjHLF+8fk1A/yO0+MKcc= +-----END CERTIFICATE-----
\ No newline at end of file diff --git a/test/csit/tests/vid/resources/simulators/key.pem b/test/csit/tests/vid/resources/simulators/key.pem new file mode 100644 index 000000000..641d13fa0 --- /dev/null +++ b/test/csit/tests/vid/resources/simulators/key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDrqffRX4JNNpcF +7+d+WNRQghPLy+OwSo/eoeraPK18MDfvVvsYlRCIA1yjlgQu1vIhD9rTnUps4t8L +GSIr2hYdsjxrY9c9Gu1rgO8DcNXyReFhq+FRWsR2zAWjzmR2tw/oiHbljx/7ehAh +M3xkUbU7fplQqVfEcfr/6vHdMjtdeLv1gbWxhpSDwyXKxy0Tg54zPppI6hMH6Efa +qqo2yYY1JFLoxjP6lSpt2AIzCGdZXbXkV1HsOMSPxaKOrt4aicG2CCX96381grfn +yMpLQ7Jv3NcPR3F/vEdGpSvdG4wtg+WrrpCH25ocXeDEfTQQB9EhZXkLcEkCzehm +DFXsYVBBAgMBAAECggEBAOkwoYCzIktnFh+Q2R9DpKsZW59QXDfoP95LmAlk+0Gk +sOSKzCHx9o6vzO4uFmuG08Z1WtIElU2TXKMttotv3Gx8Hp8hBy12xLGYvmlIMNvv +2+n62xTWXQs0LOx+4Rg7Yml1Bzl1227KxMUlnhPiahO53NldB/Th2D197OA0wVtl +o3d753CNs+vVk1Z8RTUWrW1ZNHdfQNa1zrNo3Q5/evnlt+mAhFbUIKB3FgMk4N4/ +EjnTH6d+MEUD1sVCNruxqv8PZzRzzJEU/8gzy0WAPFAGOOC7hgU3n7dIEEkjvoIw +HlZD5c6I+3AzYq08CtUwWI09pNVlznqoOY6d548YusUCgYEA9cHOUXiafXFupqpT +HwE18Yk5sqISpPwS8yip4NPPUv+W9qvCpdkFvV3HRMlICWJGoerRsALEQYY5fsvY +7lk1avunprbIa9XLUrvb4ydJYynFhKjXkfTAmyCmbvH8t10BfDNuXT098+4M4HpG +YW2Arl9Db7RoOBwQtPFX2RmYOM8CgYEA9Xx4TbsbT1C6c49aDZmuFeBXDEaMTDYS +CC50MqMQpfoqS5QVyjl7JzP/dIz9CcUExFz7MOmYCp8yocXnLwxGDrZjZMkwEz15 +8WUGj4WMpSpUSRmGEVnoVE5bRazq37vhbOwh8gcKhF1ifVgwm+Rjs+4g6DwmSR8l +4CVK6lWrCe8CgYEA5QR7kR6z0Wywse4N0dnd/D1mIFq6xzcFLcZaMOMR1IXMmAjO +NqF8oNDQjwCH+f60VdWvHLgnTeyYjdnHSa6mghEMVecF9L/iXzIjopaM5DUcFRkG +8sRD7QxLLR6i4/lvFeAT3B3jKvtO0q4AAnD6NwUdoe5cJNW6l/REalNYsK8CgYBw +n7lF2CiwW9YevE7RXIc8rB7jl943/LqLHFzc+mjh7QLIh9jzXSm+E6IIY8KXX9dP +C2WGzDSf8ue0xmnI8PWXPGAfVhoDSboPYI0A/YFIKUJgAyC6ByiKvSQstCdRnA3Q +/giY1Fgj4AAWh4ZNjxua6g4Y3bem5m5nBlT3a3Q76wKBgQDSMFNfVNWautPQvcYB +iu9oQhbXVkjh+ToFWq6pW4VaWhEf/6hqvihc6PcB7FXJ1v1/ybko6cIgVmFUt43s +it1q5aLy3v6GTS/UnDZI3r5oECEuLeUqnHm3qilbatUtwvxghgdwGK+YG0yTfS3y +GqdNDH5YdJJMyiLdQlLIzJb/XQ== +-----END PRIVATE KEY----- diff --git a/test/csit/tests/vid/resources/simulators/sdc_get_response.json b/test/csit/tests/vid/resources/simulators/sdc_get_response.json new file mode 100644 index 000000000..9f7e118c5 --- /dev/null +++ b/test/csit/tests/vid/resources/simulators/sdc_get_response.json @@ -0,0 +1,301 @@ +{ + "service": { + "uuid": "2763bc78-8523-482f-895b-0c0db7364224", + "invariantUuid": "abb2dc66-b211-49d2-ab2f-8774694136fa", + "name": "Bare2", + "version": "1.0", + "toscaModelURL": null, + "category": "Network L1-3", + "serviceType": "", + "serviceRole": "", + "description": "Bare2", + "serviceEcompNaming": "true", + "instantiationType": "ClientConfig", + "inputs": {} + }, + "vnfs": { + "95e654c0-676b-4386-8a69 0": { + "uuid": "d6395498-7ecb-4eba-bf84-4380f6e9cdcf", + "invariantUuid": "16262b97-bcb1-4033-8f9f-a3016eaf1ec3", + "description": "vendor software product", + "name": "95e654c0-676b-4386-8a69", + "version": "1.0", + "customizationUuid": "34a3b91d-8d73-4412-bf4e-c6456741007f", + "inputs": {}, + "commands": {}, + "properties": { + "vf_module_id": "vTrafficPNG", + "repo_url_blob": "https://nexus.onap.org/content/sites/raw", + "unprotected_private_subnet_id": "zdfw1fwl01_unprotected_sub", + "public_net_id": "PUT THE PUBLIC NETWORK ID HERE", + "vfw_private_ip_0": "192.168.10.100", + "onap_private_subnet_id": "PUT THE ONAP PRIVATE NETWORK NAME HERE", + "onap_private_net_cidr": "10.0.0.0/16", + "image_name": "PUT THE VM IMAGE NAME HERE (UBUNTU 1404)", + "flavor_name": "PUT THE VM FLAVOR NAME HERE (m1.medium suggested)", + "vnf_id": "vPNG_Firewall_demo_app", + "vpg_name_0": "zdfw1fwl01pgn01", + "vpg_private_ip_1": "10.0.100.2", + "vsn_private_ip_0": "192.168.20.250", + "vpg_private_ip_0": "192.168.10.200", + "protected_private_net_cidr": "192.168.20.0/24", + "unprotected_private_net_cidr": "192.168.10.0/24", + "nf_naming": "{ecomp_generated_naming=true}", + "multi_stage_design": "false", + "onap_private_net_id": "PUT THE ONAP PRIVATE NETWORK NAME HERE", + "unprotected_private_net_id": "zdfw1fwl01_unprotected", + "availability_zone_max_count": "1", + "demo_artifacts_version": "1.2.1", + "pub_key": "PUT YOUR PUBLIC KEY HERE", + "key_name": "vfw_key", + "repo_url_artifacts": "https://nexus.onap.org/content/repositories/releases", + "install_script_version": "1.2.1", + "cloud_env": "PUT openstack OR rackspace HERE" + }, + "type": "VF", + "modelCustomizationName": "95e654c0-676b-4386-8a69 0", + "vfModules": { + "95e654c0676b43868a690..95e654c0676b43868a69..base_vpkg..module-0": { + "uuid": "12082e9d-a854-48cc-8243-e24b26199856", + "invariantUuid": "239419df-3375-49fe-9dd4-73b3393858ba", + "customizationUuid": "32c824f7-5910-4d7a-88ad-188d4905675d", + "description": null, + "name": "95e654c0676b43868a69..base_vpkg..module-0", + "version": "1", + "volumeGroupAllowed": false, + "commands": {}, + "modelCustomizationName": "95e654c0676b43868a69..base_vpkg..module-0", + "properties": { + "min_vf_module_instances": { + "name": "min_vf_module_instances", + "value": 1, + "entrySchema": null, + "required": true, + "constraints": [], + "description": "The minimum instances of this VF-Module", + "default": null, + "type": "integer" + }, + "vf_module_label": { + "name": "vf_module_label", + "value": "base_vpkg", + "entrySchema": null, + "required": true, + "constraints": [], + "description": "Alternate textual key used to reference this VF-Module model. Must be unique within the VNF model\n", + "default": null, + "type": "string" + }, + "max_vf_module_instances": { + "name": "max_vf_module_instances", + "value": 1, + "entrySchema": null, + "required": false, + "constraints": [], + "description": "The maximum instances of this VF-Module", + "default": null, + "type": "integer" + }, + "vfc_list": { + "name": "vfc_list", + "value": null, + "entrySchema": { + "description": "<vfc_id>:<count>", + "type": "string" + }, + "required": false, + "constraints": [], + "description": "Identifies the set of VM types and their count included in the VF-Module\n", + "default": null, + "type": "map" + }, + "vf_module_type": { + "name": "vf_module_type", + "value": "Base", + "entrySchema": null, + "required": true, + "constraints": [], + "description": "", + "default": null, + "type": "string" + }, + "vf_module_description": { + "name": "vf_module_description", + "value": null, + "entrySchema": null, + "required": true, + "constraints": [], + "description": "Description of the VF-modules contents and purpose (e.g. \"Front-End\" or \"Database Cluster\")\n", + "default": null, + "type": "string" + }, + "initial_count": { + "name": "initial_count", + "value": 1, + "entrySchema": null, + "required": false, + "constraints": [], + "description": "The initial count of instances of the VF-Module. The value must be in the range between min_vfmodule_instances and max_vfmodule_instances. If no value provided the initial count is the min_vfmodule_instances.\n", + "default": null, + "type": "integer" + }, + "volume_group": { + "name": "volume_group", + "value": false, + "entrySchema": null, + "required": true, + "constraints": [], + "description": "\"true\" indicates that this VF Module model requires attachment to a Volume Group. VID operator must select the Volume Group instance to attach to a VF-Module at deployment time.\n", + "default": false, + "type": "boolean" + }, + "availability_zone_count": { + "name": "availability_zone_count", + "value": null, + "entrySchema": null, + "required": false, + "constraints": [], + "description": "Quantity of Availability Zones needed for this VF-Module (source: Extracted from VF-Module HEAT template)\n", + "default": null, + "type": "integer" + }, + "isBase": { + "name": "isBase", + "value": false, + "entrySchema": null, + "required": true, + "constraints": [], + "description": "Whether this module should be deployed before other modules", + "default": false, + "type": "boolean" + } + } + } + }, + "volumeGroups": {} + } + }, + "networks": {}, + "configurations": {}, + "serviceProxies": {}, + "vfModules": { + "95e654c0676b43868a690..95e654c0676b43868a69..base_vpkg..module-0": { + "uuid": "12082e9d-a854-48cc-8243-e24b26199856", + "invariantUuid": "239419df-3375-49fe-9dd4-73b3393858ba", + "customizationUuid": "32c824f7-5910-4d7a-88ad-188d4905675d", + "description": null, + "name": "95e654c0676b43868a69..base_vpkg..module-0", + "version": "1", + "volumeGroupAllowed": false, + "commands": {}, + "modelCustomizationName": "95e654c0676b43868a69..base_vpkg..module-0", + "properties": { + "min_vf_module_instances": { + "name": "min_vf_module_instances", + "value": 1, + "entrySchema": null, + "required": true, + "constraints": [], + "description": "The minimum instances of this VF-Module", + "default": null, + "type": "integer" + }, + "vf_module_label": { + "name": "vf_module_label", + "value": "base_vpkg", + "entrySchema": null, + "required": true, + "constraints": [], + "description": "Alternate textual key used to reference this VF-Module model. Must be unique within the VNF model\n", + "default": null, + "type": "string" + }, + "max_vf_module_instances": { + "name": "max_vf_module_instances", + "value": 1, + "entrySchema": null, + "required": false, + "constraints": [], + "description": "The maximum instances of this VF-Module", + "default": null, + "type": "integer" + }, + "vfc_list": { + "name": "vfc_list", + "value": null, + "entrySchema": { + "description": "<vfc_id>:<count>", + "type": "string" + }, + "required": false, + "constraints": [], + "description": "Identifies the set of VM types and their count included in the VF-Module\n", + "default": null, + "type": "map" + }, + "vf_module_type": { + "name": "vf_module_type", + "value": "Base", + "entrySchema": null, + "required": true, + "constraints": [], + "description": "", + "default": null, + "type": "string" + }, + "vf_module_description": { + "name": "vf_module_description", + "value": null, + "entrySchema": null, + "required": true, + "constraints": [], + "description": "Description of the VF-modules contents and purpose (e.g. \"Front-End\" or \"Database Cluster\")\n", + "default": null, + "type": "string" + }, + "initial_count": { + "name": "initial_count", + "value": 1, + "entrySchema": null, + "required": false, + "constraints": [], + "description": "The initial count of instances of the VF-Module. The value must be in the range between min_vfmodule_instances and max_vfmodule_instances. If no value provided the initial count is the min_vfmodule_instances.\n", + "default": null, + "type": "integer" + }, + "volume_group": { + "name": "volume_group", + "value": false, + "entrySchema": null, + "required": true, + "constraints": [], + "description": "\"true\" indicates that this VF Module model requires attachment to a Volume Group. VID operator must select the Volume Group instance to attach to a VF-Module at deployment time.\n", + "default": false, + "type": "boolean" + }, + "availability_zone_count": { + "name": "availability_zone_count", + "value": null, + "entrySchema": null, + "required": false, + "constraints": [], + "description": "Quantity of Availability Zones needed for this VF-Module (source: Extracted from VF-Module HEAT template)\n", + "default": null, + "type": "integer" + }, + "isBase": { + "name": "isBase", + "value": false, + "entrySchema": null, + "required": true, + "constraints": [], + "description": "Whether this module should be deployed before other modules", + "default": false, + "type": "boolean" + } + } + } + }, + "volumeGroups": {}, + "pnfs": {} +}
\ No newline at end of file diff --git a/test/csit/tests/vnfsdk-pkgtools/tosca-metadata/create_validate_digest_signing.robot b/test/csit/tests/vnfsdk-pkgtools/tosca-metadata/create_validate_digest_signing.robot new file mode 100644 index 000000000..470b7c31d --- /dev/null +++ b/test/csit/tests/vnfsdk-pkgtools/tosca-metadata/create_validate_digest_signing.robot @@ -0,0 +1,21 @@ +*** settings *** +Library OperatingSystem + + +*** Variables *** +${csarpath} ${SCRIPTS}/../tests/vnfsdk-pkgtools/tosca-metadata/csar +${keyfile} ${SCRIPTS}/../tests/vnfsdk-pkgtools/tosca-metadata/test.key +${create_output} ${OUTPUT DIR}/test_signing.csar + +*** Test Cases *** +Create CSAR package + [Documentation] Create CSAR package + ${output}= Run vnfsdk csar-create -d ${create_output} --manifest test_entry.mf --history ChangeLog.txt --tests Tests --licenses Licenses --certificate test.crt --privkey ${keyfile} ${csarpath} test_entry.yaml + Log ${output} + File Should Exist ${create_output} + +Validate CSAR package + [Documentation] Validate CSAR package + ${rc} ${output}= Run and Return RC And Output vnfsdk csar-validate ${create_output} + Should Be Equal As Integers ${rc} 0 + Log ${output} diff --git a/test/csit/tests/vnfsdk-pkgtools/tosca-metadata/csar/test.crt b/test/csit/tests/vnfsdk-pkgtools/tosca-metadata/csar/test.crt new file mode 100644 index 000000000..63c85d4b4 --- /dev/null +++ b/test/csit/tests/vnfsdk-pkgtools/tosca-metadata/csar/test.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDIDCCAggCCQDrDujRIFtRTDANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJQ +VDEPMA0GA1UECAwGTGlzYm9hMQ8wDQYDVQQHDAZMaXNib2ExFDASBgNVBAoMC0V4 +YW1wbGUgT3JnMCAXDTE4MDgyNDA2MjY1OVoYDzIxMTYwMjEyMDYyNjU5WjBdMQsw +CQYDVQQGEwJQVDEPMA0GA1UECAwGTGlzYm9hMQ8wDQYDVQQHDAZMaXNib2ExFDAS +BgNVBAoMC0V4YW1wbGUgT3JnMRYwFAYDVQQDDA0qLmV4YW1wbGUub3JnMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwVDDqoO+C5dxgi1nnky+D4qqVdFG +mX3H4q6zFPUAkve3gElfttuDfbmN+OYCWhvKcjUN1Y2xjt+0aeRJVuQ+eumEX/1F +76i2t9c66fWPtdZ0V8IuDc2ajNxbKiAwYrwVl3AS2tJ32psHRLvpmLoOVz9UXY0J +rDwr274Z38wIqEGrUQ9hdOebEggeVu6Mv3pZUBYGGo9VX1/PTZguOaP85nC193Ux +SJe2+KV6aoc0odiokFmWK2JJrNb8bMjrQcQqp86JMW1DHyon5sF6edTIilxgC+SH +gapT5hZeoNnh3rAgHiWXF8ZOvho341s+7I78pbEtqCXNbF3VqikFlWmStQIDAQAB +MA0GCSqGSIb3DQEBCwUAA4IBAQCh8CffE1amceKSb7USEfkpsDbNYo+IWMDyVo9g +WQOYVIqIFGS8RMzs43Y6nIYJ/9pJUG10Qc4Yq1ZEqsV771Fz6WHx3zlJakVww/Ph +CxbakjO3EzIHVjEWIu3sUfMdyOeF0ZDHDnfQZYWC17d2jE+s8rH2epl2h1jhi8fS +i+eT2QDv8lHAM2mdM4jSwoCSsN7FImRxcYPoCxYwVkjVkmHhEMaUdqa1LKY/0YBf +PFm0pVDCBJZZvKGql44eKiaY/GNW9IyzQFprT8V1rhD1fbTBFXghVGVaUi2Am3JD ++eZYMzd4rzFLZm8bjNm0Oler1UJSR1K91lOEig3M8FTN6JRE +-----END CERTIFICATE----- diff --git a/test/csit/tests/vnfsdk-pkgtools/tosca-metadata/test.key b/test/csit/tests/vnfsdk-pkgtools/tosca-metadata/test.key new file mode 100644 index 000000000..06781d17e --- /dev/null +++ b/test/csit/tests/vnfsdk-pkgtools/tosca-metadata/test.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAwVDDqoO+C5dxgi1nnky+D4qqVdFGmX3H4q6zFPUAkve3gElf +ttuDfbmN+OYCWhvKcjUN1Y2xjt+0aeRJVuQ+eumEX/1F76i2t9c66fWPtdZ0V8Iu +Dc2ajNxbKiAwYrwVl3AS2tJ32psHRLvpmLoOVz9UXY0JrDwr274Z38wIqEGrUQ9h +dOebEggeVu6Mv3pZUBYGGo9VX1/PTZguOaP85nC193UxSJe2+KV6aoc0odiokFmW +K2JJrNb8bMjrQcQqp86JMW1DHyon5sF6edTIilxgC+SHgapT5hZeoNnh3rAgHiWX +F8ZOvho341s+7I78pbEtqCXNbF3VqikFlWmStQIDAQABAoIBAEWZ+pjuDgLGaAvi +pSgNoXCfEG0NiEnDS7CGDdxByg8gOWVrBZckudcOc9tllPs0flNYXr7A4Wj7ik2F +8BHk48oFQa/91KxRJlhSmdeanj9uEz11oHc/y6FjxT8Jj+I8rdl0dJVsqdJ/dsJ8 +lcJzWq53Er0MBquIjpHzhAVbxNIvEjQvuIyKPEomrvNN49fR5J7ExH8n1OnkuFRJ +L4L98inXPtcQF2Xgorh2YwhV0DiY5X88TZMCZ8m7CB0DhwZSMueFWa6Aj4m5G0HQ +kalXU3bCeBu66s3sXZHuGg1oF3MwwO7BX3/1fg8LoaLEvYHAOXH5PNRUzAgh7/mA +dneVYoECgYEA69oHQ9VvXGpqHnE5spAtmyJn7v32zXEPUibdqPCNrGXznvzXM+Do +xHB4K51H8wE/WGT/LGgVcubqr62f/SvmyO6RVOS+DRY4aYKyFif0+7mVHgWhoYOg +oEaODZrKdxC4SrSYaogsDCH7bdkh1VdJhCDx6ppUGXs9/ZfKJn9kG+0CgYEA0dR9 +BQ6qnrBDrZg7vW/xV/iL/PGsJVBUt7oAkN7g4Ub42eTjAhIPdMxipgAkj6EbhoBO +KpWELvRqC3oTUVutdTvRhdgummNKToZNaYG7CK5X6bsQh7l6tqLVkE1WqoT4yXvA +1ez7iOhOsTvugYLlRJd3MTNiKw6c9Pr5ihIHyOkCgYEAsMRtk4LBfzNmq8BS7Skw +dUhZO39u3dVyFTF6CqeYl3CmIjAAnypfavOcrZupFFGIB5lSwxaTlNXLabYo5hhk +VY6wsD7szmQsDbBeB0sVSyFxyNmRpbtAxT98MmgkfQ60AZHPdnDvCnzhtBf8Sqis +OfJzPlFC3QJImOuOIEJ0ZpUCgYAtwj0RYUVsHdxkexJsGYF0Qculeb6k1IPlHTcK +YNCB0ExsmDG5Pd8JBZltwhI3EFdEWa6yMrEE3GBT6GdWErwdGNJ0cdSX7pdB0KAJ +JjV3iy241waf0p8kPRZ9xZ/kx+LJbad7/5ZLIP4oQH2e2MDO2IkxvZbm9OTdt+27 +Yns4IQKBgEuQv0JTt+o6/1cwZkMvXDKf0vW2nbPG9gbP3gy9Js0mOG0eWYCsNehO +DGLViyV2XURCskM4ZSA7Xc71lbCFhOV+jDXEipAjw8S8WJWdTraoF1QV12YEdlL/ +KdcxuJKVX8vdE9UCOxH/wcDG/JXAHX3qrMudJgAp598nyk6g2cNt +-----END RSA PRIVATE KEY----- |