Merge "OPTFRA-487 change the api_paste.ini location"
authorGary Wu <gary.i.wu@huawei.com>
Mon, 29 Apr 2019 17:04:14 +0000 (17:04 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 29 Apr 2019 17:04:14 +0000 (17:04 +0000)
plans/vfc-nfvo-catalog/sanity-check/setup.sh
plans/vid/GUITests/setup.sh [deleted file]
plans/vid/GUITests/teardown.sh [deleted file]
plans/vid/GUITests/testplan.txt [deleted file]
plans/vid/healthCheck/testplan.txt
tests/vfc/nfvo-catalog/jsons/vnf_subscription.json [new file with mode: 0644]
tests/vfc/nfvo-catalog/test.robot
tests/vid/newVNFChange/test1.robot
tests/vid/resources/keywords/login_vid_keywords.robot

index e622173..344214f 100644 (file)
@@ -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 (file)
index f23fb61..0000000
+++ /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 (file)
index 0ade44f..0000000
+++ /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 (file)
index e54147c..0000000
+++ /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
index 61c3908..85fdaa3 100644 (file)
@@ -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 (file)
index 0000000..e48a92f
--- /dev/null
@@ -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"
+        }
+    }
+}
index b83bee4..af7b887 100644 (file)
@@ -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}
index 4737c3a..33d0ae3 100644 (file)
@@ -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
index b543029..15c3f05 100644 (file)
@@ -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