diff options
Diffstat (limited to 'test/csit/scripts')
23 files changed, 810 insertions, 39 deletions
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 |