add README and corrections 50/76350/1
authorRene Robert <rene.robert@orange.com>
Fri, 25 Jan 2019 14:36:40 +0000 (15:36 +0100)
committerRene Robert <rene.robert@orange.com>
Fri, 25 Jan 2019 14:38:23 +0000 (15:38 +0100)
Issue-ID: INT-825

Change-Id: Iac316a6a17aff5acfc9061634232351c4ef305e2
Signed-off-by: Rene Robert <rene.robert@orange.com>
test/postman/05_Onboard_VF.postman_collection.json
test/postman/10_Service_Order.postman_collection.json [moved from test/postman/10_Service Order.postman_collection.json with 99% similarity]
test/postman/README.md [new file with mode: 0644]
test/postman/globals.postman_globals.json
test/postman/images/collection-detail-test.png [new file with mode: 0755]
test/postman/images/collection-detail.png [new file with mode: 0755]
test/postman/images/collections.png [new file with mode: 0755]
test/postman/images/globals.png [new file with mode: 0755]
test/postman/images/import.png [new file with mode: 0755]
test/postman/images/run.png [new file with mode: 0755]
test/postman/images/zipfile.png [new file with mode: 0755]

index 9b49aa4..19a83a0 100644 (file)
                                        "script": {
                                                "type": "text/javascript",
                                                "exec": [
-                                                       "tests[\"Status code is 200\"] = responseCode.code === 200;",
-                                                       "",
-                                                       "var jsonData = JSON.parse(responseBody);",
                                                        "var vf_found = false;",
-                                                       "for (var i = 0; i < jsonData.length; i++) { ",
-                                                       "   if (jsonData[i][\"name\"] === postman.getGlobalVariable(\"vf_name\")) {",
-                                                       "       vf_found = true;",
-                                                       "       postman.setGlobalVariable(\"auto_vf_uuid\", \"\"+jsonData[i][\"uuid\"]+\"\");",
-                                                       "       postman.setGlobalVariable(\"auto_vf_invariant_uuid\", \"\"+jsonData[i][\"invariantUUID\"]+\"\");",
-                                                       "   }",
+                                                       "if (responseCode.code === 404) {",
+                                                       "    tests[postman.getGlobalVariable(\"vf_name\")+\" does not exists\"] = true;",
                                                        "}",
-                                                       "if (vf_found === false) {",
-                                                       "    tests[postman.getGlobalVariable(\"vf_name\")+\" does not exists, we continue the run\"] = true;",
-                                                       "}",
-                                                       "",
                                                        "else {",
-                                                       "    tests[postman.getGlobalVariable(\"vf_name\")+\" already exists, stop the run\"] = true;",
-                                                       "    postman.setNextRequest(null);",
+                                                       "    if (responseCode.code === 200) {",
+                                                       "        tests[\"Status code is 200\"] = responseCode.code === 200;",
+                                                       "        }",
+                                                       "    var jsonData = JSON.parse(responseBody);",
+                                                       "    for (var i = 0; i < jsonData.length; i++) { ",
+                                                       "       if (jsonData[i][\"name\"] === postman.getGlobalVariable(\"vf_name\")) {",
+                                                       "           vf_found = true;",
+                                                       "           postman.setGlobalVariable(\"auto_vf_uuid\", \"\"+jsonData[i][\"uuid\"]+\"\");",
+                                                       "           postman.setGlobalVariable(\"auto_vf_invariant_uuid\", \"\"+jsonData[i][\"invariantUUID\"]+\"\");",
+                                                       "       }",
+                                                       "    }",
+                                                       "    if (vf_found === false) {",
+                                                       "        tests[postman.getGlobalVariable(\"vf_name\")+\" does not exists, we continue the run\"] = true;",
+                                                       "    }",
+                                                       "    ",
+                                                       "    else {",
+                                                       "        tests[postman.getGlobalVariable(\"vf_name\")+\" already exists, stop the run\"] = true;",
+                                                       "        postman.setNextRequest(null);",
+                                                       "    }",
                                                        "}"
                                                ]
                                        }
