aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plans/vfc-nfvo-catalog/sanity-check/setup.sh7
-rw-r--r--plans/vid/GUITests/setup.sh41
-rw-r--r--plans/vid/GUITests/teardown.sh17
-rw-r--r--plans/vid/GUITests/testplan.txt4
-rw-r--r--plans/vid/healthCheck/testplan.txt3
-rw-r--r--tests/vfc/nfvo-catalog/jsons/vnf_subscription.json41
-rw-r--r--tests/vfc/nfvo-catalog/test.robot41
-rw-r--r--tests/vid/newVNFChange/test1.robot2
-rw-r--r--tests/vid/resources/keywords/login_vid_keywords.robot2
9 files changed, 87 insertions, 71 deletions
diff --git a/plans/vfc-nfvo-catalog/sanity-check/setup.sh b/plans/vfc-nfvo-catalog/sanity-check/setup.sh
index e6221731..344214ff 100644
--- a/plans/vfc-nfvo-catalog/sanity-check/setup.sh
+++ b/plans/vfc-nfvo-catalog/sanity-check/setup.sh
@@ -64,8 +64,13 @@ for i in {1..10}; do
sleep $i
done
+# print catalog config
+docker cp vfc-catalog:/service/vfc/nfvo/catalog/catalog/pub/config/config.py ./
+cat config.py
+
+# print catalog log
docker cp vfc-catalog:/service/vfc/nfvo/catalog/logs/runtime_catalog.log ./
cat runtime_catalog.log
# Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v MSB_IP:${MSB_IP} -v CATALOG_IP:${CATALOG_IP} -v MSB_DISCOVERY_IP:${DISCOVERY_IP}"
+ROBOT_VARIABLES="-v MSB_IP:${MSB_IP} -v CATALOG_IP:${CATALOG_IP} -v MSB_DISCOVERY_IP:${DISCOVERY_IP} -v SCRIPTS:${SCRIPTS}"
diff --git a/plans/vid/GUITests/setup.sh b/plans/vid/GUITests/setup.sh
deleted file mode 100644
index f23fb61f..00000000
--- a/plans/vid/GUITests/setup.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2019 Nokia Intellectual Property. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Place the scripts in run order:
-
-/usr/bin/Xvfb :0 -screen 0 1024x768x24&
-export DISPLAY=:0
-
-source ${SCRIPTS}/common_functions.sh
-source ${WORKSPACE}/scripts/vid/clone_and_setup_vid_data.sh
-source ${WORKSPACE}/scripts/vid/start_vid_containers.sh
-
-echo "Obtaining ip of VID server..."
-VID_IP=`get-instance-ip.sh vid-server`
-SO_SIMULATOR_IP=`get-instance-ip.sh so-simulator`
-
-bypass_ip_address ${VID_IP}
-bypass_ip_address ${SO_SIMULATOR_IP}
-
-echo VID_IP=${VID_IP}
-echo SO_SIMULATOR_IP=${SO_SIMULATOR_IP}
-
-
-# Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v VID_IP:${VID_IP} -v SO_SIMULATOR_IP:${SO_SIMULATOR_IP}"
-
-pip install assertpy
-pip install requests \ No newline at end of file
diff --git a/plans/vid/GUITests/teardown.sh b/plans/vid/GUITests/teardown.sh
deleted file mode 100644
index 0ade44f9..00000000
--- a/plans/vid/GUITests/teardown.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2019 Nokia Intellectual Property. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-source ${WORKSPACE}/scripts/vid/kill_containers_and_remove_dataFolders.sh \ No newline at end of file
diff --git a/plans/vid/GUITests/testplan.txt b/plans/vid/GUITests/testplan.txt
deleted file mode 100644
index e54147c6..00000000
--- a/plans/vid/GUITests/testplan.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-# Test suites are relative paths under [integration/csit.git]/tests/.
-# Place the suites in run order.
-
-vid/newVNFChange \ No newline at end of file
diff --git a/plans/vid/healthCheck/testplan.txt b/plans/vid/healthCheck/testplan.txt
index 61c39083..85fdaa34 100644
--- a/plans/vid/healthCheck/testplan.txt
+++ b/plans/vid/healthCheck/testplan.txt
@@ -3,4 +3,5 @@
vid/healthCheck
vid/login
vid/https-connection
-vid/scaleOut \ No newline at end of file
+vid/scaleOut
+vid/newVNFChange \ No newline at end of file
diff --git a/tests/vfc/nfvo-catalog/jsons/vnf_subscription.json b/tests/vfc/nfvo-catalog/jsons/vnf_subscription.json
new file mode 100644
index 00000000..e48a92f4
--- /dev/null
+++ b/tests/vfc/nfvo-catalog/jsons/vnf_subscription.json
@@ -0,0 +1,41 @@
+{
+ "filters": {
+ "notificationTypes": [
+ "VnfPackageOnboardingNotification"
+ ],
+ "vnfProductsFromProviders": {
+ "vnfProvider": "string",
+ "vnfProducts": {
+ "vnfProductName": "string",
+ "versions": {
+ "vnfSoftwareVersion": "string",
+ "vnfdVersions": [
+ "string"
+ ]
+ }
+ }
+ },
+ "vnfdId": [
+ "3fa85f64-5717-4562-b3fc-2c963f66afa6"
+ ],
+ "vnfPkgId": [
+ "3fa85f64-5717-4562-b3fc-2c963f66afa6"
+ ],
+ "operationalState": [
+ "ENABLED"
+ ],
+ "usageState": [
+ "IN_USE"
+ ]
+ },
+ "callbackUri": "http://127.0.0.1:8806/api/catalog/v1/callback_sample",
+ "authentication": {
+ "authType": [
+ "BASIC"
+ ],
+ "paramsBasic": {
+ "userName": "string",
+ "password": "string"
+ }
+ }
+}
diff --git a/tests/vfc/nfvo-catalog/test.robot b/tests/vfc/nfvo-catalog/test.robot
index b83bee47..af7b8874 100644
--- a/tests/vfc/nfvo-catalog/test.robot
+++ b/tests/vfc/nfvo-catalog/test.robot
@@ -1,20 +1,31 @@
*** settings ***
+Resource ../../common.robot
Library Collections
Library RequestsLibrary
Library OperatingSystem
Library json
+Library HttpLibrary.HTTP
*** Variables ***
-@{return_ok_list}= 200 201 202
+@{return_ok_list}= 200 201 202 204
+${catalog_port} 8806
${queryswagger_url} /api/catalog/v1/swagger.json
${queryVNFPackage_url} /api/catalog/v1/vnfpackages
${queryNSPackages_url} /api/catalog/v1/nspackages
${healthcheck_url} /api/catalog/v1/health_check
+${create_subs_url} /api/vnfpkgm/v1/subscriptions
+${delete_subs_url} /api/vnfpkgm/v1/subscriptions
+
+#json files
+${vnf_subscription_json} ${SCRIPTS}/../tests/vfc/nfvo-catalog/jsons/vnf_subscription.json
+
+#global variables
+${subscriptionId}
*** Test Cases ***
GetVNFPackages
${headers} Create Dictionary Content-Type=application/json Accept=application/json
- Create Session web_session http://${CATALOG_IP}:8806 headers=${headers}
+ Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers}
${resp}= Get Request web_session ${queryVNFPackage_url}
${responese_code}= Convert To String ${resp.status_code}
List Should Contain Value ${return_ok_list} ${responese_code}
@@ -22,10 +33,34 @@ GetVNFPackages
CatalogHealthCheckTest
[Documentation] check health for catalog by MSB
${headers} Create Dictionary Content-Type=application/json Accept=application/json
- Create Session web_session http://${CATALOG_IP}:8806 headers=${headers}
+ Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers}
${resp}= Get Request web_session ${healthcheck_url}
${responese_code}= Convert To String ${resp.status_code}
List Should Contain Value ${return_ok_list} ${responese_code}
${response_json} json.loads ${resp.content}
${health_status}= Convert To String ${response_json['status']}
Should Be Equal ${health_status} active
+
+CreateVnfSubscriptionTest
+ [Documentation] Create Vnf Subscription function test
+ ${json_value}= json_from_file ${vnf_subscription_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 ${create_subs_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}
+ ${callback_uri}= Convert To String ${response_json['callbackUri']}
+ Should Be Equal ${callback_uri} http://127.0.0.1:${catalog_port}/api/catalog/v1/callback_sample
+ ${subscriptionId}= Convert To String ${response_json['id']}
+ Set Global Variable ${subscriptionId}
+
+DeleteVnfSubscriptionTest
+ [Documentation] Delete Vnf Subscription function test
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json
+ Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers}
+ ${resp}= Delete Request web_session ${delete_subs_url}/${subscriptionId}
+ ${responese_code}= Convert To String ${resp.status_code}
+ List Should Contain Value ${return_ok_list} ${responese_code}
diff --git a/tests/vid/newVNFChange/test1.robot b/tests/vid/newVNFChange/test1.robot
index 4737c3af..33d0ae3a 100644
--- a/tests/vid/newVNFChange/test1.robot
+++ b/tests/vid/newVNFChange/test1.robot
@@ -53,8 +53,6 @@ add new VNF Change in VID GUI From Local worfkow
Click Element xpath=//a[contains(text(),'vnf-ws')]
Select From List xpath=//select[@name='workflow'] VNF In Place Software Update
- #temp solution
- #Click Button xpath=//button[@id='cancel']
Wait Until Page Contains Operations timeout ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
Input Text xpath=//input[@id='internal-workflow-parameter-text-2'] 10
diff --git a/tests/vid/resources/keywords/login_vid_keywords.robot b/tests/vid/resources/keywords/login_vid_keywords.robot
index b543029a..15c3f056 100644
--- a/tests/vid/resources/keywords/login_vid_keywords.robot
+++ b/tests/vid/resources/keywords/login_vid_keywords.robot
@@ -37,8 +37,6 @@ Setup Browser Firefox
Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${dc}
Setup Browser Chrome
- #${os}= Get Normalized Os
- #Log Normalized OS=${os}
${chrome options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys
Call Method ${chrome options} add_argument no-sandbox
${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.CHROME sys, selenium.webdriver