aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit
diff options
context:
space:
mode:
authorSeshu-Kumar-M <seshu.kumar.m@huawei.com>2017-09-08 00:28:29 +0530
committerSeshu-Kumar-M <seshu.kumar.m@huawei.com>2017-09-08 12:28:02 +0530
commitae730e4b5e753a88e73c81263a11264606d94156 (patch)
tree0c82352ae2eb9a2a2557deaa46f63aabfb9afe4d /test/csit
parentf8c2ff82f783f0becdae3d541954eb0d3f8f2339 (diff)
CSIT tests
IssueId: SO-112 Test cases to check SO_CSIT_sanity job Change-Id: I57e454ebd52998f07bf0d403e04fa7b4d55cd845 Signed-off-by: Seshu-Kumar-M <seshu.kumar.m@huawei.com>
Diffstat (limited to 'test/csit')
-rw-r--r--test/csit/plans/so/sanity-check/setup.sh29
-rw-r--r--test/csit/plans/so/sanity-check/teardown.sh6
-rw-r--r--test/csit/tests/so/sanity-check/data/createService.json29
-rw-r--r--test/csit/tests/so/sanity-check/data/createService_null_input.json0
-rw-r--r--test/csit/tests/so/sanity-check/data/createVnf.json35
-rw-r--r--test/csit/tests/so/sanity-check/data/deleteService.json13
-rw-r--r--test/csit/tests/so/sanity-check/data/deleteVnf.json20
-rw-r--r--test/csit/tests/so/sanity-check/sanity_test_so.robot80
8 files changed, 173 insertions, 39 deletions
diff --git a/test/csit/plans/so/sanity-check/setup.sh b/test/csit/plans/so/sanity-check/setup.sh
index a9c42fb4a..77a33bf65 100644
--- a/test/csit/plans/so/sanity-check/setup.sh
+++ b/test/csit/plans/so/sanity-check/setup.sh
@@ -17,21 +17,18 @@
# Place the scripts in run order:
# Start all process required for executing test case
-source ${SCRIPTS}/common_functions.sh
+#start so
+docker run -d -i -t --name=so -p 8080:8080 nexus3.onap.org:10001/openecomp/mso
-#Start gso
-run-instance.sh openoint/gso-service-manager gso " -i -t -e MSB_ADDR=${MSB_IP}:80 -e MYSQL_ADDR=${INV_ADDR}:3306"
-sleep_msg="Waiting_for_so"
-curl_path='http://'${MSB_IP}':80/api/so/v1/services'
-wait_curl_driver CURL_COMMAND=$curl_path WAIT_MESSAGE='"$sleep_msg"' REPEAT_NUMBER=25 GREP_STRING="\["
+SO_IP=`get-instance-ip.sh so`
+# Wait for initialization
+for i in {1..10}; do
+ curl -sS ${SO_IP}:1080 && break
+ echo sleep $i
+ sleep $i
+done
-#run simulator
-docker run -d -i -t --name gso_csit_simulator -e SIMULATOR_JSON=Stubs/testcase/so/main.json -p 18009:18009 -p 18008:18008 openoint/simulate-test-docker
-SIMULATOR_IP=`get-instance-ip.sh gso_csit_simulator`
-sleep_msg="Waiting_for_simulator"
-curl_path='http://'${SIMULATOR_IP}':18009/api/extsys/v1/vims'
-wait_curl_driver CURL_COMMAND=$curl_path WAIT_MESSAGE='"$sleep_msg"' REPEAT_NUMBER=16 GREP_STRING="\["
-
-
-ROBOT_VARIABLES="-v MSB_IP:${MSB_IP} -v SCRIPTS:${SCRIPTS} -v SIMULATOR_IP:${SIMULATOR_IP}"
-robot ${ROBOT_VARIABLES} ${SCRIPTS}/../tests/so/sanity-check/register_simulator_to_msb.robot
+#REPO_IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' so`
+REPO_IP='127.0.0.1'
+# Pass any variables required by Robot test suites in ROBOT_VARIABLES
+ROBOT_VARIABLES="-v REPO_IP:${REPO_IP}"
diff --git a/test/csit/plans/so/sanity-check/teardown.sh b/test/csit/plans/so/sanity-check/teardown.sh
index 5cd82b7e2..a924a074f 100644
--- a/test/csit/plans/so/sanity-check/teardown.sh
+++ b/test/csit/plans/so/sanity-check/teardown.sh
@@ -15,10 +15,4 @@
# limitations under the License.
#
-#copy the logs files
-docker cp so:/service/logs/lifecyclemgr.log ${SCRIPTS}/../../../archives
-# kill micro service
-kill-instance.sh i-msb
kill-instance.sh so
-
-
diff --git a/test/csit/tests/so/sanity-check/data/createService.json b/test/csit/tests/so/sanity-check/data/createService.json
new file mode 100644
index 000000000..3ff629ab5
--- /dev/null
+++ b/test/csit/tests/so/sanity-check/data/createService.json
@@ -0,0 +1,29 @@
+{
+"requestDetails": {
+"modelInfo": {
+"modelType": "",
+"modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
+"modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
+"modelName": "Test",
+"modelVersion": "1.0"
+},
+"subscriberInfo": {
+"globalSubscriberId": "{some subscriber id}",
+"subscriberName": "{some subscriber name}"
+},
+"requestInfo": {
+"instanceName": "MSO_TEST",
+"source": "VID",
+"suppressRollback": true
+},
+"requestParameters": {
+"subscriptionServiceType": "MOG",
+"userParams": [
+{
+"name": "someUserParam",
+"value": "someValue"
+}
+]
+}
+}
+} \ No newline at end of file
diff --git a/test/csit/tests/so/sanity-check/data/createService_null_input.json b/test/csit/tests/so/sanity-check/data/createService_null_input.json
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/test/csit/tests/so/sanity-check/data/createService_null_input.json
diff --git a/test/csit/tests/so/sanity-check/data/createVnf.json b/test/csit/tests/so/sanity-check/data/createVnf.json
new file mode 100644
index 000000000..7ea3d2475
--- /dev/null
+++ b/test/csit/tests/so/sanity-check/data/createVnf.json
@@ -0,0 +1,35 @@
+{
+ "requestDetails": {
+ "modelInfo": {
+ "modelType": "",
+ "modelInvariantId": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
+ "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
+ "modelName": "vSAMP12",
+ "modelVersion": "1.0",
+ "modelCustomizationName": "vSAMP12 1"
+ },
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "mdt1",
+ "tenantId": "88a6ca3ee0394ade9403f075db23167e"
+ },
+ "requestInfo": {
+ "instanceName": "MSOTEST103a",
+ "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
+ "source": "VID",
+ "suppressRollback": false
+ },
+ "relatedInstanceList": [{
+ "relatedInstance": {
+ "instanceId": " {serviceInstanceId} ",
+ "modelInfo": {
+ "modelType": "service",
+ "modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
+ "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
+ "modelName": " {parent service model name} ",
+ "modelVersion": "1.0"
+ }
+ }
+ }],
+ "requestParameters": {}
+ }
+}
diff --git a/test/csit/tests/so/sanity-check/data/deleteService.json b/test/csit/tests/so/sanity-check/data/deleteService.json
new file mode 100644
index 000000000..593fdd30f
--- /dev/null
+++ b/test/csit/tests/so/sanity-check/data/deleteService.json
@@ -0,0 +1,13 @@
+{
+"requestDetails": {
+"modelInfo": {
+"modelType": "",
+"modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
+"modelName": " Test ",
+"modelVersion": "1.0"
+},
+"requestInfo": {
+"source": "VID"
+}
+}
+}
diff --git a/test/csit/tests/so/sanity-check/data/deleteVnf.json b/test/csit/tests/so/sanity-check/data/deleteVnf.json
new file mode 100644
index 000000000..f326a12db
--- /dev/null
+++ b/test/csit/tests/so/sanity-check/data/deleteVnf.json
@@ -0,0 +1,20 @@
+{
+"requestDetails": {
+"modelInfo": {
+"modelType": "",
+"modelInvariantId": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
+"modelName": "vSAMP12",
+"modelVersion": "1"
+},
+"cloudConfiguration": {
+"lcpCloudRegionId": "mdt1",
+"tenantId": "88a6ca3ee0394ade9403f075db23167e"
+},
+"requestInfo": {
+"source": "VID"
+},
+"requestParameters": {
+"userParams": []
+}
+}
+}
diff --git a/test/csit/tests/so/sanity-check/sanity_test_so.robot b/test/csit/tests/so/sanity-check/sanity_test_so.robot
index e53b46c4c..9ebf1fd55 100644
--- a/test/csit/tests/so/sanity-check/sanity_test_so.robot
+++ b/test/csit/tests/so/sanity-check/sanity_test_so.robot
@@ -1,25 +1,71 @@
-*** settings ***
-Resource ../../common.robot
+*** Settings ***
Library Collections
Library RequestsLibrary
Library OperatingSystem
Library json
-Library HttpLibrary.HTTP
*** Variables ***
-@{return_ok_list}= 200 201 202
-${queryservice_url} /api/so/v1/services/5212b49f-fe70-414f-9519-88bec35b3190
-${service_id}
-${operation_id}
+${MESSAGE} Hello, world!
+
*** Test Cases ***
-soQueryServiceFuncTest
- [Documentation] query single service rest test
- ${headers} Create Dictionary Content-Type=application/json Accept=application/json
- Create Session web_session http://${MSB_IP} headers=${headers}
- ${resp}= Get Request web_session ${queryservice_url}
- ${responese_code}= Convert To String ${resp.status_code}
- List Should Contain Value ${return_ok_list} ${responese_code}
- ${response_json} json.loads ${resp.content}
- ${serviceName}= Convert To String ${response_json['serviceName']}
- Should Be Equal ${serviceName} test_so
+Create ServiceInstance for invalid input
+ Create Session refrepo http://${REPO_IP}:8080
+ ${data}= Get Binary File ${CURDIR}${/}data${/}createService.json
+ &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json
+ ${resp}= Post Request refrepo /ecomp/mso/infra/serviceInstances/v2 data=${data} headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 400
+
+Create ServiceInstance for invalid user
+ Create Session refrepo http://${REPO_IP}:8080
+ ${data}= Get Binary File ${CURDIR}${/}data${/}createService.json
+ &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQxOnBhc3N3b3JkMTI= Content-Type=application/json Accept=application/json
+ ${resp}= Post Request refrepo /ecomp/mso/infra/serviceInstances/v2 data=${data} headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 401
+
+Delete ServiceInstance for invalid input
+ Create Session refrepo http://${REPO_IP}:8080
+ ${data}= Get Binary File ${CURDIR}${/}data${/}deleteService.json
+ &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json
+ ${resp}= Delete Request refrepo /ecomp/mso/infra/serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000 data=${data} headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 400
+
+Delete ServiceInstance for invalid user
+ Create Session refrepo http://${REPO_IP}:8080
+ ${data}= Get Binary File ${CURDIR}${/}data${/}deleteService.json
+ &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQxOnBhc3N3b3JkMTI== Content-Type=application/json Accept=application/json
+ ${resp}= Delete Request refrepo /ecomp/mso/infra/serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000 data=${data} headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 401
+
+SO ServiceInstance health check
+ Create Session refrepo http://${REPO_IP}:8080
+ &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json
+ ${resp}= Get Request refrepo /ecomp/mso/infra/orchestrationRequests/v2/rq1234d1-5a33-55df-13ab-12abad84e333 headers=${headers}
+ Should Not Contain ${resp.content} null
+
+Create VnfInstance for invalid input
+ Create Session refrepo http://${REPO_IP}:8080
+ ${data}= Get Binary File ${CURDIR}${/}data${/}createVnf.json
+ &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json
+ ${resp}= Post Request refrepo /ecomp/mso/infra/serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs data=${data} headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 400
+
+Create VnfInstance for invalid credential
+ Create Session refrepo http://${REPO_IP}:8080
+ ${data}= Get Binary File ${CURDIR}${/}data${/}createVnf.json
+ &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQxOnBhc3N3b3JkMTI= Content-Type=application/json Accept=application/json
+ ${resp}= Post Request refrepo /ecomp/mso/infra/serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs data=${data} headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 401
+
+Delete VnfInstance for invalid input
+ Create Session refrepo http://${REPO_IP}:8080
+ ${data}= Get Binary File ${CURDIR}${/}data${/}deleteVnf.json
+ &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json
+ ${resp}= Delete Request refrepo /ecomp/mso/infra/serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/aca51b0a-710d-4155-bc7c-7cef19d9a94e data=${data} headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 400
+
+Get Orchestration Requests
+ Create Session refrepo http://${REPO_IP}:8080
+ &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json
+ ${resp}= Get Request refrepo /ecomp/mso/infra/orchestrationRequests/v2 headers=${headers}
+ Should Not Contain ${resp.content} null \ No newline at end of file