@@ -1,7 +1,7 @@
 {
        "variables": [],
        "info": {
-               "name": "10_Service Order",
+               "name": "10_Service_Order",
                "_postman_id": "28bdf2bb-4886-b8e7-45e3-eac832efc757",
                "description": "",
                "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
diff --git a/test/postman/README.md b/test/postman/README.md
new file mode 100644 (file)
index 0000000..86a797b
--- /dev/null
@@ -0,0 +1,68 @@
+# Postman Collections
+
+## Description
+
+That repository contains 9 Postman collections and 2 environment files.
+
+They have been tested with Onap Casablanca (they are not compatible with
+  Beijing, and there is not guaranty about ONAP "master" as API definition
+  can change)
+
+You first need to import all those files into your Postman.
+![postman](./images/import.png)
+
+And you should see all the collections
+![postman](./images/collections.png)
+
+Each collection is made of several API operations
+![postman](./images/collection-detail.png)
+
+Running all those collections, in the order, from 1 to 8 will create a lot of
+objects in ONAP components :
+
+- SDC : vendor, VSP, zip file upload, VF from VSP, Service, add VF to Service
+- VID : OwningEntity, LineOfBusiness, Project, Platform
+- AAI : customer, subscription, cloud region, tenant
+- NBI : serviceOrder to add a service instance, serviceOrder to delete a service
+ instance
+
+The order is very important because a lot of API request will need the API
+ response from the previous operation.
+![postman](./images/collection-detail-test.png)
+
+It is possible to run the complete collection.
+![postman](./images/run.png)
+
+You need, a zip file that contains Heat files for a VNF.
+
+Collection 3 is about uploading that file into ONAP SDC.
+![postman](./images/zipfile.png)
+
+Before running those collections, once in Postman, you need to have a look
+at "globals" environment parameters.
+![postman](./images/globals.png)
+
+All variables that begin by "auto_" must not be change (they will be modified
+ using API response)
+All other variables must be adapted to your needs.
+In particular, you need to put your own values for cloud_region_id, tenant_name
+ and tenant_id to fit with the place where you will instantiate the VNF
+
+```yaml
+ service:freeradius
+ vf_name:integration_test_VF_freeradius
+ vsp_name:integration_test_VSP
+ vendor_name:onap_integration_vendor
+ owning_entity:integration_test_OE
+ platform:integration_test_platform
+ project:integration_test_project
+ lineofbusiness:integration_test_LOB
+ customer_name:generic
+ cloud_owner_name:OPNFV
+ cloud_region_id:RegionOne
+ tenant_name:openlab-vnfs
+ tenant_id:234a9a2dc4b643be9812915b214cdbbb
+ externalId:integration_test_BSS-001
+ service_instance_name:integration_test_freeradius_instance_001
+ listener_url:http://10.4.2.65:8080/externalapi/listener/v1/listener
+```
index d8040d6..91c3845 100644 (file)
@@ -1,5 +1,5 @@
 {
-  "id": "840dff41-02b1-d25c-166d-2d2e34f090de",
+  "id": "eefacaa7-254c-3fc7-f946-b7d87508e343",
   "name": "Postman Globals",
   "values": [
     {
@@ -59,7 +59,7 @@
     },
     {
       "key": "cloud_owner_name",
-      "value": "CloudOwner",
+      "value": "OPNFV",
       "description": "",
       "type": "text",
       "enabled": true
     }
   ],
   "_postman_variable_scope": "globals",
-  "_postman_exported_at": "2019-01-24T16:48:52.023Z",
+  "_postman_exported_at": "2019-01-25T07:54:33.611Z",
   "_postman_exported_using": "Postman/5.5.4"
 }
\ No newline at end of file
diff --git a/test/postman/images/collection-detail-test.png b/test/postman/images/collection-detail-test.png
new file mode 100755 (executable)
index 0000000..b64cd7f
Binary files /dev/null and b/test/postman/images/collection-detail-test.png differ
diff --git a/test/postman/images/collection-detail.png b/test/postman/images/collection-detail.png
new file mode 100755 (executable)
index 0000000..59b7db2
Binary files /dev/null and b/test/postman/images/collection-detail.png differ
diff --git a/test/postman/images/collections.png b/test/postman/images/collections.png
new file mode 100755 (executable)
index 0000000..4469cdb
Binary files /dev/null and b/test/postman/images/collections.png differ
diff --git a/test/postman/images/globals.png b/test/postman/images/globals.png
new file mode 100755 (executable)
index 0000000..f3ae239
Binary files /dev/null and b/test/postman/images/globals.png differ
diff --git a/test/postman/images/import.png b/test/postman/images/import.png
new file mode 100755 (executable)
index 0000000..122c867
Binary files /dev/null and b/test/postman/images/import.png differ
diff --git a/test/postman/images/run.png b/test/postman/images/run.png
new file mode 100755 (executable)
index 0000000..35c4d5b
Binary files /dev/null and b/test/postman/images/run.png differ
diff --git a/test/postman/images/zipfile.png b/test/postman/images/zipfile.png
new file mode 100755 (executable)
index 0000000..a7cfa89
Binary files /dev/null and b/test/postman/images/zipfile.png differ