diff options
32 files changed, 316 insertions, 896 deletions
diff --git a/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-e2e.yml b/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-e2e.yml index a60b30b9..bf28b9fa 100644 --- a/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-e2e.yml +++ b/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-e2e.yml @@ -1,7 +1,7 @@ version: '2.1' services: datarouter-prov: - image: nexus3.onap.org:10001/onap/dmaap/datarouter-prov:2.1.0-SNAPSHOT-latest + image: nexus3.onap.org:10001/onap/dmaap/datarouter-prov container_name: datarouter-prov hostname: dmaap-dr-prov ports: @@ -25,7 +25,7 @@ services: - "dcae-pm-mapper:3.3.3.3" datarouter-node: - image: nexus3.onap.org:10001/onap/dmaap/datarouter-node:2.1.0-SNAPSHOT-latest + image: nexus3.onap.org:10001/onap/dmaap/datarouter-node container_name: datarouter-node hostname: dmaap-dr-node ports: diff --git a/plans/dmaap-datarouter/dr-suite/setup.sh b/plans/dmaap-datarouter/dr-suite/setup.sh deleted file mode 100755 index 398eb7cd..00000000 --- a/plans/dmaap-datarouter/dr-suite/setup.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/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/datarouter-docker-compose/src/main/resources -cp $WORKSPACE/plans/dmaap-datarouter/dr-suite/docker-compose/docker-compose.yml . -cp $WORKSPACE/plans/dmaap-datarouter/dr-suite/docker-compose/provserver.properties ./prov_data/provserver.properties -cp $WORKSPACE/plans/dmaap-datarouter/dr-suite/docker-compose/node.properties ./node_data/node.properties - -# 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..10}; do - if [ $(docker inspect --format '{{ .State.Running }}' subscriber-node2) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' subscriber-node) ] && \ - [ $(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 - -# Wait for healthy container datarouter-prov -for i in {1..10}; do - if [ "$(docker inspect --format '{{ .State.Health.Status }}' datarouter-prov)" = 'healthy' ] - then - echo datarouter-prov.State.Health.Status is $(docker inspect --format '{{ .State.Health.Status }}' datarouter-prov) - echo "DR Service Running, datarouter-prov container is healthy" - break - else - echo datarouter-prov.State.Health.Status is $(docker inspect --format '{{ .State.Health.Status }}' datarouter-prov) - echo sleep $i - sleep $i - if [ $i = 10 ] - then - echo datarouter-prov container is not in healthy state - the test is not made, teardown... - cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources - docker-compose rm -sf - exit 1 - fi - fi -done - -DR_PROV_IP=`get-instance-ip.sh datarouter-prov` -DR_NODE_IP=`get-instance-ip.sh datarouter-node` -DR_SUB_IP=`get-instance-ip.sh subscriber-node` -DR_SUB2_IP=`get-instance-ip.sh subscriber-node2` -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_SUB_IP=${DR_SUB_IP} -echo DR_SUB2_IP=${DR_SUB2_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/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} -v DR_SUB_IP:${DR_SUB_IP} -v DR_SUB2_IP:${DR_SUB2_IP}" diff --git a/plans/dmaap-datarouter/dr-suite/teardown.sh b/plans/dmaap-datarouter/dr-suite/teardown.sh deleted file mode 100755 index 1b20842c..00000000 --- a/plans/dmaap-datarouter/dr-suite/teardown.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources -docker-compose rm -sf diff --git a/plans/dmaap-datarouter/dr-suite/testplan.txt b/plans/dmaap-datarouter/dr-suite/testplan.txt deleted file mode 100755 index 8349a056..00000000 --- a/plans/dmaap-datarouter/dr-suite/testplan.txt +++ /dev/null @@ -1,2 +0,0 @@ -# Place the suites in run order. -dmaap-datarouter/dr-suite diff --git a/plans/dmaap-datarouter/dr-suite/docker-compose/docker-compose.yml b/plans/dmaap-datarouter/ssl-dr-suite/docker-compose/docker-compose.yml index ed8a7c04..ed8a7c04 100644 --- a/plans/dmaap-datarouter/dr-suite/docker-compose/docker-compose.yml +++ b/plans/dmaap-datarouter/ssl-dr-suite/docker-compose/docker-compose.yml diff --git a/plans/dmaap-datarouter/dr-suite/docker-compose/node.properties b/plans/dmaap-datarouter/ssl-dr-suite/docker-compose/node.properties index c692b906..1d7a5d42 100644 --- a/plans/dmaap-datarouter/dr-suite/docker-compose/node.properties +++ b/plans/dmaap-datarouter/ssl-dr-suite/docker-compose/node.properties @@ -2,7 +2,7 @@ # ============LICENSE_START================================================== # * org.onap.dmaap # * =========================================================================== -# * Copyright � 2017 AT&T Intellectual Property. All rights reserved. +# * Copyright © 2017 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. @@ -57,26 +57,11 @@ SpoolDir = /opt/app/datartr/spool RedirectionFile = etc/redirections.dat # # The type of keystore for https -KeyStoreType = jks -# -# The path to the keystore for https -KeyStoreFile = /opt/app/datartr/aaf_certs/org.onap.dmaap-dr.jks -# -# The password for the https keystore -KeyStorePassword=WGxd2P6MDo*Bi4+UdzWs{?$8 -# -# The password for the private key in the https keystore -KeyPassword=WGxd2P6MDo*Bi4+UdzWs{?$8 +KeyStoreType = PKCS12 # # The type of truststore for https TrustStoreType = jks # -# The path to the truststore for https -TrustStoreFile = /opt/app/datartr/aaf_certs/org.onap.dmaap-dr.trust.jks -# -# The password for the https truststore -TrustStorePassword=)OBvCd{e{aWq.^mJJdX:S:1& -# # The path to the file used to trigger an orderly shutdown QuiesceFile = etc/SHUTDOWN # @@ -95,9 +80,8 @@ AAFInstance = legacy # AAF action to generate permission string - default should be publish AAFAction = publish # -# AAF URL to connect to AAF server -AafUrl = https://aaf-onap-test.osaaf.org:8095 -# # AAF CADI enabled flag CadiEnabled = false - +# +# AAF Props file path +AAFPropsFilePath = /opt/app/osaaf/local/org.onap.dmaap-dr.props diff --git a/plans/dmaap-datarouter/dr-suite/docker-compose/provserver.properties b/plans/dmaap-datarouter/ssl-dr-suite/docker-compose/provserver.properties index f0edb713..3930bd09 100755 --- a/plans/dmaap-datarouter/dr-suite/docker-compose/provserver.properties +++ b/plans/dmaap-datarouter/ssl-dr-suite/docker-compose/provserver.properties @@ -2,7 +2,7 @@ # ============LICENSE_START================================================== # * org.onap.dmaap # * =========================================================================== -# * Copyright � 2017 AT&T Intellectual Property. All rights reserved. +# * Copyright © 2017 AT&T Intellectual Property. All rights reserved. # * Modifications Copyright (C) 2018 Nokia. All rights reserved. # * =========================================================================== # * Licensed under the Apache License, Version 2.0 (the "License"); @@ -27,12 +27,7 @@ org.onap.dmaap.datarouter.provserver.http.port = 8080 org.onap.dmaap.datarouter.provserver.https.port = 8443 org.onap.dmaap.datarouter.provserver.https.relaxation = true -org.onap.dmaap.datarouter.provserver.keystore.type = jks -org.onap.dmaap.datarouter.provserver.keymanager.password = FZNkU,B%NJzcT1v7;^v]M#ZX -org.onap.dmaap.datarouter.provserver.keystore.path = /opt/app/datartr/aaf_certs/org.onap.dmaap-dr.jks -org.onap.dmaap.datarouter.provserver.keystore.password = FZNkU,B%NJzcT1v7;^v]M#ZX -org.onap.dmaap.datarouter.provserver.truststore.path = /opt/app/datartr/aaf_certs/org.onap.dmaap-dr.trust.jks -org.onap.dmaap.datarouter.provserver.truststore.password = +mzf@J.D^;3!![*Xr.z$c#?b +org.onap.dmaap.datarouter.provserver.aafprops.path = /opt/app/osaaf/local/org.onap.dmaap-dr.props org.onap.dmaap.datarouter.provserver.accesslog.dir = /opt/app/datartr/logs org.onap.dmaap.datarouter.provserver.spooldir = /opt/app/datartr/spool @@ -58,12 +53,9 @@ org.onap.dmaap.datarouter.provserver.https.include.protocols = TLSv1.1|TLSv1.2 # AAF config org.onap.dmaap.datarouter.provserver.cadi.enabled = false -org.onap.dmaap.datarouter.provserver.passwordencription = PasswordEncryptionKey#@$%^&1234# +org.onap.dmaap.datarouter.provserver.passwordencryption = PasswordEncryptionKey#@$%^&1234# org.onap.dmaap.datarouter.provserver.aaf.feed.type = org.onap.dmaap-dr.feed org.onap.dmaap.datarouter.provserver.aaf.sub.type = org.onap.dmaap-dr.sub org.onap.dmaap.datarouter.provserver.aaf.instance = legacy org.onap.dmaap.datarouter.provserver.aaf.action.publish = publish -org.onap.dmaap.datarouter.provserver.aaf.action.subscribe = subscribe - -# AAF URL to connect to AAF server -org.onap.dmaap.datarouter.provserver.cadi.aaf.url = https://aaf-onap-test.osaaf.org:8095
\ No newline at end of file +org.onap.dmaap.datarouter.provserver.aaf.action.subscribe = subscribe
\ No newline at end of file diff --git a/plans/dmaap-datarouter/ssl-dr-suite/setup.sh b/plans/dmaap-datarouter/ssl-dr-suite/setup.sh index 39217991..e1f2cb46 100755 --- a/plans/dmaap-datarouter/ssl-dr-suite/setup.sh +++ b/plans/dmaap-datarouter/ssl-dr-suite/setup.sh @@ -18,6 +18,8 @@ # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END========================================================= # + + source ${SCRIPTS}/common_functions.sh # Clone DMaaP Data Router repo @@ -28,6 +30,9 @@ git clone --depth 1 https://gerrit.onap.org/r/dmaap/datarouter -b master cd datarouter git pull cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources +cp $WORKSPACE/plans/dmaap-datarouter/ssl-dr-suite/docker-compose/docker-compose.yml . +cp $WORKSPACE/plans/dmaap-datarouter/ssl-dr-suite/docker-compose/provserver.properties ./prov_data/provserver.properties +cp $WORKSPACE/plans/dmaap-datarouter/ssl-dr-suite/docker-compose/node.properties ./node_data/node.properties # start DMaaP DR containers with docker compose and configuration from docker-compose.yml docker login -u docker -p docker nexus3.onap.org:10001 @@ -35,9 +40,10 @@ docker-compose up -d # Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb for i in {1..10}; do - if [ $(docker inspect --format '{{ .State.Running }}' datarouter-node) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' datarouter-prov) ] && \ + if [ $(docker inspect --format '{{ .State.Running }}' subscriber-node2) ] && \ [ $(docker inspect --format '{{ .State.Running }}' subscriber-node) ] && \ + [ $(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" @@ -48,14 +54,37 @@ for i in {1..10}; do fi done +# Wait for healthy container datarouter-prov +for i in {1..10}; do + if [ "$(docker inspect --format '{{ .State.Health.Status }}' datarouter-prov)" = 'healthy' ] + then + echo datarouter-prov.State.Health.Status is $(docker inspect --format '{{ .State.Health.Status }}' datarouter-prov) + echo "DR Service Running, datarouter-prov container is healthy" + break + else + echo datarouter-prov.State.Health.Status is $(docker inspect --format '{{ .State.Health.Status }}' datarouter-prov) + echo sleep $i + sleep $i + if [ $i = 10 ] + then + echo datarouter-prov container is not in healthy state - the test is not made, teardown... + cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources + docker-compose rm -sf + exit 1 + fi + fi +done + DR_PROV_IP=`get-instance-ip.sh datarouter-prov` DR_NODE_IP=`get-instance-ip.sh datarouter-node` DR_SUB_IP=`get-instance-ip.sh subscriber-node` +DR_SUB2_IP=`get-instance-ip.sh subscriber-node2` 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_SUB_IP=${DR_SUB_IP} +echo DR_SUB2_IP=${DR_SUB2_IP} echo DR_GATEWAY_IP=${DR_GATEWAY_IP} sudo sed -i "$ a $DR_PROV_IP dmaap-dr-prov" /etc/hosts @@ -63,6 +92,7 @@ sudo sed -i "$ a $DR_NODE_IP dmaap-dr-node" /etc/hosts python $WORKSPACE/scripts/dmaap-datarouter/update_ca.py -docker exec -i datarouter-prov sh -c "curl -k -X PUT https://dmaap-dr-prov:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$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" -ROBOT_VARIABLES="-v DR_SUB_IP:${DR_SUB_IP}"
\ No newline at end of file +#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} -v DR_SUB_IP:${DR_SUB_IP} -v DR_SUB2_IP:${DR_SUB2_IP}"
\ No newline at end of file diff --git a/plans/dmaap-datarouter/ssl-dr-suite/teardown.sh b/plans/dmaap-datarouter/ssl-dr-suite/teardown.sh index 3cf35373..d8ec4dc9 100755 --- a/plans/dmaap-datarouter/ssl-dr-suite/teardown.sh +++ b/plans/dmaap-datarouter/ssl-dr-suite/teardown.sh @@ -22,5 +22,5 @@ cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources sudo sed -i".bak" '/dmaap-dr-prov/d' /etc/hosts sudo sed -i".bak" '/dmaap-dr-node/d' /etc/hosts -docker-compose down -v +docker-compose rm -sf python $WORKSPACE/scripts/dmaap-datarouter/remove_cert_from_ca.py diff --git a/plans/vfc-nfvo-catalog/sanity-check/testplan.txt b/plans/vfc-nfvo-catalog/sanity-check/testplan.txt index 65cadf99..31512437 100644 --- a/plans/vfc-nfvo-catalog/sanity-check/testplan.txt +++ b/plans/vfc-nfvo-catalog/sanity-check/testplan.txt @@ -1,5 +1,5 @@ # Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. +# Place the suites in run order. vfc/nfvo-catalog/test.robot vfc/nfvo-catalog/Subscriptions.robot vfc/nfvo-catalog/IndividualSubscription.robot diff --git a/plans/vfc-nfvo-lcm/sanity-check/testplan.txt b/plans/vfc-nfvo-lcm/sanity-check/testplan.txt index 2e0a32d5..90ea734f 100644 --- a/plans/vfc-nfvo-lcm/sanity-check/testplan.txt +++ b/plans/vfc-nfvo-lcm/sanity-check/testplan.txt @@ -1,3 +1,3 @@ # Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. +# Place the suites in run order. vfc/nfvo-lcm/test.robot diff --git a/tests/dmaap-datarouter/dr-suite/dr-suite.robot b/tests/dmaap-datarouter/dr-suite/dr-suite.robot deleted file mode 100755 index c4379153..00000000 --- a/tests/dmaap-datarouter/dr-suite/dr-suite.robot +++ /dev/null @@ -1,179 +0,0 @@ -*** Settings *** -Library OperatingSystem -Library RequestsLibrary -Library requests -Library Collections -Library Process -Library String - -*** Variables *** -${TARGET_URL} https://${DR_PROV_IP}:8443 -${TARGET_URL_FEED} https://${DR_PROV_IP}:8443/feed/1 -${TARGET_URL_EXISTS_LOGGING} https://${DR_PROV_IP}:8443/feedlog/1?type=pub&filename=csit_test -${TARGET_URL_NOT_EXISTS_LOGGING} https://${DR_PROV_IP}:8443/feedlog/1?type=pub&filename=file_that_doesnt_exist -${TARGET_URL_SUBSCRIBE} https://${DR_PROV_IP}:8443/subscribe/1 -${TARGET_URL_SUBSCRIPTION} https://${DR_PROV_IP}:8443/subs/1 -${TARGET_URL_PUBLISH_PROV} https://${DR_PROV_IP}:8443/publish/1/csit_test -${TARGET_URL_PUBLISH_NODE} https://${DR_NODE_IP}:8443/publish/1/csit_test -${TARGET_URL_DELETE_FILE} https://${DR_NODE_IP}:8443/delete/2 - -${FEED_CONTENT_TYPE} application/vnd.dmaap-dr.feed -${SUBSCRIBE_CONTENT_TYPE} application/vnd.dmaap-dr.subscription -${PUBLISH_FEED_CONTENT_TYPE} application/octet-stream - -${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":"http://${DR_SUB_IP}:7070/", "user":"LOGIN", "password":"PASSWORD", "use100":true}, "metadataOnly":false, "suspend":false, "groupid":29, "subscriber":"sg481n", "privilegedSubscriber":false} -${UPDATE_SUBSCRIPTION_DATA} {"delivery":{ "url":"http://${DR_SUB_IP}:7070/", "user":"sg481n", "password":"sg481n", "use100":true}, "metadataOnly":false, "suspend":true, "groupid":29, "subscriber":"sg481n", "privilegedSubscriber":false} -${SUBSCRIBE2_DATA} {"delivery":{ "url":"http://${DR_SUB2_IP}:7070/", "user":"LOGIN", "password":"PASSWORD", "use100":true}, "metadataOnly":false, "suspend":false, "groupid":29, "subscriber":"privileged", "privilegedSubscriber":true} - -${CLI_VERIFY_SUB_RECEIVED_FILE} docker exec subscriber-node /bin/sh -c "ls /opt/app/subscriber/delivery | grep csit_test" -${CLI_VERIFY_FILE_REMAINS_ON_NODE} docker exec datarouter-node /bin/sh -c "ls /opt/app/datartr/spool/s/0/2 | grep dmaap-dr-node | grep -v .M" - -*** 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 Subscribe to Feed with Privileged Subscription - [Documentation] Subscribe to Feed with privileged subscription - [Timeout] 1 minute - ${resp}= PostCall ${TARGET_URL_SUBSCRIBE} ${SUBSCRIBE2_DATA} ${SUBSCRIBE_CONTENT_TYPE} privileged - log ${TARGET_URL_SUBSCRIBE} - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 201 - log 'JSON Response Code:'${resp} - -Run Publish to 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_PROV} ${CREATE_FEED_DATA} ${PUBLISH_FEED_CONTENT_TYPE} rs873m - log ${TARGET_URL_PUBLISH_PROV} - Should Contain ${resp.headers['Location']} https://dmaap-dr-node:8443/publish/1/csit_test - ${resp}= PutCall ${TARGET_URL_PUBLISH_NODE} ${CREATE_FEED_DATA} ${PUBLISH_FEED_CONTENT_TYPE} rs873m - Should Be Equal As Strings ${resp.status_code} 204 - log 'JSON Response Code:'${resp} - -Verify Subscriber Received Published File - [Documentation] Verify file is delivered to datarouter-subscriber - [Timeout] 1 minute - Sleep 5s Time to allow subscriber to receive the file - ${cli_cmd_output}= Run Process ${CLI_VERIFY_SUB_RECEIVED_FILE} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} csit_test - - -Verify File Remains On Privileged Subscriber And Delete It - [Documentation] Verify file has not been deleted on datarouter-node and delete it using DELETE API - [Timeout] 1 minute - ${cli_cmd_output}= Run Process ${CLI_VERIFY_FILE_REMAINS_ON_NODE} shell=yes - log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} dmaap-dr-node - ${resp}= DeleteCall ${TARGET_URL_DELETE_FILE}/${cli_cmd_output.stdout} rs873m - Should Be Equal As Strings ${resp.status_code} 200 - log 'JSON Response Code:'${resp} - ${cli_cmd_output}= Run Process ${CLI_VERIFY_FILE_REMAINS_ON_NODE} shell=yes - log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 1 - -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 Get With Filename That Exists - [Documentation] Get publish record with a specified filename - [Timeout] 2 minutes - sleep 1 minute 45 seconds needed to ensure logs have been updated - ${resp}= GetCall ${TARGET_URL_EXISTS_LOGGING} ${FEED_CONTENT_TYPE} rs873m - log ${resp.text} - Should Contain ${resp.text} "fileName":"csit_test" - log 'JSON Response Code:'${resp} - -Run Get With Filename That Doesnt Exist - [Documentation] Get publish record with a specified filename - [Timeout] 1 minute - ${resp}= GetCall ${TARGET_URL_NOT_EXISTS_LOGGING} ${FEED_CONTENT_TYPE} rs873m - log ${resp.text} - Should Contain ${resp.text} [] - 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-DMAAP-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-DMAAP-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} Authorization=Basic cnM4NzNtOnJzODczbQ== - ${resp}= Evaluate requests.put('${url}', data='${data}', headers=${headers}, verify=False, allow_redirects=False) requests - [Return] ${resp} - -GetCall - [Arguments] ${url} ${content_type} ${user} - ${headers}= Create Dictionary X-DMAAP-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-DMAAP-DR-ON-BEHALF-OF=${user} - ${resp}= Evaluate requests.delete('${url}', headers=${headers}, verify=False) requests - [Return] ${resp} diff --git a/tests/dmaap-datarouter/ssl-dr-suite/ssl-dr-suite.robot b/tests/dmaap-datarouter/ssl-dr-suite/ssl-dr-suite.robot index 74dda82e..2f96cdc8 100755 --- a/tests/dmaap-datarouter/ssl-dr-suite/ssl-dr-suite.robot +++ b/tests/dmaap-datarouter/ssl-dr-suite/ssl-dr-suite.robot @@ -3,17 +3,32 @@ Library OperatingSystem Library RequestsLibrary Library requests Library Collections -Library String Library Process +Library String *** Variables *** -${TARGET_URL} https://dmaap-dr-prov:8443/ -${CREATE_FEED_DATA} {"name": "CSIT_Test", "version": "v1.0.0", "description": "CSIT_Test", "business_description": "CSIT_Test", "suspend": false, "deleted": false, "changeowner": true, "authorization": {"classification": "unclassified", "endpoint_addrs": [], "endpoint_ids": [{"password": "dradmin", "id": "dradmin"}]}} -${SUBSCRIBE_DATA} {"delivery":{ "url":"http://${DR_SUB_IP}:7070/", "user":"LOGIN", "password":"PASSWORD", "use100":true}, "metadataOnly":false, "suspend":false, "groupid":29, "subscriber":"dmaap-subscriber"} -${FEED_CONTENT_TYPE} application/vnd.dmaap-dr.feed -${SUBSCRIBE_CONTENT_TYPE} application/vnd.dmaap-dr.subscription -${PUBLISH_FEED_CONTENT_TYPE} application/octet-stream -${CLI_VERIFY_SUB_RECEIVED_FILE} docker exec subscriber-node /bin/sh -c "ls /opt/app/subscriber/delivery | grep csit_test" +${TARGET_URL} https://dmaap-dr-prov:8443/ +${TARGET_URL_FEED} https://dmaap-dr-prov:8443/feed/1 +${TARGET_URL_EXISTS_LOGGING} https://dmaap-dr-prov:8443/feedlog/1?type=pub&filename=csit_test +${TARGET_URL_NOT_EXISTS_LOGGING} https://dmaap-dr-prov:8443/feedlog/1?type=pub&filename=file_that_doesnt_exist +${TARGET_URL_SUBSCRIBE} https://dmaap-dr-prov:8443/subscribe/1 +${TARGET_URL_SUBSCRIPTION} https://dmaap-dr-prov:8443/subs/1 +${TARGET_URL_PUBLISH_PROV} https://dmaap-dr-prov:8443/publish/1/csit_test +${TARGET_URL_PUBLISH_NODE} https://dmaap-dr-node:8443/publish/1/csit_test +${TARGET_URL_DELETE_FILE} https://dmaap-dr-node:8443/delete/2 + +${FEED_CONTENT_TYPE} application/vnd.dmaap-dr.feed +${SUBSCRIBE_CONTENT_TYPE} application/vnd.dmaap-dr.subscription +${PUBLISH_FEED_CONTENT_TYPE} application/octet-stream + +${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": "dradmin", "id": "dradmin"}]}} +${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": "dradmin", "id": "dradmin"}]}} +${SUBSCRIBE_DATA} {"delivery":{ "url":"http://${DR_SUB_IP}:7070/", "user":"LOGIN", "password":"PASSWORD", "use100":true}, "metadataOnly":false, "suspend":false, "groupid":29, "subscriber":"dradmin", "privilegedSubscriber":false} +${UPDATE_SUBSCRIPTION_DATA} {"delivery":{ "url":"http://${DR_SUB_IP}:7070/", "user":"dradmin", "password":"dradmin", "use100":true}, "metadataOnly":false, "suspend":true, "groupid":29, "subscriber":"dradmin", "privilegedSubscriber":false} +${SUBSCRIBE2_DATA} {"delivery":{ "url":"http://${DR_SUB2_IP}:7070/", "user":"LOGIN", "password":"PASSWORD", "use100":true}, "metadataOnly":false, "suspend":false, "groupid":29, "subscriber":"privileged", "privilegedSubscriber":true} + +${CLI_VERIFY_SUB_RECEIVED_FILE} docker exec subscriber-node /bin/sh -c "ls /opt/app/subscriber/delivery | grep csit_test" +${CLI_VERIFY_FILE_REMAINS_ON_NODE} docker exec datarouter-node /bin/sh -c "ls /opt/app/datartr/spool/s/0/2 | grep dmaap-dr-node | grep -v .M" *** Test Cases *** Run Feed Creation @@ -28,8 +43,17 @@ Run Feed Creation Run Subscribe to Feed [Documentation] Subscribe to Feed [Timeout] 1 minute - ${resp}= PostCall ${TARGET_URL}subscribe/1 ${SUBSCRIBE_DATA} ${SUBSCRIBE_CONTENT_TYPE} dradmin - log ${TARGET_URL}subscribe/1 + ${resp}= PostCall ${TARGET_URL_SUBSCRIBE} ${SUBSCRIBE_DATA} ${SUBSCRIBE_CONTENT_TYPE} dradmin + log ${TARGET_URL_SUBSCRIBE} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 201 + log 'JSON Response Code:'${resp} + +Run Subscribe to Feed with Privileged Subscription + [Documentation] Subscribe to Feed with privileged subscription + [Timeout] 1 minute + ${resp}= PostCall ${TARGET_URL_SUBSCRIBE} ${SUBSCRIBE2_DATA} ${SUBSCRIBE_CONTENT_TYPE} privileged + log ${TARGET_URL_SUBSCRIBE} log ${resp.text} Should Be Equal As Strings ${resp.status_code} 201 log 'JSON Response Code:'${resp} @@ -38,23 +62,96 @@ Run Publish to 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/1/csit_test ${CREATE_FEED_DATA} ${PUBLISH_FEED_CONTENT_TYPE} dradmin - log ${TARGET_URL}publish/1/csit_test - ${redirect_location}= Set Variable ${resp.headers['Location']} - log ${redirect_location} - ${resp}= PutCall ${redirect_location} ${CREATE_FEED_DATA} ${PUBLISH_FEED_CONTENT_TYPE} dradmin - log ${resp.text} + ${resp}= PutCall ${TARGET_URL_PUBLISH_PROV} ${CREATE_FEED_DATA} ${PUBLISH_FEED_CONTENT_TYPE} dradmin + log ${TARGET_URL_PUBLISH_PROV} + Should Contain ${resp.headers['Location']} https://dmaap-dr-node:8443/publish/1/csit_test + ${resp}= PutCall ${TARGET_URL_PUBLISH_NODE} ${CREATE_FEED_DATA} ${PUBLISH_FEED_CONTENT_TYPE} dradmin Should Be Equal As Strings ${resp.status_code} 204 log 'JSON Response Code:'${resp} Verify Subscriber Received Published File - [Documentation] Verify file is delivered on datarouter-subscriber + [Documentation] Verify file is delivered to datarouter-subscriber [Timeout] 1 minute - Sleep 5s Time to allow subscriber to receive the file - ${cli_cmd_output}= Run Process ${CLI_VERIFY_SUB_RECEIVED_FILE} shell=yes + Sleep 5s Time to allow subscriber to receive the file + ${cli_cmd_output}= Run Process ${CLI_VERIFY_SUB_RECEIVED_FILE} shell=yes Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} csit_test + Should Be Equal As Strings ${cli_cmd_output.rc} 0 + Should Contain ${cli_cmd_output.stdout} csit_test + + +Verify File Remains On Privileged Subscriber And Delete It + [Documentation] Verify file has not been deleted on datarouter-node and delete it using DELETE API + [Timeout] 1 minute + ${cli_cmd_output}= Run Process ${CLI_VERIFY_FILE_REMAINS_ON_NODE} shell=yes + log ${cli_cmd_output.stdout} + Should Be Equal As Strings ${cli_cmd_output.rc} 0 + Should Contain ${cli_cmd_output.stdout} dmaap-dr-node + ${resp}= DeleteCall ${TARGET_URL_DELETE_FILE}/${cli_cmd_output.stdout} dradmin + Should Be Equal As Strings ${resp.status_code} 200 + log 'JSON Response Code:'${resp} + ${cli_cmd_output}= Run Process ${CLI_VERIFY_FILE_REMAINS_ON_NODE} shell=yes + log ${cli_cmd_output.stdout} + Should Be Equal As Strings ${cli_cmd_output.rc} 1 + +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} dradmin + 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} dradmin + log ${resp.text} + Should Contain ${resp.text} "password":"dradmin","user":"dradmin" + 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} dradmin + 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} dradmin + log ${resp.text} + Should Contain ${resp.text} "UPDATED-CSIT_Test" + log 'JSON Response Code:'${resp} + +Run Get With Filename That Exists + [Documentation] Get publish record with a specified filename + [Timeout] 2 minutes + sleep 1 minute 45 seconds needed to ensure logs have been updated + ${resp}= GetCall ${TARGET_URL_EXISTS_LOGGING} ${FEED_CONTENT_TYPE} dradmin + log ${resp.text} + Should Contain ${resp.text} "fileName":"csit_test" + log 'JSON Response Code:'${resp} + +Run Get With Filename That Doesnt Exist + [Documentation] Get publish record with a specified filename + [Timeout] 1 minute + ${resp}= GetCall ${TARGET_URL_NOT_EXISTS_LOGGING} ${FEED_CONTENT_TYPE} dradmin + log ${resp.text} + Should Contain ${resp.text} [] + log 'JSON Response Code:'${resp} + + +Run Delete Subscription + [Documentation] Delete Subscription + [Timeout] 1 minute + ${resp}= DeleteCall ${TARGET_URL_SUBSCRIPTION} dradmin + 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} dradmin + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 204 + log 'JSON Response Code:'${resp} *** Keywords *** PostCall @@ -69,6 +166,12 @@ PutCall ${resp}= Evaluate requests.put('${url}', data='${data}', headers=${headers}, verify=True, allow_redirects=False) requests [Return] ${resp} +GetCall + [Arguments] ${url} ${content_type} ${user} + ${headers}= Create Dictionary X-DMAAP-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} + ${resp}= Evaluate requests.get('${url}', headers=${headers}, verify=True) requests + [Return] ${resp} + DeleteCall [Arguments] ${url} ${user} ${headers}= Create Dictionary X-DMAAP-DR-ON-BEHALF-OF=${user} diff --git a/tests/vfc/nfvo-catalog/jsons/ns_packages.json b/tests/vfc/nfvo-catalog/jsons/ns_packages.json new file mode 100644 index 00000000..20a78322 --- /dev/null +++ b/tests/vfc/nfvo-catalog/jsons/ns_packages.json @@ -0,0 +1,3 @@ +{ + "csarId": "2" +} diff --git a/tests/vfc/nfvo-catalog/jsons/vnf_packages.json b/tests/vfc/nfvo-catalog/jsons/vnf_packages.json new file mode 100644 index 00000000..a87d7d02 --- /dev/null +++ b/tests/vfc/nfvo-catalog/jsons/vnf_packages.json @@ -0,0 +1,7 @@ +{ + "csarId": "1", + "vimIds": [ + "1" + ], + "labVimId": "7" +}
\ No newline at end of file diff --git a/tests/vfc/nfvo-catalog/test.robot b/tests/vfc/nfvo-catalog/test.robot index 1390e9fb..7e6759fe 100644 --- a/tests/vfc/nfvo-catalog/test.robot +++ b/tests/vfc/nfvo-catalog/test.robot @@ -12,6 +12,17 @@ ${cataloghealthcheck_url} /api/catalog/v1/health_check ${vnfpkgmhealthcheck_url} /api/vnfpkgm/v1/health_check ${nsdhealthcheck_url} /api/nsd/v1/health_check ${parserhealthcheck_url} /api/parser/v1/health_check +${service_packages_url} /api/parser/v1/service_packages +${vnfpackages_url} /api/catalog/v1/vnfpackages +${nspackages_url} /api/catalog/v1/nspackages +${jobs_url} /api/catalog/v1/jobs + +#json files +${ns_packages_json} ${SCRIPTS}/../tests/vfc/nfvo-catalog/jsons/ns_packages.json +${vnfpackages_catalog_json} ${SCRIPTS}/../tests/vfc/nfvo-catalog/jsons/vnf_packages.json + +#global variables +${jobId} *** Test Cases *** Check Health Catalog @@ -34,6 +45,53 @@ Check Health Parser [Documentation] check health for Parser by MSB Check Health ${parserhealthcheck_url} +Check distribute catalog NS pacakages + Log Check distribute catalog NS pacakages + [Documentation] check distribute catalog NS pacakages + Check distribute package ${ns_packages_json} ${nspackages_url} + +Check query catalog all NS package + Log Query catalog all NS package + [Documentation] check query catalog all NS package + Check query all packages ${nspackages_url} + +Check query all Service package + Log Query all Service packages + [Documentation] check query Service packages by MSB + ${headers} Create Dictionary Content-Type=application/json Accept=application/json + Check query all packages ${service_packages_url} + +Check distribute VNF package + Log Check distribute VNF packagee + [Documentation] check distribute VNF package + ${json_value}= json_from_file ${vnfpackages_catalog_json} + ${json_string}= string_from_json ${json_value} + ${headers} Create Dictionary Content-Type=application/json Accept=application/json + Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers} + Set Request Body ${json_string} + ${resp}= Post Request web_session ${vnfpackages_url} ${json_string} + Should Be Equal As Strings 202 ${resp.status_code} + ${response_json} json.loads ${resp.content} + ${jobId}= Convert To String ${response_json['jobId']} + Set Global Variable ${jobId} + +Check query job status + Log Check query job status + [Documentation] check query job status + ${headers} Create Dictionary Content-Type=application/json Accept=application/json + Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers} + ${resp}= Get Request web_session ${jobs_url}/${jobId} + Should Be Equal As Strings 200 ${resp.status_code} + +Check query all VNF package + Log Query all VNF packages + [Documentation] check query VNF packages + ${headers} Create Dictionary Content-Type=application/json Accept=application/json + Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers} + ${resp}= Get Request web_session ${vnfpackages_url} + Should Be Equal As Strings 200 ${resp.status_code} + ${response_json} json.loads ${resp.content} + *** Keywords *** Check Health [Arguments] ${url} @@ -41,5 +99,22 @@ Check Health Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers} ${resp}= Get Request web_session ${url} Should Be Equal As Strings 200 ${resp.status_code} - ${response_json} json.loads ${resp.content} + ${response_json} json.loads ${resp.content} Should Be Equal As Strings active ${response_json['status']} + +Check distribute package + [Arguments] ${json_file} ${url} + ${json_value}= json_from_file ${json_file} + ${json_string}= string_from_json ${json_value} + ${headers} Create Dictionary Content-Type=application/json Accept=application/json + Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers} + Set Request Body ${json_string} + ${resp}= Post Request web_session ${url} ${json_string} + Should Be Equal As Strings 202 ${resp.status_code} + +Check query all packages + [Arguments] ${url} + ${headers} Create Dictionary Content-Type=application/json Accept=application/json + Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers} + ${resp}= Get Request web_session ${url} + Should Be Equal As Strings 200 ${resp.status_code}
\ No newline at end of file diff --git a/tests/vfc/nfvo-lcm/jsoninput/create_ns_instance.json b/tests/vfc/nfvo-lcm/jsoninput/create_ns_instance.json index bed82d90..38201435 100644 --- a/tests/vfc/nfvo-lcm/jsoninput/create_ns_instance.json +++ b/tests/vfc/nfvo-lcm/jsoninput/create_ns_instance.json @@ -1,5 +1,6 @@ { - "nsdId": "23", - "nsName": "ns23", - "nsDescription": "ns23 desc" + "nsdId": "c9f0a95e-dea0-4698-96e5-5a79bc5a233d", + "nsName": "ns", + "nsDescription": "description", + "test": "test" }
\ No newline at end of file diff --git a/tests/vfc/nfvo-lcm/jsoninput/create_pnf.json b/tests/vfc/nfvo-lcm/jsoninput/create_pnf.json deleted file mode 100644 index 282e0af2..00000000 --- a/tests/vfc/nfvo-lcm/jsoninput/create_pnf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "pnfId": "123", - "pnfName": "pnf1", - "pnfdId": "456", - "pnfdInfoId": "011234", - "pnfProfileId": "456788", - "cpInfo": "cp info" -}
\ No newline at end of file diff --git a/tests/vfc/nfvo-lcm/jsoninput/create_sfc.json b/tests/vfc/nfvo-lcm/jsoninput/create_sfc.json deleted file mode 100644 index e7fe0170..00000000 --- a/tests/vfc/nfvo-lcm/jsoninput/create_sfc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "fpindex": "123", - "nsInstanceId": "123", - "context": "create sfc", - "sdnControllerId": "123" -}
\ No newline at end of file diff --git a/tests/vfc/nfvo-lcm/jsoninput/create_subscription.json b/tests/vfc/nfvo-lcm/jsoninput/create_subscription.json index 553d38ce..a3368974 100644 --- a/tests/vfc/nfvo-lcm/jsoninput/create_subscription.json +++ b/tests/vfc/nfvo-lcm/jsoninput/create_subscription.json @@ -1,54 +1,19 @@ { - "callbackUri": "/api/nslcm/v1/subscriptions", - "filter": { - "nsInstanceSubscriptionFilter": { - "nsdIds": [ - "3fa85f64-5717-4562-b3fc-2c963f66afa6" - ], - "vnfdIds": [ - "3fa85f64-5717-4562-b3fc-2c963f66afa6" - ], - "pnfdIds": [ - "3fa85f64-5717-4562-b3fc-2c963f66afa6" - ], - "nsInstanceIds": [ - "3fa85f64-5717-4562-b3fc-2c963f66afa6" - ], - "nsInstanceNames": [ - "ns1" - ] + "callbackUri": "http://aurl.com", + "authentication": { + "authType": ["BASIC"], + "paramsBasic": { + "username": "username", + "password": "password" + } }, - "notificationTypes": [ - "NsLcmOperationOccurrenceNotification" - ], - "operationTypes": [ - "INSTANTIATE" - ], - "operationStates": [ - "STARTING" - ], - "nsComponentTypes": [ - "VNF" - ], - "lcmOpNameImpactingNsComponent": [ - "VNF_INSTANTIATE" - ], - "lcmOpOccStatusImpactingNsComponent": [ - "START" - ] - }, - "authentication": { - "authType": [ - "BASIC" - ], - "paramsBasic": { - "userName": "test", - "password": "test" - }, - "paramsOauth2ClientCredentials": { - "clientId": "123", - "clientPassword": "test", - "tokenEndpoint": "test" + "filter": { + "notificationTypes": ["NsLcmOperationOccurrenceNotification"], + "operationTypes": [ + "INSTANTIATE" + ], + "operationStates": [ + "STARTING" + ] } - } }
\ No newline at end of file diff --git a/tests/vfc/nfvo-lcm/jsoninput/heal_ns_instance.json b/tests/vfc/nfvo-lcm/jsoninput/heal_ns_instance.json deleted file mode 100644 index d15d7373..00000000 --- a/tests/vfc/nfvo-lcm/jsoninput/heal_ns_instance.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "healVnfData": [ - { - "vnfInstanceId": "vnf123", - "cause": "string", - "additionalParams": { - "additionalProp1": { - "action": "action1", - "actionvminfo": { - "vmid": "vm123", - "vduid": "vdu123", - "vmname": "vmname1" - } - }, - "additionalProp2": { - "action": "action2", - "actionvminfo": { - "vmid": "vm456", - "vduid": "vdu456", - "vmname": "vmname456" - } - }, - "additionalProp3": { - "action": "action3", - "actionvminfo": { - "vmid": "vm789", - "vduid": "vdu789", - "vmname": "vmname789" - } - } - } - } - ], - "healNsData": { - "degreeHealing": "HEAL_RESTORE", - "actionsHealing": [ - "action for healing" - ], - "healScript": "script2", - "additionalParamsforNs": "additional info" - } -}
\ No newline at end of file diff --git a/tests/vfc/nfvo-lcm/jsoninput/instantiate_ns.json b/tests/vfc/nfvo-lcm/jsoninput/instantiate_ns.json deleted file mode 100644 index 01ed3961..00000000 --- a/tests/vfc/nfvo-lcm/jsoninput/instantiate_ns.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "locationConstraints": [ - { - "vnfProfileId": "123", - "locationConstraints": { - "vimId": "vim123" - } - } - ], - "additionalParamForNs": { - "additionalProp1": "Prop1", - "additionalProp2": "Prop2", - "additionalProp3": "Prop3" - }, - "addpnfData": [ - { - "pnfId": "123", - "pnfName": "pdf123", - "pnfdId": "123", - "pnfProfileId": "123", - "cpData": [ - { - "cpInstanceId": "123", - "cpdId": "123", - "cpProtocolData": [ - { - "layerProtocol": "IP_OVER_ETHERNET", - "ipOverEthernet": { - "macAddress": "7C-76-35-4C-31-78", - "ipAddresses": [ - { - "type": "IPV4", - "fixedAddresses": [ - "192.168.43.10" - ], - "numDynamicAddresses": 0, - "addressRange": { - "minAddress": "192.168.253.0", - "maxAddress": "192.168.253.255" - }, - "subnetId": "255.255.255.0" - } - ] - } - } - ] - } - ] - } - ] -}
\ No newline at end of file diff --git a/tests/vfc/nfvo-lcm/jsoninput/instantiate_ns_instance.json b/tests/vfc/nfvo-lcm/jsoninput/instantiate_ns_instance.json deleted file mode 100644 index 75a19459..00000000 --- a/tests/vfc/nfvo-lcm/jsoninput/instantiate_ns_instance.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "nsFlavourId": "nsFlavour123", - "sapData": [ - { - "sapdId": "23", - "sapName": "sap123", - "description": "sap desc", - "sapProtocolData": [ - { - "layerProtocol": "IP_OVER_ETHERNET", - "ipOverEthernet": { - "macAddress": "7C-76-35-4C-31-78", - "ipAddresses": [ - { - "type": "IPV4", - "fixedAddresses": [ - "192.168.43.12" - ], - "numDynamicAddresses": 0, - "addressRange": { - "minAddress": "192.168.253.0", - "maxAddress": "192.168.253.255" - }, - "subnetId": "255.255.255.0" - } - ] - } - } - ] - } - ], - "addpnfData": [ - { - "pnfId": "pnf123", - "pnfName": "pnfName123", - "pnfdId": "pnfd123", - "pnfProfileId": "pnfPro123", - "cpData": [ - { - "cpInstanceI16": { - "IdentifierInPnf": {} - }, - "cpdId": { - "IdentifierInNsd": {} - }, - "cpProtocolData": [ - { - "layerProtocol": "IP_OVER_ETHERNET", - "ipOverEthernet": { - "macAddress": "7C-76-35-4C-31-78", - "ipAddresses": [ - { - "type": "IPV4", - "fixedAddresses": [ - "192.168.43.15" - ], - "numDynamicAddresses": 0, - "addressRange": { - "minAddress": "192.168.43.0", - "maxAddress": "192.168.43.255" - }, - "subnetId": "255.255.255.0" - } - ] - } - } - ] - } - ] - } - ], - "vnfInstanceData": [ - { - "vnfInstanceId": "vnf123", - "vnfProfileId": "vnfPro123" - } - ], - "nestedNsInstanceId": [ - "nested123" - ], - "localizationLanguage": [ - { - "vnfProfileId": "string", - "locationConstraints": { - "countryCode": "460", - "civicAddressElement": [ - { - "caType": "type1", - "caValue": "123" - } - ] - } - } - ], - "additionalParamForNs": { - "additionalProp1": "nsProp1", - "additionalProp2": "nsProp2", - "additionalProp3": "nsProp3" - }, - "additionalParamsForVnf": [ - { - "vnfProfileId": "vnfPro456", - "additionalParams": { - "additionalProp1": "vnfProp1", - "additionalProp2": "vnfProp2", - "additionalProp3": "vnfProp3" - } - } - ], - "startTime": "2019-10-08T01:45:26.226Z", - "nsInstantiationLevelId": "345678", - "additionalAffinityOrAntiAffiniityRule": [ - { - "vnfdId": [ - "123" - ], - "vnfProfileId": [ - "456" - ], - "vnfInstanceId": [ - "789" - ], - "affinityOrAntiAffiinty": "AFFINITY", - "scope": "NFVI_POP" - } - ] -}
\ No newline at end of file diff --git a/tests/vfc/nfvo-lcm/jsoninput/postdeal_ns.json b/tests/vfc/nfvo-lcm/jsoninput/postdeal_ns.json deleted file mode 100644 index c518885c..00000000 --- a/tests/vfc/nfvo-lcm/jsoninput/postdeal_ns.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "status": "ongoing" -}
\ No newline at end of file diff --git a/tests/vfc/nfvo-lcm/jsoninput/scale_ns.json b/tests/vfc/nfvo-lcm/jsoninput/scale_ns.json index e7f729d8..de0a95e8 100644 --- a/tests/vfc/nfvo-lcm/jsoninput/scale_ns.json +++ b/tests/vfc/nfvo-lcm/jsoninput/scale_ns.json @@ -1,14 +1,12 @@ { - "scaleType": "ns", - "scaleNsData": [ - { - "scaleNsByStepsData": [ + "scaleType": "SCALE_NS", + "scaleNsData": [ { - "aspectId": "123", - "numberOfSteps": "3", - "scalingDirection": "north" + "scaleNsByStepsData": [{ + "aspectId": "1", + "numberOfSteps": 1, + "scalingDirection": "0" + }] } - ] - } - ] + ] }
\ No newline at end of file diff --git a/tests/vfc/nfvo-lcm/jsoninput/scale_ns_instance.json b/tests/vfc/nfvo-lcm/jsoninput/scale_ns_instance.json deleted file mode 100644 index 73d27f6e..00000000 --- a/tests/vfc/nfvo-lcm/jsoninput/scale_ns_instance.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "scaleType": "ns_instance", - "scaleNsData": [ - { - "vnfInstanceToBeAdded": [ - { - "vnfInstanceId": "vnf456", - "vnfProfileId": "vnfPro456" - } - ], - "vnfInstanceToBeRemoved": [ - "" - ], - "scaleNsByStepsData": { - "scalingDirection": "SCALE_IN", - "aspectId": "123", - "numberOfSteps": "2" - }, - "scaleNsToLevelData": { - "nsInstantiationLevel": "1", - "nsScaleInfo": [ - { - "nsScalingAspectId": "2", - "nsScaleLevelId": "3" - } - ] - }, - "additionalParamsForNs": { - "additionalProp1": "nsProp11", - "additionalProp2": "nsProp12", - "additionalProp3": "nsProp13" - }, - "additionalParamsForVnf": [ - { - "vnfProfileId": "string", - "additionalParams": { - "additionalProp1": "vnfProp11", - "additionalProp2": "vnfProp12", - "additionalProp3": "vnfProp13" - } - } - ], - "locationConstraints": [ - { - "vnfProfileId": "vnfPro789", - "locationConstraints": { - "countryCode": "460", - "civicAddressElement": [ - { - "caType": "type2", - "caValue": "789" - } - ] - } - } - ] - } - ] -}
\ No newline at end of file diff --git a/tests/vfc/nfvo-lcm/jsoninput/terminate_ns_instance.json b/tests/vfc/nfvo-lcm/jsoninput/terminate_ns_instance.json index d03830a9..0cb384b5 100644 --- a/tests/vfc/nfvo-lcm/jsoninput/terminate_ns_instance.json +++ b/tests/vfc/nfvo-lcm/jsoninput/terminate_ns_instance.json @@ -1,3 +1,3 @@ { - "terminationTime": "1602668880" + "terminationTime": "2020-03-25T09:10:35.610" }
\ No newline at end of file diff --git a/tests/vfc/nfvo-lcm/jsoninput/terminate_vnf.json b/tests/vfc/nfvo-lcm/jsoninput/terminate_vnf.json index 9884b6ac..7cee8684 100644 --- a/tests/vfc/nfvo-lcm/jsoninput/terminate_vnf.json +++ b/tests/vfc/nfvo-lcm/jsoninput/terminate_vnf.json @@ -1,4 +1,4 @@ { - "terminationType": "vnf", - "gracefulTerminationTimeout": "3600" + "terminationType": "FORCEFUL", + "gracefulTerminationTimeout": "600" }
\ No newline at end of file diff --git a/tests/vfc/nfvo-lcm/jsoninput/update_job_ns.json b/tests/vfc/nfvo-lcm/jsoninput/update_job_ns.json deleted file mode 100644 index 3682bcfb..00000000 --- a/tests/vfc/nfvo-lcm/jsoninput/update_job_ns.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "progress": "updating", - "desc": "update job des", - "errcode": "405" -}
\ No newline at end of file diff --git a/tests/vfc/nfvo-lcm/jsoninput/update_ns.json b/tests/vfc/nfvo-lcm/jsoninput/update_ns.json index 2722b3a5..c71329f7 100644 --- a/tests/vfc/nfvo-lcm/jsoninput/update_ns.json +++ b/tests/vfc/nfvo-lcm/jsoninput/update_ns.json @@ -1,12 +1,9 @@ { - "updateType": "ADD_VNF", - "addVnfInstance": [ - { - "vnfInstanceId": "456", - "vnfProfileId": "456" - } - ], - "updateTime": { - "DateTime": {} - } -}
\ No newline at end of file + "updateType": "OPERATE_VNF", + "OperateVnfData": [{ + "vnfInstanceId": "test_vnf_001", + "changeStateTo": {"OperationalStates": "STOPPED"}, + "stopType": "GRACEFUL", + "gracefulStopTimeout": "2020-01-01" + }] +} diff --git a/tests/vfc/nfvo-lcm/jsoninput/update_ns_instance.json b/tests/vfc/nfvo-lcm/jsoninput/update_ns_instance.json index 2722b3a5..417958b5 100644 --- a/tests/vfc/nfvo-lcm/jsoninput/update_ns_instance.json +++ b/tests/vfc/nfvo-lcm/jsoninput/update_ns_instance.json @@ -1,12 +1,9 @@ { "updateType": "ADD_VNF", - "addVnfInstance": [ - { - "vnfInstanceId": "456", - "vnfProfileId": "456" - } - ], - "updateTime": { - "DateTime": {} - } + "OperateVnfData": [{ + "vnfInstanceId": "test_vnf_001", + "changeStateTo": {"OperationalStates": "STOPPED"}, + "stopType": "GRACEFUL", + "gracefulStopTimeout": "2020-01-01" + }] }
\ No newline at end of file diff --git a/tests/vfc/nfvo-lcm/test.robot b/tests/vfc/nfvo-lcm/test.robot index 452392f9..8ce0adb2 100644 --- a/tests/vfc/nfvo-lcm/test.robot +++ b/tests/vfc/nfvo-lcm/test.robot @@ -5,13 +5,12 @@ Library RequestsLibrary Library OperatingSystem Library json Library HttpLibrary.HTTP +Library ONAPLibrary.Utilities *** Variables *** @{return_ok_list}= 200 201 202 204 ${queryswagger_url} /api/nslcm/v1/swagger.json -${create_ns_url} /api/nslcm/v1/ns -${delete_ns_url} /api/nslcm/v1/ns -${get_ns_url} /api/nslcm/v1/ns +${ns_url} /api/nslcm/v1/ns ${get_subscriptions_url} /api/nslcm/v1/subscriptions ${healthcheck_url} /api/nslcm/v1/health_check ${get_job_url} /api/nslcm/v1/jobs @@ -26,34 +25,23 @@ ${ns_instances_url} /api/nslcm/v1/ns_instances #json files ${create_ns_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_ns.json ${heal_ns_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/heal_ns.json -${instantiate_ns_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/instantiate_ns.json -${postdeal_ns_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/postdeal_ns.json ${scale_ns_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/scale_ns.json ${update_ns_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/update_ns.json ${terminate_ns_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/terminate_ns.json -${update_job_ns_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/update_job_ns.json ${create_vnf_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_vnf.json ${terminate_vnf_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/terminate_vnf.json ${create_vl_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_vl.json -${create_sfcs_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_sfc.json ${create_subscriptions_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_subscription.json -${create_pnfs_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_pnf.json ${create_ns_instance_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_ns_instance.json -${heal_ns_instance_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/heal_ns_instance.json -${instantiate_ns_instance_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/instantiate_ns_instance.json -${postdeal_ns_instance_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/postdeal_ns_instance.json -${scale_ns_instance_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/scale_ns_instance.json -${update_ns_instance_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/update_ns_instance.json ${terminate_ns_instance_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/terminate_ns_instance.json +${update_ns_instance_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/update_ns_instance.json #global variables ${nsInstId} ${jobInstId} ${vnfInstId} ${vlInstId} -${sfcInstId} -${pnfId} ${nsInstanceId} *** Test Cases *** @@ -86,44 +74,13 @@ CreateNSTest ${headers} Create Dictionary Content-Type=application/json Accept=application/json Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} Set Request Body ${json_string} - ${resp}= Post Request web_session ${create_ns_url} ${json_string} + ${resp}= Post Request web_session ${ns_url} ${json_string} ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} ${response_json} json.loads ${resp.content} ${nsInstId}= Convert To String ${response_json['nsInstanceId']} Set Global Variable ${nsInstId} -CreateSfcTest - [Documentation] Create sfc function test - ${json_value}= json_from_file ${create_sfcs_json} - Set To Dictionary ${json_value} nsInstanceId=${nsInstId} - ${json_string}= string_from_json ${json_value} - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - Set Request Body ${json_string} - ${resp}= Post Request web_session ${sfcs_url} ${json_string} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - ${response_json} json.loads ${resp.content} - ${sfcInstId}= Convert To String ${response_json['sfcInstId']} - Set Global Variable ${sfcInstId} - -QuerySfcTest - [Documentation] Query sfc function test - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - ${resp}= Get Request web_session ${sfcs_url}/${sfcInstId} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - -DeleteSfcTest - [Documentation] Delete sfc function test - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - ${resp}= Delete Request web_session ${sfcs_url}/${sfcInstId} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - CreateVnfTest [Documentation] Create vnf function test ${json_value}= json_from_file ${create_vnf_json} @@ -154,14 +111,14 @@ TerminateVnfTest ${headers} Create Dictionary Content-Type=application/json Accept=application/json Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} Set Request Body ${json_string} - ${resp}= Post Request web_session ${terminate_vnfs_url} ${json_string} + ${resp}= Post Request web_session ${terminate_vnfs_url}/${vnfInstId} ${json_string} ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} CreateVlTest [Documentation] Create vl function test ${json_value}= json_from_file ${create_vl_json} - Set To Dictionary ${json_value} nsInstanceId=${nsInstId} + Set To Dictionary ${json_value} nsInstanceId=${nsInstId} ${json_string}= string_from_json ${json_value} ${headers} Create Dictionary Content-Type=application/json Accept=application/json Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} @@ -173,14 +130,6 @@ CreateVlTest ${vlInstId}= Convert To String ${response_json['vlId']} Set Global Variable ${vlInstId} -QueryVlTest - [Documentation] Query vl function test - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - ${resp}= Get Request web_session ${vls_url}/${vlInstId} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - DeleteVlTest [Documentation] Delete vl function test ${headers} Create Dictionary Content-Type=application/json Accept=application/json @@ -189,25 +138,6 @@ DeleteVlTest ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} -InstantiateNSTest - [Documentation] Instantiate Ns function test - ${json_value}= json_from_file ${instantiate_ns_json} - ${json_string}= string_from_json ${json_value} - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - Set Request Body ${json_string} - ${resp}= Post Request web_session ${create_ns_url}/${nsInstId}/instantiate ${json_string} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - -QueryNSTest - [Documentation] Query Ns function test - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - ${resp}= Get Request web_session ${get_ns_url}/${nsInstId} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - ScaleNSTest [Documentation] Scale Ns function test ${json_value}= json_from_file ${scale_ns_json} @@ -215,7 +145,7 @@ ScaleNSTest ${headers} Create Dictionary Content-Type=application/json Accept=application/json Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} Set Request Body ${json_string} - ${resp}= Post Request web_session ${create_ns_url}/${nsInstId}/scale ${json_string} + ${resp}= Post Request web_session ${ns_url}/${nsInstId}/scale ${json_string} ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} @@ -226,25 +156,13 @@ HealNSTest ${headers} Create Dictionary Content-Type=application/json Accept=application/json Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} Set Request Body ${json_string} - ${resp}= Post Request web_session ${create_ns_url}/${nsInstId}/heal ${json_string} + ${resp}= Post Request web_session ${ns_url}/${nsInstId}/heal ${json_string} ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} ${response_json} json.loads ${resp.content} ${jobInstId}= Convert To String ${response_json['jobId']} Set Global Variable ${jobInstId} -UpdateJobTest - [Documentation] Update Ns Job function test - ${json_value}= json_from_file ${update_job_ns_json} - ${json_string}= string_from_json ${json_value} - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - Set Request Body ${json_string} - ${resp}= Post Request web_session ${get_job_url}/${jobInstId} ${json_string} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - ${response_json} json.loads ${resp.content} - GetJobTest [Documentation] Query Ns Job function test ${headers} Create Dictionary Content-Type=application/json Accept=application/json @@ -253,26 +171,14 @@ GetJobTest ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} -PostdealNSTest - [Documentation] Postdeal Ns function test - ${json_value}= json_from_file ${postdeal_ns_json} - ${json_string}= string_from_json ${json_value} - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - Set Request Body ${json_string} - ${resp}= Post Request web_session ${create_ns_url}/${nsInstId}/postdeal ${json_string} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - UpdateNSTest [Documentation] Scale Ns function test ${json_value}= json_from_file ${update_ns_json} ${json_string}= string_from_json ${json_value} - Log ${json_string} ${headers} Create Dictionary Content-Type=application/json Accept=application/json Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} Set Request Body ${json_string} - ${resp}= Post Request web_session ${create_ns_url}/${nsInstId}/update ${json_string} + ${resp}= Post Request web_session ${ns_url}/${nsInstId}/update ${json_string} ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} @@ -283,7 +189,7 @@ TerminateNSTest ${headers} Create Dictionary Content-Type=application/json Accept=application/json Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} Set Request Body ${json_string} - ${resp}= Post Request web_session ${create_ns_url}/${nsInstId}/terminate ${json_string} + ${resp}= Post Request web_session ${ns_url}/${nsInstId}/terminate ${json_string} ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} @@ -291,7 +197,7 @@ DeleteNSTest [Documentation] Delete NS function test ${headers} Create Dictionary Content-Type=application/json Accept=application/json Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - ${resp}= Delete Request web_session ${delete_ns_url}/${nsInstId} + ${resp}= Delete Request web_session ${ns_url}/${nsInstId} ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} @@ -310,23 +216,9 @@ LcmGetNsTest [Documentation] get ns instances for nslcm by MSB ${headers} Create Dictionary Content-Type=application/json Accept=application/json Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - ${resp}= Get Request web_session ${get_ns_url} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - -CreatePnfsTest - [Documentation] Create pnf function test - ${json_value}= json_from_file ${create_pnfs_json} - ${json_string}= string_from_json ${json_value} - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - Set Request Body ${json_string} - ${resp}= Post Request web_session ${pnfs_url} ${json_string} + ${resp}= Get Request web_session ${ns_url} ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} - ${response_json} json.loads ${resp.content} - ${pnfId}= Convert To String ${response_json['pnfId']} - Set Global Variable ${pnfId} QueryAllPnfsTest [Documentation] Query all pnfs function test @@ -336,34 +228,18 @@ QueryAllPnfsTest ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} -QueryPnfsTest - [Documentation] Query pnf function test - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - ${resp}= Get Request web_session ${pnfs_url}/${pnfId} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - -DeletePnfTest - [Documentation] Delete pnf function test - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - ${resp}= Delete Request web_session ${pnfs_url}/${pnfId} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - CreateNSInstanceTest [Documentation] Create NS Instance function test ${json_value}= json_from_file ${create_ns_instance_json} ${json_string}= string_from_json ${json_value} - ${headers} Create Dictionary Content-Type=application/json Accept=application/json + ${headers} Create Dictionary Content-Type=application/json Accept=application/json globalcustomerid=global-customer-id-test1 servicetype=service-type-test1 Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} Set Request Body ${json_string} ${resp}= Post Request web_session ${ns_instances_url} ${json_string} ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} ${response_json} json.loads ${resp.content} - ${nsInstanceId}= Convert To String ${response_json['id']} + ${nsInstanceId}= Convert To String ${response_json['nsInstanceId']} Set Global Variable ${nsInstanceId} QueryNSInstancesTest @@ -374,47 +250,6 @@ QueryNSInstancesTest ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} -QueryNSIntanceTest - [Documentation] Query One Ns Instance function test - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - ${resp}= Get Request web_session ${ns_instances_url}/${nsInstanceId} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - -InstantiateNSInstanceTest - [Documentation] Instantiate Ns function test - ${json_value}= json_from_file ${instantiate_ns_instance_json} - ${json_string}= string_from_json ${json_value} - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - Set Request Body ${json_string} - ${resp}= Post Request web_session ${ns_instances_url}/${nsInstanceId}/instantiate ${json_string} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - -ScaleNSInstanceTest - [Documentation] Scale Ns Instance function test - ${json_value}= json_from_file ${scale_ns_instance_json} - ${json_string}= string_from_json ${json_value} - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - Set Request Body ${json_string} - ${resp}= Post Request web_session ${ns_instances_url}/${nsInstanceId}/scale ${json_string} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - -HealNSInstanceTest - [Documentation] Heal Ns Instance function test - ${json_value}= json_from_file ${heal_ns_instance_json} - ${json_string}= string_from_json ${json_value} - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - Set Request Body ${json_string} - ${resp}= Post Request web_session ${ns_instances_url}/${nsInstanceId}/heal ${json_string} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - UpdateNSInstanceTest [Documentation] Scale Ns Instance function test ${json_value}= json_from_file ${update_ns_instance_json} @@ -438,14 +273,6 @@ TerminateNSInstanceTest ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} -DeleteNSInstanceTest - [Documentation] Delete NS Instance function test - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} - ${resp}= Delete Request web_session ${ns_instances_url}/${nsInstanceId} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - LcmCreateSubscriptionsTest [Documentation] Postdeal Ns function test ${json_value}= json_from_file ${create_subscriptions_json} |