Add orchestration project to SO integration testing repository 97/94597/2
authorMnushkin, Dmitry (dm4252) <dm4252@att.com>
Fri, 6 Sep 2019 20:03:01 +0000 (15:03 -0500)
committerMnushkin, Dmitry (dm4252) <dm4252@att.com>
Fri, 6 Sep 2019 20:03:01 +0000 (15:03 -0500)
Add orchestration project containing robot setup for testing
Create and Delete Service Instance that will utilize requests
directed to simulator (SIM) Container and AAI image
Issue-ID: SO-2264
Signed-off-by: Mnushkin, Dmitry (dm4252) <dm4252@att.com>;;;
Change-Id: Iac4ac97fcbe5e73712486547d4a5046387751e5b

30 files changed:
tests/so/orchestration/assets/templates/aai/add_customer_required_fields.template [new file with mode: 0644]
tests/so/orchestration/assets/templates/aai/service_model.template [new file with mode: 0644]
tests/so/orchestration/assets/templates/aai/service_subscription_required_fields.template [new file with mode: 0644]
tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Create/ServiceInstance.template [new file with mode: 0644]
tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Create/VfModule.template [new file with mode: 0644]
tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Create/VfModuleWithVolume.template [new file with mode: 0644]
tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Create/Vnf.json [new file with mode: 0644]
tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Create/VolumeGroup.template [new file with mode: 0644]
tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Delete/ServiceInstance.template [new file with mode: 0644]
tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Delete/VfModule.template [new file with mode: 0644]
tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Delete/Vnf.template [new file with mode: 0644]
tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Delete/VolumeGroup.template [new file with mode: 0644]
tests/so/orchestration/assets/templates/gr-api/CreateAAIInventory.json [new file with mode: 0644]
tests/so/orchestration/assets/templates/gr-api/PhysicalServerCreate.json [new file with mode: 0644]
tests/so/orchestration/assets/templates/setup_cloud_region.json [new file with mode: 0644]
tests/so/orchestration/assets/templates/setup_tenant.json [new file with mode: 0644]
tests/so/orchestration/data/bpmn-infra/aLaCarte/ServiceInstance.csv [new file with mode: 0644]
tests/so/orchestration/resources/SoKeywords.robot [new file with mode: 0644]
tests/so/orchestration/resources/SoVariables.robot [new file with mode: 0644]
tests/so/orchestration/resources/aai/aai_interface.robot [new file with mode: 0644]
tests/so/orchestration/resources/aai/service_instance.robot [new file with mode: 0644]
tests/so/orchestration/resources/bpmn-infra/aLaCarte/Create/ServiceInstance.robot [new file with mode: 0644]
tests/so/orchestration/resources/common/SoVariables.robot [new file with mode: 0644]
tests/so/orchestration/resources/common/Variables.robot [new file with mode: 0644]
tests/so/orchestration/resources/global_properties.robot [new file with mode: 0644]
tests/so/orchestration/resources/json_templater.robot [new file with mode: 0644]
tests/so/orchestration/resources/properties/cloudRegion.robot [new file with mode: 0644]
tests/so/orchestration/resources/properties/tenant.robot [new file with mode: 0644]
tests/so/orchestration/resources/so_interface.robot [new file with mode: 0644]
tests/so/orchestration/testsuites/bpmn-infra/aLaCarte/Create/ServiceInstantiationTest.robot [new file with mode: 0644]

diff --git a/tests/so/orchestration/assets/templates/aai/add_customer_required_fields.template b/tests/so/orchestration/assets/templates/aai/add_customer_required_fields.template
new file mode 100644 (file)
index 0000000..1e00810
--- /dev/null
@@ -0,0 +1,5 @@
+{
+   "global-customer-id": "${global_customer_id}",
+   "subscriber-name": "${subscriber_name}",
+   "subscriber-type": "${subscriber_type}"
+}
\ No newline at end of file
diff --git a/tests/so/orchestration/assets/templates/aai/service_model.template b/tests/so/orchestration/assets/templates/aai/service_model.template
new file mode 100644 (file)
index 0000000..bc31dec
--- /dev/null
@@ -0,0 +1,14 @@
+{
+    "model-invariant-id": "${modelInvariantId}",
+    "model-type": "${modelType}",
+    "model-vers": {
+        "model-ver": [
+            {
+                "model-version-id": "${modelVersionId}",
+                "model-name": "${modelName}",
+                "model-version": "${modelVersion}",
+                "model-description": "${modelDescription}"
+            }
+        ]
+    }
+}
\ No newline at end of file
diff --git a/tests/so/orchestration/assets/templates/aai/service_subscription_required_fields.template b/tests/so/orchestration/assets/templates/aai/service_subscription_required_fields.template
new file mode 100644 (file)
index 0000000..2950302
--- /dev/null
@@ -0,0 +1,3 @@
+{
+   "service-type": "${service_type}"
+}
\ No newline at end of file
diff --git a/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Create/ServiceInstance.template b/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Create/ServiceInstance.template
new file mode 100644 (file)
index 0000000..a573a77
--- /dev/null
@@ -0,0 +1,35 @@
+{
+  "requestDetails": {
+    "requestInfo": {
+      "productFamilyId": "${productFamilyId}",
+      "instanceName": "${instanceName}",
+      "source": "VID",
+      "suppressRollback": false,
+      "requestorId": "ROBOT"
+    },
+    "modelInfo": {
+      "modelType": "${serviceInstModelType}",
+      "modelInvariantId": "${serviceInstModelInvariantId}",
+      "modelVersionId": "${serviceInstModelNameVersionId}",
+      "modelName": "${serviceInstModelName}",
+      "modelVersion": "${serviceInstModelVersion}"
+    },
+    "project": {
+       "projectName": "${projectName}"
+       },
+    "owningEntity": {
+       "owningEntityId": "${owningEntityId}",
+       "owningEntityName": "${owningEntityName}"
+       },
+    "requestParameters": {
+     "testApi": "${testApi}",
+      "userParams": [],
+      "subscriptionServiceType": "${serviceType}",
+      "aLaCarte": ${aLaCarteFlag}
+    },
+    "subscriberInfo": {
+      "globalSubscriberId": "${subscriberId}",
+      "subscriberName": "${subscriberId}"
+    }
+  }
+}
\ No newline at end of file
diff --git a/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Create/VfModule.template b/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Create/VfModule.template
new file mode 100644 (file)
index 0000000..6a5f6d6
--- /dev/null
@@ -0,0 +1,56 @@
+{
+       "requestDetails": {
+               "requestInfo": {
+                       "instanceName": "${vfModuleName}",
+                       "source": "VID",
+                       "suppressRollback": false,
+                       "requestorId": "az2016"
+               },
+               "modelInfo": {
+                       "modelType": "${vfModelType}",
+                       "modelInvariantId": "${vfModelInvariantId}",
+                       "modelVersionId": "${vfModelversionId}",
+                       "modelName": "${vfModelName}",
+                       "modelVersion": "${vfModelVersion}",
+                       "modelCustomizationId": "${vfModelCustomizationId}"
+               },
+               "requestParameters": {
+                       "testApi": "${testApi}",
+                       "aLaCarte": "${alaCarte}",
+                       "userParams": []
+               },
+               "cloudConfiguration": {
+                       "lcpCloudRegionId": "${vfLcpCloudRegionId}",
+                       "tenantId": "${vfTenantId}",
+                       "cloudOwner": "${cloudOwner}"
+               },
+               "relatedInstanceList": [
+                       {
+                               "relatedInstance": {
+                                       "instanceId": "${serviceInstanceId}",
+                                       "modelInfo": {
+                                               "modelType": "${serviceInstModelType}",
+                                               "modelInvariantId": "${serviceInstModelInvariantId}",
+                                               "modelVersionId": "${serviceInstModelNameVersionId}",
+                                               "modelName": "${serviceInstModelName}",
+                                               "modelVersion": "${serviceInstModelVersion}"
+                                       }
+                               }
+                       },
+                       {
+                               "relatedInstance": {
+                                       "instanceId": "${vnfId}",
+                                       "modelInfo": {
+                                               "modelType": "${vnfModelType}",
+                                               "modelName": "${vnfModelName}",
+                                               "modelInvariantId": "${vnfModelInvariantId}",
+                                               "modelVersion": "${vnfModelVersion}",
+                                               "modelVersionId": "${vnfModelversionId}",
+                                               "modelCustomizationName": "${vnfModelCustomizationName}",
+                                               "modelCustomizationId": "${vnfModelcustomizationId}"
+                                       }
+                               }
+                       }
+               ]
+       }
+}
\ No newline at end of file
diff --git a/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Create/VfModuleWithVolume.template b/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Create/VfModuleWithVolume.template
new file mode 100644 (file)
index 0000000..424d526
--- /dev/null
@@ -0,0 +1,69 @@
+{
+       "requestDetails": {
+               "requestInfo": {
+                       "instanceName": "${vfModuleName}",
+                       "source": "VID",
+                       "suppressRollback": false,
+                       "requestorId": "az2016"
+               },
+               "modelInfo": {
+                       "modelType": "${vfModelType}",
+                       "modelInvariantId": "${vfModelInvariantId}",
+                       "modelVersionId": "${vfModelversionId}",
+                       "modelName": "${vfModelName}",
+                       "modelVersion": "${vfModelVersion}",
+                       "modelCustomizationId": "${vfModelCustomizationId}"
+               },
+               "requestParameters": {
+                       "testApi": "${testApi}",
+                       "aLaCarte": "${alaCarte}",
+                       "userParams": []
+               },
+               "cloudConfiguration": {
+                       "lcpCloudRegionId": "${vfLcpCloudRegionId}",
+                       "cloudOwner": "${cloudOwner}",
+                       "tenantId": "${vfTenantId}"
+               },
+               "relatedInstanceList": [
+                       {
+                               "relatedInstance": {
+                                       "instanceId": "${serviceInstanceId}",
+                                       "modelInfo": {
+                                               "modelType": "${serviceInstModelType}",
+                                               "modelInvariantId": "${serviceInstModelInvariantId}",
+                                               "modelVersionId": "${serviceInstModelNameVersionId}",
+                                               "modelName": "${serviceInstModelName}",
+                                               "modelVersion": "${serviceInstModelVersion}"
+                                       }
+                               }
+                       },
+                       {
+                               "relatedInstance": {
+                                       "instanceId": "${vnfId}",
+                                       "modelInfo": {
+                                               "modelType": "${vnfModelType}",
+                                               "modelName": "${vnfModelName}",
+                                               "modelInvariantId": "${vnfModelInvariantId}",
+                                               "modelVersion": "${vnfModelVersion}",
+                                               "modelVersionId": "${vnfModelversionId}",
+                                               "modelCustomizationName": "${vnfModelCustomizationName}",
+                                               "modelCustomizationId": "${vnfModelcustomizationId}"
+                                       }
+                               }
+                       },
+                       {
+                               "relatedInstance": {
+                                       "instanceId": "${volumeGroupId}",
+                                       "modelInfo": {
+                                               "modelType": "${volumeGroupModelType}",
+                                               "modelName": "${volumeGroupModelName}",
+                                               "modelInvariantId": "${volumeGroupModelInvariantId}",
+                                               "modelVersion": "${volumeGroupModelVersion}",
+                                               "modelVersionId": "${volumeGroupModelversionId}",
+                                               "modelCustomizationId": "${volumeGroupModelCustomizationId}"
+                                       }
+                               }
+                       }
+               ]
+       }
+}
\ No newline at end of file
diff --git a/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Create/Vnf.json b/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Create/Vnf.json
new file mode 100644 (file)
index 0000000..7e11dbe
--- /dev/null
@@ -0,0 +1,49 @@
+{
+       "requestDetails": {
+               "requestInfo": {
+                       "instanceName": "${vnfInstanceName}",
+                       "source": "VID",
+                       "suppressRollback": false,
+                       "productFamilyId": "${productfamilyid}",
+                       "requestorId": "ROBOT"
+               },
+               "modelInfo": {
+                       "modelType": "${vnfModelType}",
+                       "modelInvariantId": "${vnfModelInvariantId}",
+                       "modelName": "${vnfModelName}",
+                       "modelVersionId": "${vnfModelversionId}",
+                       "modelVersion": "${vnfModelVersion}",
+                       "modelCustomizationName": "${vnfModelCustomizationName}",
+                       "modelCustomizationId": "${vnfModelcustomizationId}"
+               },
+               "requestParameters": {
+                       "testApi": "${testApi}",
+                       "userParams": []
+               },
+               "cloudConfiguration": {
+                       "lcpCloudRegionId": "${vnfLcpCloudRegionid}",
+                       "cloudOwner": "${cloudOwner}",
+                       "tenantId": "${vnfTenantId}"
+               },
+               "platform": {
+                       "platformName": "${platformName}"
+               },
+               "lineOfBusiness": {
+                       "lineOfBusinessName": "${lineOfBusinessName}"
+               },
+               "relatedInstanceList": [
+                       {
+                               "relatedInstance": {
+                                       "instanceId": "${serviceInstanceId}",
+                                       "modelInfo": {
+                                               "modelType": "${serviceInstModelType}",
+                                               "modelInvariantId": "${serviceInstModelInvariantId}",
+                                               "modelVersionId": "${serviceInstModelNameVersionId}",
+                                               "modelName": "${serviceInstModelName}",
+                                               "modelVersion": "${serviceInstModelVersion}"
+                                       }
+                               }
+                       }
+               ]
+       }
+}
\ No newline at end of file
diff --git a/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Create/VolumeGroup.template b/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Create/VolumeGroup.template
new file mode 100644 (file)
index 0000000..d117e28
--- /dev/null
@@ -0,0 +1,56 @@
+{
+       "requestDetails": {
+               "modelInfo": {
+                       "modelType": "${volumeGroupModelType}",
+                       "modelVersion": "${volumeGroupModelVersion}",
+                       "modelName": "${volumeGroupModelName}",
+                       "modelInvariantId": "${volumeGroupModelInvariantId}",
+                       "modelVersionId": "${volumeGroupModelVersionId}",
+                       "modelCustomizationId": "${volumeGroupModelCustomizationId}"
+               },
+               "requestInfo": {
+                       "instanceName": "${volumeGroupName}",
+                       "source": "VID",
+                       "suppressRollback": true,
+                       "requestorId": "sk720x"
+               },
+               "requestParameters": {
+                       "testApi": "${testApi}",
+                       "aLaCarte": "${alaCarte}",
+                       "userParams": []
+               },
+               "cloudConfiguration": {
+                       "lcpCloudRegionId": "${volumeGroupLcpCloudRegionId}",
+                       "cloudOwner": "${cloudOwner}",
+                       "tenantId": "${volumeGroupTenantId}"
+               },
+               "relatedInstanceList": [
+                       {
+                               "relatedInstance": {
+                                       "instanceId": "${serviceInstanceId}",
+                                       "modelInfo": {
+                                               "modelType": "${serviceInstModelType}",
+                                               "modelInvariantId": "${serviceInstModelInvariantId}",
+                                               "modelVersionId": "${serviceInstModelNameVersionId}",
+                                               "modelName": "${serviceInstModelName}",
+                                               "modelVersion": "${serviceInstModelVersion}"
+                                       }
+                               }
+                       },
+                       {
+                               "relatedInstance": {
+                                       "instanceId": "${vnfId}",
+                                       "modelInfo": {
+                                               "modelType": "${vnfModelType}",
+                                               "modelName": "${vnfModelName}",
+                                               "modelInvariantId": "${vnfModelInvariantId}",
+                                               "modelVersion": "${vnfModelVersion}",
+                                               "modelVersionId": "${vnfModelversionId}",
+                                               "modelCustomizationName": "${vnfModelCustomizationName}",
+                                               "modelCustomizationId": "${vnfModelcustomizationId}"
+                                       }
+                               }
+                       }
+               ]
+       }
+}
\ No newline at end of file
diff --git a/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Delete/ServiceInstance.template b/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Delete/ServiceInstance.template
new file mode 100644 (file)
index 0000000..531af17
--- /dev/null
@@ -0,0 +1,20 @@
+{
+       "requestDetails": {
+               "modelInfo": {
+                       "modelType": "service",
+                       "modelInvariantId": "${serviceInstModelInvariantId}",
+                       "modelVersionId": "${serviceInstModelNameVersionId}",
+                       "modelName": "${serviceInstModelName}",
+                       "modelVersion":"1.0"
+               },
+               "requestInfo": {
+                       "source": "VID",
+                       "requestorId": "ROBOT"
+               },
+               "requestParameters": {
+                       "testApi": "${testApi}",
+                       "userParams": [],
+                       "aLaCarte": "${aLaCarteFlag}"
+               }
+       }
+}
\ No newline at end of file
diff --git a/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Delete/VfModule.template b/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Delete/VfModule.template
new file mode 100644 (file)
index 0000000..ee227e0
--- /dev/null
@@ -0,0 +1,26 @@
+{
+       "requestDetails": {
+               "modelInfo": {
+                       "modelType": "${vfModelType}",
+                       "modelInvariantId": "${vfModelInvariantId}",
+                       "modelVersionId": "${vfModelversionId}",
+                       "modelName": "${vfModelName}",
+                       "modelVersion": "${vfModelVersion}",
+                       "modelCustomizationId": "${vfModelCustomizationId}"
+               },
+               "requestParameters": {
+                       "testApi": "${testApi}",
+                       "aLaCarte": "${alaCarte}",
+                       "userParams": []
+               },
+               "requestInfo": {
+                       "source": "VID",
+                       "requestorId": "az2016"
+               },
+               "cloudConfiguration": {
+                       "lcpCloudRegionId": "${vfLcpCloudRegionId}",
+                       "tenantId": "${vfTenantId}",
+                       "cloudOwner": "${cloudOwner}"
+               }
+       }
+}
\ No newline at end of file
diff --git a/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Delete/Vnf.template b/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Delete/Vnf.template
new file mode 100644 (file)
index 0000000..fc55395
--- /dev/null
@@ -0,0 +1,25 @@
+{
+   "requestDetails":{
+      "modelInfo":{
+         "modelType":"${vnfModelType}",
+         "modelInvariantId":"${vnfModelInvariantId}",
+         "modelNameVersionId":"${vnfModelversionId}",
+         "modelName":"${vnfModelName}",
+         "modelCustomizationName":"${vnfModelCustomizationName}",
+         "modelVersion":"${vnfModelVersion}"
+      },
+      "requestInfo":{
+         "source":"VID",
+         "requestorId":"ROBOT"
+      },
+      "cloudConfiguration":{
+         "lcpCloudRegionId":"${vnfLcpCloudRegionid}",
+         "tenantId":"${vnfTenantId}",
+                "cloudOwner": "${cloudOwner}"
+      },
+      "requestParameters": {
+         "testApi": "${testApi}",
+         "userParams": []
+      }
+   }
+}
\ No newline at end of file
diff --git a/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Delete/VolumeGroup.template b/tests/so/orchestration/assets/templates/bpmn-infra/aLaCarte/Delete/VolumeGroup.template
new file mode 100644 (file)
index 0000000..b5a495f
--- /dev/null
@@ -0,0 +1,26 @@
+{
+       "requestDetails": {
+               "modelInfo": {
+                       "modelType": "${volumeGroupModelType}",
+                       "modelInvariantId": "${volumeGroupModelInvariantId}",
+                       "modelVersionId": "${volumeGroupModelVersionId}",
+                       "modelName": "${volumeGroupModelName}",
+                       "modelVersion": "${volumeGroupModelVersion}",
+                       "modelCustomizationId": "${volumeGroupModelCustomizationId}"
+               },
+               "requestParameters": {
+                       "testApi": "${testApi}",
+                       "aLaCarte": "${alaCarte}",
+                       "userParams": []
+               },
+               "requestInfo": {
+                       "source": "VID",
+                       "requestorId": "sk720x"
+               },
+               "cloudConfiguration": {
+                       "lcpCloudRegionId": "${volumeGroupLcpCloudRegionId}",
+                       "tenantId": "${volumeGroupTenantId}",
+                       "cloudOwner": "${cloudOwner}"
+               }
+       }
+}
\ No newline at end of file
diff --git a/tests/so/orchestration/assets/templates/gr-api/CreateAAIInventory.json b/tests/so/orchestration/assets/templates/gr-api/CreateAAIInventory.json
new file mode 100644 (file)
index 0000000..5dd2323
--- /dev/null
@@ -0,0 +1,245 @@
+{
+    "vserver-id": "92272b67-d23f-42ca-87fa-7b06a9ec81f3",
+    "vserver-name": "tsbc0005vm002",
+    "vserver-name2": "tsbc0005vm002",
+    "vserver-selflink": "https://test.com:8774/v2/0422ffb57ba042c0800a29dc85ca70f8/servers/92272b67-d23f-42ca-87fa-7b06a9ec81f3",
+    "in-maint": false,
+    "is-closed-loop-disabled": false,    
+    "l-interfaces": {
+        "l-interface": [
+            {
+                "interface-name": "tsbc0005v_tsbc0005vm002_mgmt_port_1",
+                "selflink": "https://test.com:9696/v2.0/ports/07f5b14c-147a-4d14-8c94-a9e94dbc097b",
+                "interface-id": "07f5b14c-147a-4d14-8c94-a9e94dbc097b",
+                "macaddr": "02:07:f5:b1:4c:14",
+                "network-name": "GRP-27529-T-IST-05E-dyh3b_TIPFR_OAMP_NSD_TSBC0_net_1",
+                "is-port-mirrored": false,
+                "in-maint": false,
+                "is-ip-unnumbered": false,
+                "l3-interface-ipv4-address-list": [
+                    {
+                        "l3-interface-ipv4-address": "1.2.2.2",
+                        "l3-interface-ipv4-prefix-length": 28,
+                        "is-floating": false,
+                        "neutron-network-id": "cae2ade2-9f44-40fa-b124-18b101ff9aa0",
+                        "neutron-subnet-id": "1f954922-6e9c-4a64-9d78-62e869ba8c77"
+                    }
+                ],
+                "vlans" : {
+                                       "vlan": [
+                                               {
+                                                       "in-maint": false,
+                                                       "is-ip-unnumbered": false,
+                                                       "is-private": false,
+                                                       "vlan-id-inner": 0,
+                                                       "vlan-id-outer": 141,
+                                                       "vlan-interface": "oamfw_oam_direct1_0_port141"
+                                               }
+                                       ]
+                               }
+            },
+            {
+                "interface-name": "tsbc0005v_tsbc0005vm002_role1_port_0",
+                "selflink": "https://test.com:9696/v2.0/ports/0594a2f2-7ea4-42eb-abc2-48ea49677fca",
+                "interface-id": "0594a2f2-7ea4-42eb-abc2-48ea49677fca",
+                "macaddr": "02:05:94:a2:f2:7e",
+                "network-name": "GRP-27529-T-IST-05E-dyh3b_TIPFR-UNTR-ROLE1-PARNT_net_1",
+                "is-port-mirrored": false,
+                "in-maint": false,
+                "is-ip-unnumbered": false,
+                "l-interfaces": {
+                    "l-interface": [
+                        {
+                            "interface-name": "tsbc0005v_tsbc0005vm002_subint_untrusted_role1_81",
+                            "interface-id": "2bbfa345-33bb-495a-94b2-fb514ee1cffc",
+                            "macaddr": "02:05:94:a2:f2:7e",
+                            "network-name": "GRP-27529-T-IST-05E-dyh3b_TIPFR_UNTR_VSE_ROLE10_net_1",
+                            "is-port-mirrored": false,
+                            "in-maint": false,
+                            "is-ip-unnumbered": false
+                        }
+                    ]
+                },
+                "l3-interface-ipv4-address-list": [
+                    {
+                        "l3-interface-ipv4-address": "172.26.0.36",
+                        "l3-interface-ipv4-prefix-length": 27,
+                        "is-floating": false,
+                        "neutron-network-id": "49bd2c8c-808d-4783-a1c5-5d9ae0c6a9fa",
+                        "neutron-subnet-id": "8d073a94-b1b9-493a-8fc1-cf92abcba466"
+                    }
+                ],
+                "vlans" : {
+                                       "vlan": [
+                                               {
+                                                       "in-maint": false,
+                                                       "is-ip-unnumbered": false,
+                                                       "is-private": false,
+                                                       "vlan-id-inner": 0,
+                                                       "vlan-id-outer": 256,
+                                                       "vlan-interface": "oamfw_oam_direct1_0_port141"
+                                               }
+                                       ]
+                               }
+            },
+            {
+                "interface-name": "tsbc0005v_tsbc0005vm002_service1_port_0",
+                "selflink": "https://test.com:9696/v2.0/ports/27391d94-33af-474a-927d-d409249e8fd3",
+                "interface-id": "27391d94-33af-474a-927d-d409249e8fd3",
+                "macaddr": "02:27:39:1d:94:33",
+                "network-name": "GRP-27529-T-IST-05E-dyh3b_TIPFR-UNTR-CUS-PARNT_net_1",
+                "is-port-mirrored": false,
+                "in-maint": false,
+                "is-ip-unnumbered": false,
+                "l-interfaces": {
+                    "l-interface": [
+                        {
+                            "interface-name": "tsbc0005v_tsbc0005vm002_subint_untrusted_service1_101",
+                            "interface-id": "d54dfd09-75c6-4e04-b204-909455b8f933",
+                            "macaddr": "02:27:39:1d:94:33",
+                            "network-name": "GRP-27529-T-IST-05E_int_SUB-INTERFACE_net_006",
+                            "is-port-mirrored": false,
+                            "in-maint": false,
+                            "is-ip-unnumbered": false
+                        },
+                        {
+                            "interface-name": "tsbc0005v_tsbc0005vm002_subint_untrusted_service1_103",
+                            "interface-id": "f7a998c0-8939-4b07-bf4a-0862e9c325e1",
+                            "macaddr": "02:27:39:1d:94:33",
+                            "network-name": "GRP-27529-T-IST-05E_int_SUB-INTERFACE_net_008",
+                            "is-port-mirrored": false,
+                            "in-maint": false,
+                            "is-ip-unnumbered": false
+                        },
+                        {
+                            "interface-name": "tsbc0005v_tsbc0005vm002_subint_untrusted_service1_102",
+                            "interface-id": "621c1fea-60b8-44ee-aede-c01b8b1aaa70",
+                            "macaddr": "02:27:39:1d:94:33",
+                            "network-name": "GRP-27529-T-IST-05E_int_SUB-INTERFACE_net_007",
+                            "is-port-mirrored": false,
+                            "in-maint": false,
+                            "is-ip-unnumbered": false
+                        }
+                    ]
+                },
+                "l3-interface-ipv4-address-list": [
+                    {
+                        "l3-interface-ipv4-address": "172.26.0.5",
+                        "l3-interface-ipv4-prefix-length": 27,
+                        "is-floating": false,
+                        "neutron-network-id": "7acdc0c3-eff2-4ecb-8722-a3451711027c",
+                        "neutron-subnet-id": "4c4cc70a-7f31-41a6-a50f-5390d80fd127"
+                    }
+                ],
+                "vlans" : {
+                                       "vlan": [
+                                               {
+                                                       "in-maint": false,
+                                                       "is-ip-unnumbered": false,
+                                                       "is-private": false,
+                                                       "vlan-id-inner": 0,
+                                                       "vlan-id-outer": 574,
+                                                       "vlan-interface": "oamfw_oam_direct1_0_port141"
+                                               }
+                                       ]
+                               }
+            },
+            {
+                "interface-name": "tsbc0005v_tsbc0005vm002_int_ha_port_0",
+                "selflink": "https://test.com:9696/v2.0/ports/00bb8407-650e-48b5-b919-33b88d6f8fe3",
+                "interface-id": "00bb8407-650e-48b5-b919-33b88d6f8fe3",
+                "macaddr": "02:00:bb:84:07:65",
+                "network-name": "tsbc0005v_int_ha_net",
+                "is-port-mirrored": false,
+                "in-maint": false,
+                "is-ip-unnumbered": false,
+                "l3-interface-ipv4-address-list": [
+                    {
+                        "l3-interface-ipv4-address": "172.26.1.27",
+                        "l3-interface-ipv4-prefix-length": 26,
+                        "is-floating": false,
+                        "neutron-network-id": "de0a1ec5-8685-4de5-999c-a791bd48c9d8",
+                        "neutron-subnet-id": "1151932c-935d-4cdc-b134-f58bebed9bf1"
+                    }
+                ],
+                "vlans" : {
+                                       "vlan": [
+                                               {
+                                                       "in-maint": false,
+                                                       "is-ip-unnumbered": false,
+                                                       "is-private": false,
+                                                       
+                                                       "vlan-id-inner": 0,
+                                                       "vlan-id-outer": 654,
+                                                       "vlan-interface": "oamfw_oam_direct1_0_port141"
+                                               }
+                                       ]
+                               }
+            },
+            {
+                "interface-name": "tsbc0005v_tsbc0005vm002_mgmt_port_0",
+                "selflink": "https://test.com:9696/v2.0/ports/8d93f63e-e972-48c7-ad98-b2122da47315",
+                "interface-id": "8d93f63e-e972-48c7-ad98-b2122da47315",
+                "macaddr": "02:8d:93:f6:3e:e9",
+                "network-name": "GRP-27529-T-IST-05E-dyh3b_TIPFR_OAMP_NSD_TSBC0_net_1",
+                "is-port-mirrored": false,
+                "in-maint": false,
+                "is-ip-unnumbered": false,
+                "l3-interface-ipv4-address-list": [
+                    {
+                        "l3-interface-ipv4-address": "1.2.2.2",
+                        "l3-interface-ipv4-prefix-length": 28,
+                        "is-floating": false,
+                        "neutron-network-id": "cae2ade2-9f44-40fa-b124-18b101ff9aa0",
+                        "neutron-subnet-id": "1f954922-6e9c-4a64-9d78-62e869ba8c77"
+                    }
+                ],
+                "vlans" : {
+                                       "vlan": [
+                                               {
+                                                       "in-maint": false,
+                                                       "is-ip-unnumbered": false,
+                                                       "is-private": false,
+                                                       
+                                                       "vlan-id-inner": 0,
+                                                       "vlan-id-outer": 123,
+                                                       "vlan-interface": "oamfw_oam_direct1_0_port141"
+                                               }
+                                       ]
+                               }
+            },
+            {
+                "interface-name": "tsbc0005v_tsbc0005vm002_trusted_port",
+                "selflink": "https://test.com:9696/v2.0/ports/d2f51f82-0ec2-4581-bd1a-d2a82073e52b",
+                "interface-id": "d2f51f82-0ec2-4581-bd1a-d2a82073e52b",
+                "macaddr": "02:d2:f5:1f:82:0e",
+                "network-name": "GRP-27529-T-IST-05E-dyh3b_TIPFR_TRST_VIF_TSBC0_net_1",
+                "is-port-mirrored": false,
+                "in-maint": false,
+                "is-ip-unnumbered": false,
+                "l3-interface-ipv4-address-list": [
+                    {
+                        "l3-interface-ipv4-address": "1.2.2.2",
+                        "l3-interface-ipv4-prefix-length": 28,
+                        "is-floating": false,
+                        "neutron-network-id": "4f35d575-a4f2-4020-8322-3eb138e7f258",
+                        "neutron-subnet-id": "d476da9d-bf9b-49e1-aec9-fee99b863f30"
+                    }
+                ],
+                "vlans" : {
+                                       "vlan": [
+                                               {
+                                                       "in-maint": false,
+                                                       "is-ip-unnumbered": false,
+                                                       "is-private": false,
+                                                       
+                                                       "vlan-id-inner": 0,
+                                                       "vlan-id-outer": 965,
+                                                       "vlan-interface": "oamfw_oam_direct1_0_port141"
+                                               }
+                                       ]
+                               }
+            }
+        ]
+    }
+}
\ No newline at end of file
diff --git a/tests/so/orchestration/assets/templates/gr-api/PhysicalServerCreate.json b/tests/so/orchestration/assets/templates/gr-api/PhysicalServerCreate.json
new file mode 100644 (file)
index 0000000..c0f0ea5
--- /dev/null
@@ -0,0 +1,111 @@
+{
+       "hostname": "rdm52r19c001",
+       "equip-type": "rack server",
+       "equip-vendor": "DELL",
+       "equip-model": "SVR - R740XD - AIC 25GB AC -  44 CORE - 384GB RAM - 4 X 480GB SSD - 6 X 2.4TB HDD - 2 X 1GB - 4 X 10GB X710 - 4 X 25GB (INTEL XXV710) - NBD",
+       "fqdn": "test.com",
+       "inv-status": "Configuration",
+       "in-maint": false,
+       "prov-status": "PREPROV",
+       "host-profile": "ns-hp1",
+       "role": "Application",
+       "function": "Node",
+       "p-interfaces": 
+       {
+               "p-interface": 
+               [
+                       {
+                               "interface-name": "p7/1",
+                               "speed-value": "25",
+                               "speed-units": "GE",
+                               "port-description": "25GE_rdm521928el1_et-0/0/1:1_[ckt-id]_[fac-id]_[CBB][NCOPS]",
+                               "interface-role": "OAM",
+                               "interface-type": "BUNDLE-MEMBER",
+                               "prov-status": "PREPROV",
+                               "in-maint": false
+                       },
+
+                       {
+                               "interface-name": "p2/2",
+                               "speed-value": "25",
+                               "speed-units": "GE",
+                               "port-description": "25GE_rdm521929el1_et-0/0/1:1_[ckt-id]_[fac-id]_[CBB][NCOPS]",
+                               "interface-role": "OAM",
+                               "interface-type": "BUNDLE-MEMBER",
+                               "prov-status": "PREPROV",
+                               "in-maint": false
+                       },
+
+                       {
+                               "interface-name": "p7/2",
+                               "speed-value": "25",
+                               "speed-units": "GE",
+                               "port-description": "25GE_rdm521929el1_et-0/0/0:1_[ckt-id]_[fac-id]_[CBB][NCOPS]",
+                               "interface-role": "APPLICATION",
+                               "interface-type": "PHYSICAL",
+                               "prov-status": "PREPROV",
+                               "in-maint": false,
+                               "sriov-pfs":
+                               {
+                                       "sriov-pf": 
+                                       [
+                                               {
+                                                       "pf-pci-id": "0000:5e:00.0"
+                                               }
+                                       ]
+                               }
+                       },
+                       {
+                               "interface-name": "p2/1",
+                               "speed-value": "25",
+                               "speed-units": "GE",
+                               "port-description": "25GE_rdm521928el1_et-0/0/0:1_[ckt-id]_[fac-id]_[CBB][NCOPS]",
+                               "interface-role": "APPLICATION",
+                               "interface-type": "PHYSICAL",
+                               "prov-status": "PREPROV",
+                               "in-maint": false,
+                               "sriov-pfs": 
+                               {
+                                       "sriov-pf": 
+                                       [
+                                               {
+                                                       "pf-pci-id": "0000:5e:01.0"
+                                               }
+                                       ]
+                               }
+                       },
+                       {
+                               "interface-name": "P1",
+                               "speed-value": "1",
+                               "speed-units": "GE",
+                               "port-description": "1GE_rdm520019sx2_GigabitEthernet1/0/3_[ckt-id]_[fac-id]_[CBB][NCOPS]",
+                               "interface-role": "PXE",
+                               "interface-type": "PHYSICAL",
+                               "prov-status": "PREPROV",
+                               "in-maint": false
+                       },
+
+                       {
+                               "interface-name": "R",
+                               "speed-value": "1",
+                               "speed-units": "GE",
+                               "port-description": "1GE_rdm520019sx2_GigabitEthernet1/0/4_[ckt-id]_[fac-id]_[CBB][NCOPS]",
+                               "interface-role": "IPMI",
+                               "interface-type": "PHYSICAL",
+                               "prov-status": "PREPROV",
+                               "in-maint": false
+                       }
+               ]
+       },
+       "lag-interfaces": 
+       {
+               "lag-interface": 
+               [
+                       {
+                               "interface-name": "bond1",
+                               "prov-status": "PREPROV",
+                               "in-maint": false
+                       }
+               ]
+       }
+}
\ No newline at end of file
diff --git a/tests/so/orchestration/assets/templates/setup_cloud_region.json b/tests/so/orchestration/assets/templates/setup_cloud_region.json
new file mode 100644 (file)
index 0000000..cc5d857
--- /dev/null
@@ -0,0 +1,10 @@
+{
+    "cloud-owner": "${cloudOwner}",
+    "cloud-region-id": "${cloudRegionId}",
+    "cloud-type": "${cloudType}",
+    "owner-defined-type": "${ownerDefinedType}",
+    "cloud-region-version": "${cloudRegionVersion}",
+    "cloud-zone": "${cloudZone}",
+    "complex-name": "${complexName}",
+    "sriov-automation": "${sriovAutomation}"
+}
\ No newline at end of file
diff --git a/tests/so/orchestration/assets/templates/setup_tenant.json b/tests/so/orchestration/assets/templates/setup_tenant.json
new file mode 100644 (file)
index 0000000..e615ede
--- /dev/null
@@ -0,0 +1,4 @@
+{
+    "tenant-id": "${tenantId}",
+    "tenant-name": "${tenantName}"
+}
\ No newline at end of file
diff --git a/tests/so/orchestration/data/bpmn-infra/aLaCarte/ServiceInstance.csv b/tests/so/orchestration/data/bpmn-infra/aLaCarte/ServiceInstance.csv
new file mode 100644 (file)
index 0000000..a3468c8
--- /dev/null
@@ -0,0 +1,2 @@
+uniqueKey,productFamilyId,instanceName,serviceInstModelInvariantId,serviceInstModelDescription,serviceInstModelType,serviceInstModelNameVersionId,serviceInstModelVersion,serviceInstModelName,owningEntityId,owningEntityName,projectName,serviceType,aLaCarteFlag,subscriberId,sync_response,orch_response,testApi,distributionFilePath,dlpFlag
+TC_1,a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb,Robot_SI,944862ae-bb65-4429-8330-a6c9170d6672,Demo,service,d88da85c-d9e8-4f73-b837-3a72a431622b,1,Vf servername-Service,c3f57fa8-ac7d-11e8-98d0-529269fb1459,SO_Test-Network_2.0-1806 & GR_API OE SO_Test200,GR_API_OE_SO_Test200,Robot_Test_Service_Type,true,Robot_Test_Subscriber_ID,202,COMPLETE,GR_API,tests/so/orchestration/assets/templates/sdc_notif_container.json,false
diff --git a/tests/so/orchestration/resources/SoKeywords.robot b/tests/so/orchestration/resources/SoKeywords.robot
new file mode 100644 (file)
index 0000000..f9f6898
--- /dev/null
@@ -0,0 +1,103 @@
+*** Settings ***
+Library        StringTemplater
+Library        Collections
+Library        RequestsLibrary
+Library        HttpLibrary.HTTP
+Library        OperatingSystem
+Library        BuiltIn
+Library        String
+Library        XML
+Resource    common/Variables.robot
+Resource       SoVariables.robot
+Resource    global_properties.robot
+Resource    so_interface.robot
+
+***Variables***
+${SO_REST_URL}    ${GLOBAL_SO_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SO_IP_ADDR}:${GLOBAL_SO_SERVER_PORT}
+
+*** Keywords ***
+Wait To Poll
+       [Documentation] Sleep the execution for the specified time (in seconds).
+       Sleep   ${POLL_WAIT_TIME}
+
+Poll Orchestration Request
+       [Documentation] Poll the service orchestration request for the completion. Uses MAX_POLL_COUNT to specify the maximum number of polling attempts.
+       [Arguments]     ${request_id}
+       : FOR   ${INDEX}        IN RANGE        1       ${MAX_POLL_COUNT}
+       \       Log         'Poll Count :'
+       \       Log     ${INDEX}
+       \       ${orchestration_request_response}=      Get Orchestration Request Status        ${request_id}
+
+       #       First check request status code
+       \       ${orch_request_status_code}=    Set Variable    ${orchestration_request_response.status_code}
+       \       ${orchestration_failure_message}=       Run Keyword If  ${orch_request_status_code} != ${HTTP_OK}       Catenate        Error Code      ${orch_request_status_code}
+       \       ${request_completion_status}=   Run Keyword If  ${orch_request_status_code} != ${HTTP_OK}       Set Variable    '${ORCH_REQUEST_FAILED}'
+       \       Exit For Loop If        ${orch_request_status_code} != ${HTTP_OK}
+
+       #       Get Status of Orchestration request
+       \       Log     ${orchestration_request_response.content}
+       \       ${request_completion_status}    Get Json Value  ${orchestration_request_response.content}       /request/requestStatus/requestState
+       \       ${orchestration_status_message}=        Run Keyword If  ${request_completion_status} != '${ORCH_REQUEST_IN_PROGRESS}'   Get Json Value  ${orchestration_request_response.content}       /request/requestStatus/statusMessage
+       \       Log     ${request_completion_status}
+
+       #       Check for FAILED status
+       \       ${orchestration_failure_message}=       Run Keyword If  ${request_completion_status} == '${ORCH_REQUEST_FAILED}'        Set Variable    ${orchestration_status_message}
+       \       Exit For Loop If        ${request_completion_status} == '${ORCH_REQUEST_FAILED}'
+
+       #       Check for COMPLETE status
+       \       Exit For Loop If        ${request_completion_status} == '${ORCH_REQUEST_COMPLETE}'
+
+       #       Check for MAX NO OF POLL count, and exit if it has reached the maximum poll count
+       \       ${orchestration_failure_message}=       Run Keyword If  ${INDEX} == ${MaxPollCount}-1   Set Variable    ${TIME_OUT_MESSAGE}
+       \       Exit For Loop If        ${INDEX} == ${MaxPollCount}-1
+       \       Wait To Poll
+       LOG     ${orchestration_failure_message}
+       ${request_completion_status}    Get Substring   ${request_completion_status}    1       -1
+       [Return]        ${request_completion_status}    ${orchestration_failure_message}
+
+Get Orchestration Request Status
+       [Documentation] Get the status of the orchestrated service request.
+       [Arguments]     ${request_id}
+       
+       ${url}= Catenate        SEPARATOR=/     ${SO_ORCHESTRATION_REQUESTS_URI}        ${request_id}
+       ${orchestration_request_response}       Run SO Get Request    ${url}
+       [Return]        ${orchestration_request_response}
+       
+Get Orchestration Request Status with parameters
+       [Documentation] Get the status of the orchestrated service request.
+       [Arguments]     ${request_id}    ${parameter}
+       
+       ${url}= Catenate        ${SO_ORCHESTRATION_REQUESTS_URI}/${request_id}?${parameter}
+       ${orchestration_request_response}       Run SO Get Request    ${url}
+       [Return]        ${orchestration_request_response}
+       
+Get ExtSystemErrorSource
+    [Documentation]         Return ExtSystemErrorSource from Get Orchestration Request
+    [Arguments]             ${request_id}
+    
+    ${orchestration_request_response}    Get Orchestration Request Status with parameters    ${request_id}    format=statusdetail
+    ${orchestration_request_response_json}    Parse Json    ${orchestration_request_response.content}
+    ${extSystemErrorSource}    Convert to String    ${orchestration_request_response_json['request']['requestStatus']['extSystemErrorSource']}
+        
+    [Return]    ${extSystemErrorSource}
+    
+Get RollbackExtSystemErrorSource
+    [Documentation]         Return ExtSystemErrorSource from Get Orchestration Request
+    [Arguments]             ${request_id}
+    
+    ${orchestration_request_response}    Get Orchestration Request Status with parameters    ${request_id}    format=statusdetail
+    ${orchestration_request_response_json}    Parse Json    ${orchestration_request_response.content}
+    ${rollbackExtSystemErrorSource}    Convert to String    ${orchestration_request_response_json['request']['requestStatus']['rollbackExtSystemErrorSource']}
+        
+    [Return]    ${rollbackExtSystemErrorSource}
+    
+Get FlowStatus
+    [Documentation]         Return Flow Status from Get Orchestration Request
+    [Arguments]             ${request_id}
+    
+    ${orchestration_request_response}    Get Orchestration Request Status with parameters    ${request_id}    format=statusdetail
+    ${orchestration_request_response_json}    Parse Json    ${orchestration_request_response.content}
+    Log    ${orchestration_request_response_json} 
+    ${flow_status}    Convert to String    ${orchestration_request_response_json['request']['requestStatus']['flowStatus']}
+        
+    [Return]    ${flow_status}
\ No newline at end of file
diff --git a/tests/so/orchestration/resources/SoVariables.robot b/tests/so/orchestration/resources/SoVariables.robot
new file mode 100644 (file)
index 0000000..b3ea909
--- /dev/null
@@ -0,0 +1,67 @@
+*** Variables ***
+### Orchestration Polling Properties ###
+${POLL_WAIT_TIME}    5
+${MEGA_POLL_WAIT_TIME}    5
+${MAX_POLL_COUNT}    72
+
+### Common Properties ###
+${VNFS}     vnfs
+${VFMODULES}     vfModules
+${SO_REST_URI}       /onap/so/infra/serviceInstantiation/v7/serviceInstances
+${SO_ORCHESTRATION_REQUESTS_URI}       /onap/so/infra/orchestrationRequests/v7
+${SO_HEALTHCHECK_URI}    /manage/health
+
+${SO_AUDIT_REST_URI}    /audit/v1/services/
+
+### Layer3 Properties ###
+&{SO_LAYER3_HEADERS}     Content-Type=application/xml     Accept=application/xml     Authorization=Basic YXBpaEJwbW46Y2FtdW5kYS1SMTUxMiE=
+### Service Properties ###
+${SO_REST_URI_CREATE_SERVICE}    ${SO_REST_URI}
+${SO_REST_URI_DELETE_SERVICE}    ${SO_REST_URI}
+
+### VNF Module Properties ###
+${SO_REST_URI_CREATE_VFMODULE}    ${SO_REST_URI}/<SERVICEINSTANCEID>/vnfs/<VNFINSTANCEID>/vfModules
+${SO_REST_URI_DELETE_VFMODULE}    ${SO_REST_URI}/<SERVICEINSTANCEID>/vnfs/<VNFINSTANCEID>/vfModules/<VFMODULEINSTANCEID>
+### Messages ###
+${TIME_OUT_MESSAGE}    No Successful response within specified time
+${ORCH_FAILURE_MESSAGE}    Orchestration request has failed
+
+#####  VF SPECIFIC PROPERTIES  #####
+${INVALID_SERVICE_ID_MSG}    "Error parsing request.${SPACE}${SPACE}No valid serviceInstanceId is specified"
+${INVALID_VNF_INST_ID_MSG}    "Error parsing request.${SPACE}${SPACE}No valid vnfInstanceId is specified"
+${DELETE_VNF_FAIL_MSG}    "Can't Delete Generic Vnf. Generic Vnf is still in use."
+
+#####  NETWORK SPECIFIC PROPERTIES  #####
+${INVALID_NW_INST_ID_MSG}    "Error parsing request.${SPACE}${SPACE}No valid networkInstanceId is specified"
+${INV_MODEL_NAME_MSG}    "Received error from Network Adapter: Unknown Network Type: CONTRAIL_INTERNAL"
+${BLANK_MODEL_NAME_MSG}    "Error parsing request.${SPACE}${SPACE}No valid modelName is specified"
+${INV_REGION_ID_MSG}    "Received error from Network Adapter: Cloud Site [RegionTwo] not found"
+${BLANK_REGION_ID_MSG}    "Error parsing request.${SPACE}${SPACE}No valid lcpCloudRegionId is specified"
+${INV_TENANT_MSG}     "Received error from Network Adapter: 404 Not Found: "
+${BLANK_TENANT_ID_MSG}    "Error parsing request.${SPACE}${SPACE}No valid tenantId is specified"
+${INV_SOURCE_MSG}    "Recipe does not exist in catalog DB"
+${BLANK_SOURCE_MSG}    "Error parsing request.${SPACE}${SPACE}No valid source is specified"
+${BLANK_INVAR_ID_MSG}    "Error parsing request.${SPACE}${SPACE}No valid modelInvariantId is specified"
+${BLANK_VER_ID_MSG}    "Error parsing request.${SPACE}${SPACE}No valid modelVersionId is specified"
+${BLANK_REQ_ID_MSG}    "Error parsing request.${SPACE}${SPACE}No valid requestorId is specified"
+
+### Orchestration Constants ###
+${ORCH_REQUEST_COMPLETE}    COMPLETE
+${ORCH_REQUEST_COMPLETED}    COMPLETED
+${ORCH_REQUEST_FAILED}    FAILED
+${ORCH_REQUEST_IN_PROGRESS}     IN_PROGRESS
+
+### MODEL TYPE ###
+${MODEL_TYPE_SERVICE}    service
+${MODEL_TYPE_VNF}    vnf
+${MODEL_TYPE_VFMODULE}    vfModule
+${MODEL_TYPE_VOLUME_GROUP}      volumeGroup
+${MODEL_TYPE_NETWORK}     network
+${INV_MODEL_TYPE_VNF}    vnf1
+${INVALID_MODEL_TYPE}             INVALID_MODEL_TYPE
+${INVALID_SERVICE_MODEL_NAME}     INVALID_SERVICE_MODEL
+${INVALID_VFMODULE_MODEL_NAME}    INVALID_VFMODULE_MODEL
+${INVALID_CLOUD_REGION_ID}        INVALID_CLR
+
+### CLOUD DATA ###
+${TENANT_ID}             22eb191dd41a4f3c9be370fc638322f4
\ No newline at end of file
diff --git a/tests/so/orchestration/resources/aai/aai_interface.robot b/tests/so/orchestration/resources/aai/aai_interface.robot
new file mode 100644 (file)
index 0000000..67e828d
--- /dev/null
@@ -0,0 +1,91 @@
+*** Settings ***
+Documentation     The main interface for interacting with A&AI. It handles low level stuff like managing the http request library and A&AI required fields
+Library              RequestsLibrary
+Library                  UUID
+Library           HTTPUtils
+Resource            ../global_properties.robot
+
+*** Variables ***
+${AAI_HEALTH_PATH}  /aai/util/echo?action=long
+${VERSIONED_INDEX_PATH}     /aai/v14
+${AAI_FRONTEND_ENDPOINT}    ${GLOBAL_AAI_SERVER_PROTOCOL}://${GLOBAL_INJECTED_AAI1_IP_ADDR}:${GLOBAL_AAI_SERVER_PORT}
+
+*** Keywords ***
+Run A&AI Health Check
+    [Documentation]    Runs an A&AI health check
+    :FOR    ${i}    IN RANGE    20
+    \    ${resp}=    Run A&AI Get Request    ${AAI_HEALTH_PATH}
+    \    Log    Received response from so ${resp.json()}
+    \    Log    Received response from so status ${resp.status_code}
+    \    ${exit_loop}=    Evaluate    ${resp.status_code} == 200
+    \    Exit For Loop If    ${exit_loop}
+    \    Sleep    15s
+
+Run A&AI Get Request
+    [Documentation]    Runs an A&AI get request
+    [Arguments]    ${data_path}
+    Disable Warnings
+    Create Session     aai     ${AAI_FRONTEND_ENDPOINT}
+    ${uuid}=    Generate UUID
+    ${headers}=  Create Dictionary     Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==    Accept=application/json    Content-Type=application/json    X-TransactionId=Test    X-FromAppId=SO
+    ${resp}=   Get Request     aai     ${data_path}     headers=${headers}
+    Log    Received response from aai ${resp.text}
+    [Return]    ${resp}
+
+Run A&AI Put Request
+    [Documentation]    Runs an A&AI put request
+    [Arguments]    ${data_path}    ${data}
+    Disable Warnings
+    Create Session     aai     ${AAI_FRONTEND_ENDPOINT}
+    ${uuid}=    Generate UUID
+    ${headers}=  Create Dictionary     Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==    Accept=application/json    Content-Type=application/json    X-TransactionId=Test    X-FromAppId=SO
+    ${resp}=   Put Request     aai     ${data_path}     data=${data}    headers=${headers}
+    Log    Received response from aai ${resp.text}
+    [Return]    ${resp}
+
+Run A&AI Post Request
+    [Documentation]    Runs an A&AI Post request
+    [Arguments]    ${data_path}    ${data}
+    Disable Warnings
+    Create Session     aai     ${AAI_FRONTEND_ENDPOINT}
+    ${uuid}=    Generate UUID
+    ${headers}=  Create Dictionary     Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==    Accept=application/json    Content-Type=application/json    X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid}    X-FromAppId=${GLOBAL_APPLICATION_ID}
+    ${resp}=   Post Request    aai     ${data_path}     data=${data}    headers=${headers}
+    Log    Received response from aai ${resp.text}
+    [Return]    ${resp}
+
+Run A&AI Patch Request
+    [Documentation]    Runs an A&AI Post request
+    [Arguments]    ${data_path}    ${data}
+    Disable Warnings
+    Log    ${data}
+    Create Session     aai     ${AAI_FRONTEND_ENDPOINT}
+    ${uuid}=    Generate UUID
+    ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/merge-patch+json    X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid}    X-FromAppId=${GLOBAL_APPLICATION_ID}    X-HTTP-Method-Override=PATCH
+    ${resp}=   Post Request    aai     ${data_path}     data=${data}    headers=${headers}
+    Log    Received response from aai ${resp.text}
+    [Return]    ${resp}
+
+Run A&AI Delete Request
+    [Documentation]    Runs an A&AI delete request
+    [Arguments]    ${data_path}    ${resource_version}
+    Disable Warnings
+    Create Session     aai     ${AAI_FRONTEND_ENDPOINT}
+    ${uuid}=    Generate UUID
+    ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json    X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid}    X-FromAppId=${GLOBAL_APPLICATION_ID}
+    ${resp}=   Delete Request  aai     ${data_path}?resource-version=${resource_version}       headers=${headers}
+    Log    Received response from aai ${resp.text}
+    [Return]    ${resp}
+
+Delete A&AI Entity
+    [Documentation]    Deletes an entity in A&AI
+    [Arguments]    ${uri}
+    ${get_resp}=    Run A&AI Get Request     ${VERSIONED_INDEX PATH}${uri}
+       Run Keyword If    '${get_resp.status_code}' == '200'    Delete A&AI Entity Exists    ${uri}    ${get_resp.json()['resource-version']}
+
+Delete A&AI Entity Exists
+    [Documentation]    Deletes an  A&AI        entity
+    [Arguments]    ${uri}    ${resource_version_id}
+    ${put_resp}=    Run A&AI Delete Request    ${VERSIONED_INDEX PATH}${uri}    ${resource_version_id}
+    Should Be Equal As Strings         ${put_resp.status_code}         204
+
diff --git a/tests/so/orchestration/resources/aai/service_instance.robot b/tests/so/orchestration/resources/aai/service_instance.robot
new file mode 100644 (file)
index 0000000..bdf4547
--- /dev/null
@@ -0,0 +1,191 @@
+*** Settings ***
+Documentation    Validate A&AI Serivce Instance
+...
+...                  Validate A&AI Serivce Instance
+
+Resource          aai_interface.robot
+Library    Collections
+Library    OperatingSystem
+Library    RequestsLibrary
+Library    JSONUtils
+Library    HttpLibrary.HTTP
+Library    StringTemplater
+Resource          ../json_templater.robot
+Resource          ../aai/aai_interface.robot
+Resource          ../properties/cloudRegion.robot
+*** Variables ***
+${INDEX PATH}     /aai/v15
+${GENERIC_QUERY_PATH}  /search/generic-query?
+${SYSTEM USER}    robot-ete
+${CUSTOMER SPEC PATH}    /business/customers/customer/
+${SERVICE SUBSCRIPTIONS}    /service-subscriptions/service-subscription/
+${SERVICE_INSTANCE_QUERY}    /service-instances?service-instance-name=
+${SERVCE INSTANCE TEMPLATE}    robot/assets/templates/aai/service_subscription.template
+${vnf_orch_update_json}    robot/assets/templates/aai/vnf_orch_update.template
+${GENERIC_VNF_PATH_TEMPLATE}   /network/generic-vnfs/generic-vnf/\${vnf_id}/vf-modules/vf-module/\${vf_module_id}
+${GENERIC_VNF_QUERY_TEMPLATE}   /network/generic-vnfs/generic-vnf/\${vnf_id}/vf-modules/vf-module?vf-module-name=\${vf_module_name}
+${VLB_CLOSED_LOOP_HACK_BODY}    robot/assets/templates/aai/vlb_closed_loop_hack.template
+${ROOT_CLOUD_PATH}     /cloud-infrastructure/cloud-regions/cloud-region
+#*************** Test Case Variables *************
+${VLB_CLOSED_LOOP_DELETE}
+${VLB_CLOSED_LOOP_VNF_ID}
+
+
+*** Keywords ***
+Validate Service Instance
+    [Documentation]    Query and Validates A&AI Service Instance
+    [Arguments]    ${service_instance_name}    ${service_type}    ${customer_name}    ${orchestration_status}
+    ${cust_resp}=    Run A&AI Get Request      ${INDEX PATH}/business/customers?subscriber-name=${customer_name}
+       ${resp}=    Run A&AI Get Request      ${INDEX PATH}${CUSTOMER SPEC PATH}${cust_resp.json()['customer'][0]['global-customer-id']}${SERVICE SUBSCRIPTIONS}${service_type}${SERVICE_INSTANCE_QUERY}${service_instance_name}
+    Dictionary Should Contain Value    ${resp.json()['service-instance'][0]}    ${service_instance_name}
+    Dictionary Should Contain Value    ${resp.json()['service-instance'][0]}    ${orchestration_status}
+
+Validate Service Instance By Id
+    [Documentation]    Query and Validates A&AI Service Instance
+    [Arguments]    ${service_instance_id}
+    ${resp}=    Run A&AI Get Request      ${INDEX PATH}/nodes/service-instances/service-instance/${service_instance_id}?depth=0&nodes-only
+    Should Be Equal As Strings         ${resp.status_code}     200
+
+Delete Service Instance by Id
+    [Documentation]    Delete  passed service in A&AI
+    [Arguments]    ${service_instance_id}
+    ${resp}=    Run A&AI Get Request      ${INDEX PATH}/nodes/service-instances/service-instance/${service_instance_id}
+       Run Keyword If    '${resp.status_code}' == '200'    Run A&AI Delete Request    ${INDEX PATH}/nodes/service-instances/service-instance/${service_instance_id}    ${resp.json()['resource-version']}
+
+Validate Customer By Id
+    [Documentation]    Query and Validates A&AI Service Instance
+    [Arguments]    ${customer_id}    ${status_code}
+    ${cust_resp}=    Run A&AI Get Request      ${INDEX PATH}/business/customers/customer/${customer_id}
+    Should Be Equal As Strings         ${cust_resp.status_code}        ${status_code}
+
+Validate Generic VNF
+    [Documentation]    Query and Validates A&AI Service Instance
+    [Arguments]    ${vnf_name}  ${vnf_type}    ${service_instance_id}
+    ${generic_vnf}=    Run A&AI Get Request      ${INDEX PATH}/network/generic-vnfs/generic-vnf?vnf-name=${vnf_name}
+    Dictionary Should Contain Value    ${generic_vnf.json()}    ${vnf_name}
+    ${returned_vnf_type}=    Get From Dictionary    ${generic_vnf.json()}    vnf-type
+    Should Contain     ${returned_vnf_type}    ${vnf_type}
+    ${vnf_id}=    Get From Dictionary    ${generic_vnf.json()}    vnf-id
+    ${generic_vnf}=    Run A&AI Get Request      ${INDEX PATH}/network/generic-vnfs/generic-vnf/${vnf_id}?depth=all
+    [Return]    ${generic_vnf.json()}
+
+Delete Vnf by Id
+    [Documentation]    Delete  passed service in A&AI
+    [Arguments]    ${vnf_id}
+    ${resp}=    Run A&AI Get Request      ${INDEX PATH}/network/generic-vnfs/generic-vnf/${vnf_id}
+    
+       Run Keyword If    '${resp.status_code}'=='200'    Run A&AI Delete Request    ${INDEX PATH}/network/generic-vnfs/generic-vnf/${vnf_id}    ${resp.json()['resource-version']}
+
+Delete Volume Group by Id
+    [Documentation]    Delete  passed service in A&AI
+    [Arguments]    ${volume_group_instance_id}
+    ${resp}=    Run A&AI Get Request      ${INDEX PATH}${ROOT_CLOUD_PATH}/${cloud_owner}/${cloud_region_id}/volume-groups/volume-group/${volume_group_instance_id}
+    
+       Run Keyword If    '${resp.status_code}'=='200'    Run A&AI Delete Request    ${INDEX PATH}${ROOT_CLOUD_PATH}/${cloud_owner}/${cloud_region_id}/volume-groups/volume-group/${volume_group_instance_id}    ${resp.json()['resource-version']}
+
+Validate Tenant By Name
+    [Documentation]    Query and Validates A&AI Service Instance
+    [Arguments]    ${tenant_name}    ${cloud_owner}    ${cloud_region}    ${response_code}
+    ${tenants}=    Run A&AI Get Request      ${INDEX PATH}/cloud-infrastructure/cloud-regions/cloud-region/${cloud_owner}/${cloud_region}/tenants?tenant-name=${tenant_name}
+    Should Be Equal As Strings    ${tenants.status_code}    ${response_code}
+    Run Keyword If    '${response_code}'=='200'    Dictionary Should Contain Value     ${tenants.json()['tenant'][0]}    ${tenant_name}
+
+Validate Line of Business
+    [Arguments]    ${vnf_id}    @{Lobs}
+        :FOR    ${ELEMENT}    IN    @{Lobs}
+        \    ${response}     Run A&AI Get Request      ${INDEX PATH}/network/generic-vnfs/generic-vnf/${vnf_id}/related-to/lines-of-business?line-of-business-name=${ELEMENT}
+           \    Should Be Equal As Strings     ${response.status_code}         200
+
+Validate Platform
+    [Arguments]    ${vnf_id}    @{platforms}
+        :FOR    ${platform}    IN    @{platforms}
+        \    ${response}     Run A&AI Get Request      ${INDEX PATH}/network/generic-vnfs/generic-vnf/${vnf_id}/related-to/platforms?platform-name=${platform}
+           \    Should Be Equal As Strings     ${response.status_code}         200
+
+    
+Validate Owning Entity By Name
+    [Arguments]    ${owning_entity_name}
+    ${oe_resp}=    Run A&AI Get Request      ${INDEX PATH}/business/owning-entities?owning-entity-name=${owning_entity_name}
+    Should Be Equal As Strings    ${oe_resp.json()['owning-entity'][0]['owning-entity-name']}    ${owning_entity_name}
+        
+
+
+VLB Closed Loop Hack
+    [Arguments]    ${service}    ${generic_vnf}   ${closedloop_vf_module}
+    Return From Keyword If    '${service}' != 'vLB'
+    ${vnf_id}=     Get From Dictionary    ${generic_vnf}    vnf-id
+    ${vf_modules}=    Get From Dictionary    ${generic_vnf}    vf-modules
+    ${list}=    Get From Dictionary    ${vf_modules}   vf-module
+    ${vfmodule}=    Get From List    ${list}    0
+    ${persona_model_id}=    Get From Dictionary    ${closedloop_vf_module}    invariantUUID
+    ${persona_model_version}=   Get From Dictionary    ${closedloop_vf_module}    version
+    ${dummy}=    Catenate   dummy_${vnf_id}
+    ${dict}=    Create Dictionary   vnf_id=${vnf_id}   vf_module_id=${dummy}   persona_model_id=${persona_model_id}   persona_model_version=${persona_model_version}
+    ${datapath}=    Template String    ${GENERIC_VNF_PATH_TEMPLATE}    ${dict}
+    ${data}=   Fill JSON Template File    ${VLB_CLOSED_LOOP_HACK_BODY}    ${dict}
+       ${put_resp}=    Run A&AI Put Request     ${INDEX PATH}${datapath}   ${data}
+    ${status_string}=    Convert To String    ${put_resp.status_code}
+    Should Match Regexp    ${status_string}    ^(201|412)$
+    Set Test Variable   ${VLB_CLOSED_LOOP_DELETE}    ${datapath}
+    Set Test Variable   ${VLB_CLOSED_LOOP_VNF_ID}    ${vnf_id}
+
+VLB Closed Loop Hack Update
+    [Documentation]   Update the A&AI vDNS scaling vf module to have persona-model-version 1 rather than 1.0
+    [Arguments]   ${stack_name}
+    ${dict}=    Create Dictionary   vnf_id=${VLB_CLOSED_LOOP_VNF_ID}   vf_module_name=${stack_name}
+    ${query}=   Template String   ${GENERIC_VNF_QUERY_TEMPLATE}   ${dict}
+    ${get_resp}=    Run A&AI Get Request     ${INDEX_PATH}${query}
+    ${json}=   Set Variable   ${get_resp.json()}
+    Set to Dictionary    ${json}   persona-model-version   1
+    ${vf_module_id}=   Get From Dictionary   ${json}   vf-module-id
+    Set to Dictionary   ${dict}   vf_module_id=${vf_module_id}
+    ${uri}=   Template String   ${GENERIC_VNF_PATH_TEMPLATE}   ${dict}
+    ${resp}=   Run A&AI Put Request    ${INDEX_PATH}${uri}   ${json}
+    ${get_resp}=    Run A&AI Get Request     ${INDEX_PATH}${query}
+
+Teardown VLB Closed Loop Hack
+    Return From Keyword If    ' ${VLB_CLOSED_LOOP_DELETE}' == ''
+       Delete A&AI Entity    ${VLB_CLOSED_LOOP_DELETE}
+
+Validate VF Module
+    [Documentation]    Query and Validates A&AI Service Instance
+    [Arguments]    ${vf_module_name}    ${stack_type}
+       Run Keyword If    '${stack_type}'=='vLB'    Validate vLB Stack    ${vf_module_name}
+       Run Keyword If    '${stack_type}'=='vFW'    Validate Firewall Stack    ${vf_module_name}
+       Run Keyword If    '${stack_type}'=='vVG'    Validate vVG Stack    ${vf_module_name}
+
+*** Keywords ***
+Create AAI Service Instance
+    [Documentation]    Query and Validates A&AI Service Instance
+    [Arguments]    ${customer_id}    ${service_type}    ${service_instance_id}    ${service_instance_name}
+    ${json_string}=    Catenate     { "service-type": "VDNS" , "service-subscriptions":[{"service-instance-id":"instanceid123","service-instance-name":"VDNS"}]}
+       ${put_resp}=    Run A&AI Put Request     ${INDEX PATH}${CUSTOMER SPEC PATH}${CUSTOMER ID}${SERVICE SUBSCRIPTIONS}/{service_type}   ${json_string}
+    Should Be Equal As Strings         ${put_resp.status_code}         201
+       [Return]  ${put_resp.status_code}
+
+Validate Service Instance Not Exist
+    [Arguments]    ${service_instance_name}    ${service_type}    ${customer_name}
+    ${cust_resp}=    Run A&AI Get Request      ${INDEX PATH}/business/customers?subscriber-name=${customer_name}
+       ${resp}=    Run A&AI Get Request      ${INDEX PATH}${CUSTOMER SPEC PATH}${cust_resp.json()['customer'][0]['global-customer-id']}${SERVICE SUBSCRIPTIONS}${service_type}${SERVICE_INSTANCE_QUERY}${service_instance_name}
+    Should Be Equal As Strings         ${resp.status_code}     404
+    
+Validate Service Instance Not Exist By Id
+    [Arguments]    ${service_instance_id}
+    ${resp}=    Run A&AI Get Request      ${INDEX PATH}/nodes/service-instances/service-instance/${service_instance_id}?depth=0&nodes-only
+    Should Be Equal As Strings         ${resp.status_code}     404    
+
+Validate Customer Not Exist
+    [Documentation]    Query and Validates A&AI Service Instance
+    [Arguments]    ${customer_name}
+    ${cust_resp}=    Run A&AI Get Request      ${INDEX PATH}/business/customers?subscriber-name=${customer_name}
+    Should Be Equal As Strings    ${cust_resp.status_code}    404
+   
+Validate Owning Entity
+    [Arguments]    ${owning_entity_id}    ${status_code}
+    ${oe_resp}=    Run A&AI Get Request      ${INDEX PATH}/business/owning-entities/owning-entity/${owning_entity_id}
+    Should Be Equal As Strings         ${oe_resp.status_code}  ${status_code}
+
+Validate Project
+    [Arguments]    ${project_name}    ${status_code}
+    ${proj_resp}=    Run A&AI Get Request      ${INDEX PATH}/business/projects/project/${project_name}
+    Should Be Equal As Strings         ${proj_resp.status_code}        ${status_code}
diff --git a/tests/so/orchestration/resources/bpmn-infra/aLaCarte/Create/ServiceInstance.robot b/tests/so/orchestration/resources/bpmn-infra/aLaCarte/Create/ServiceInstance.robot
new file mode 100644 (file)
index 0000000..bab0b32
--- /dev/null
@@ -0,0 +1,172 @@
+*** Settings ***
+Library    Collections
+Library    RequestsLibrary
+Library    HttpLibrary.HTTP
+Library    OperatingSystem
+Library    BuiltIn
+Library    String
+Library    CSVLibrary
+Resource    ../../../json_templater.robot
+Resource    ../../../SoKeywords.robot
+Resource    ../../../common/SoVariables.robot
+Resource    ../../../so_interface.robot
+Resource    ../../../aai/service_instance.robot
+Resource    ../../../common/Variables.robot
+Resource          ../../../properties/tenant.robot
+Resource          ../../../properties/cloudRegion.robot
+
+*** Variables ***
+${data_file}                                     ../../../../data/bpmn-infra/aLaCarte/ServiceInstance.csv
+${create_customer_template_file}                 tests/so/orchestration/assets/templates/aai/add_customer_required_fields.template
+${create_service_subscription_template_file}     tests/so/orchestration/assets/templates/aai/service_subscription_required_fields.template
+${create_service_model_template_file}            tests/so/orchestration/assets/templates/aai/service_model.template
+${serviceInstanceDictionary}
+${serv_inst_id}
+${serv_inst_tc_code}
+${SUBSCRIBER_TYPE}    CUST
+${EXPECTED_ORCHESTRATION_STATUS}    Active
+${tenant_json}    tests/so/orchestration/assets/templates/setup_tenant.json
+${cloud_region_json}    tests/so/orchestration/assets/templates/setup_cloud_region.json
+${NOT_APPLICABLE}    NA
+
+*** Keywords ***
+    
+Setup GR Create Service Instance
+    [Arguments]    ${serv_inst_tc_code}
+    ${serviceInstanceDictionary}    Read CSV Data And Create Dictionary    ${CURDIR}/${data_file}
+    Set Suite Variable    ${serviceInstanceDictionary}
+    Set Suite Variable    ${serv_inst_tc_code}
+
+    Setup Cloud Region
+    Setup Tenant in AAI
+    
+    ${create_service_instance_data}        Get From Dictionary    ${serviceInstanceDictionary}    ${serv_inst_tc_code}
+    
+    ${SUBSCRIBER_ID}    Get From Dictionary    ${create_service_instance_data}   subscriberId
+    Setup Customer    ${SUBSCRIBER_ID}
+    ${SUBSCRIPTION_SERVICE_TYPE}    Get From Dictionary    ${create_service_instance_data}   serviceType
+    Setup Service Subscription    ${SUBSCRIBER_ID}    ${SUBSCRIPTION_SERVICE_TYPE}
+
+    Setup Service Model in A&AI    ${serviceInstanceDictionary}    ${serv_inst_tc_code}
+
+Teardown GR Create Service Instance
+    [Arguments]    ${service_instance_id}
+    Delete Service Instance by Id    ${service_instance_id}
+
+      
+Setup Cloud Region
+    [Documentation]    Setup the cloud region in AAI
+    
+    ${cloud_region_data}    Create Dictionary    cloudOwner=${cloudOwner}    cloudRegionId=${cloudRegionId}    cloudType=${cloudType}
+                                          ...    ownerDefinedType=${ownerDefinedType}    cloudRegionVersion=${cloudRegionVersion}    cloudZone=${cloudZone}
+                                          ...    complexName=${complexName}    sriovAutomation=${sriovAutomation}
+    ${create_cloud_region_json}    Fill JSON Template File    ${cloud_region_json}    ${cloud_region_data}
+    Run A&AI Put Request    ${VERSIONED_INDEX_PATH}/cloud-infrastructure/cloud-regions/cloud-region/${cloudOwner}/${cloudRegionId}    ${create_cloud_region_json}
+    
+    ${json}=    OperatingSystem.Get File    tests/so/orchestration/assets/templates/gr-api/PhysicalServerCreate.json
+    ${returned_json}=  To Json    ${json}
+    Run A&AI Put Request    aai/v14/cloud-infrastructure/pservers/pserver/rdm52r19c001    ${returned_json}
+    
+Setup Tenant in AAI
+    [Documentation]    Setup the tenant in AAI
+    
+    ${tenant_data}    Create Dictionary    tenantId=${aai_tenant_Id}    tenantName=${aai_tenant_name}    
+    ${create_tenant_json}    Fill JSON Template File    ${tenant_json}    ${tenant_data}    
+    Run A&AI Put Request    ${VERSIONED_INDEX_PATH}/cloud-infrastructure/cloud-regions/cloud-region/${cloudOwner}/${cloudRegionId}/tenants/tenant/${aai_tenant_Id}    ${create_tenant_json}
+
+Setup Customer
+    [Documentation]    Creates customer for use in tests
+    [Arguments]    ${SUBSCRIBER_ID}
+    
+    ${create_customer_data}    Create Dictionary    global_customer_id=${SUBSCRIBER_ID}    subscriber_name=${SUBSCRIBER_ID}    subscriber_type=${SUBSCRIBER_TYPE}
+    Set Suite Variable    ${create_customer_data}
+    ${create_customer_json}    Fill JSON Template File    ${create_customer_template_file}    ${create_customer_data}
+
+    Run A&AI Put Request    ${VERSIONED_INDEX_PATH}/business/customers/customer/${SUBSCRIBER_ID}    ${create_customer_json}
+
+Setup Service Subscription
+    [Documentation]    Creates service subscription for use in tests
+    [Arguments]    ${SUBSCRIBER_ID}    ${SUBSCRIPTION_SERVICE_TYPE}
+    ${create_service_subscription_data}    Create Dictionary    service_type=${SUBSCRIPTION_SERVICE_TYPE}
+    Set Suite Variable    ${create_service_subscription_data}
+    ${create_service_subscription_json}    Fill JSON Template File    ${create_service_subscription_template_file}    ${create_service_subscription_data}
+
+    Run A&AI Put Request    ${VERSIONED_INDEX_PATH}/business/customers/customer/${SUBSCRIBER_ID}/service-subscriptions/service-subscription/${SUBSCRIPTION_SERVICE_TYPE}    ${create_service_subscription_json}
+
+Setup Service Model in A&AI
+    [Arguments]    ${serviceeDictionary}    ${serv_inst_tc_code}
+
+    ${create_service_instance_data}        Get From Dictionary    ${serviceInstanceDictionary}    ${serv_inst_tc_code}
+    ${modelInvariantId}    Get From Dictionary    ${create_service_instance_data}   serviceInstModelInvariantId
+    ${modelVersionId}    Get From Dictionary    ${create_service_instance_data}   serviceInstModelNameVersionId
+    ${modelName}    Get From Dictionary    ${create_service_instance_data}   serviceInstModelName
+    ${modelType}    Get From Dictionary    ${create_service_instance_data}   serviceInstModelType
+    ${modelVersion}    Get From Dictionary    ${create_service_instance_data}   serviceInstModelVersion
+    ${modelDescription}    Get From Dictionary    ${create_service_instance_data}   serviceInstModelDescription
+    Setup Model in AAI    ${modelInvariantId}    ${modelType}    ${modelVersionId}    ${modelName}    ${modelVersion}    ${modelDescription}
+  
+Setup Model in AAI
+    [Documentation]    Setup Model in AAI for use in tests
+    [Arguments]    ${modelInvariantId}    ${modelType}    ${modelVersionId}    ${modelName}    ${modelVersion}    ${modelDescription}
+    ${create_service_model_data}    Create Dictionary    modelInvariantId=${modelInvariantId}    modelType=${modelType}    modelVersionId=${modelVersionId}
+                                                        ...    modelName=${modelName}    modelVersion=${modelVersion}    modelDescription=${modelDescription}
+    ${create_service_model_json}    Fill JSON Template File    ${create_service_model_template_file}    ${create_service_model_data}
+
+    Run A&AI Put Request    ${VERSIONED_INDEX_PATH}/service-design-and-creation/models/model/${modelInvariantId}    ${create_service_model_json}
+  
+   
+Create Service Instance
+    [Documentation]    Test Template for CreateServiceInstanceInfra
+    [Arguments]    ${serv_inst_tc_code}    ${payload_template}
+    log    in create si sub
+    Log    ${serv_inst_tc_code}
+    Log    ${payload_template}
+    ${create_service_instance_data}        Get From Dictionary    ${serviceInstanceDictionary}    ${serv_inst_tc_code}
+    Log    create si data
+    Log    ${create_service_instance_data}
+    Log    ${CURDIR}/${payload_template}
+    Log    ${create_service_instance_data}
+    Log    ready to fill
+    ${service_body}=    Fill JSON Template File    ${CURDIR}/${payload_template}    ${create_service_instance_data}
+    Log    got service body
+    Log    ${service_body}
+    Log    after service body
+    ${serv_inst_id}    ${request_id}    ${request_completion_status}    ${status_code}    Invoke Create Service Instance Flow    ${service_body}
+    [Return]    ${serv_inst_id}    ${request_id}    ${request_completion_status}    ${status_code}    ${service_body}
+
+
+
+Invoke Create Service Instance Flow
+    [Documentation]    Create Service Instance
+    [Arguments]    ${service_body}
+    log    invoking
+    ${create_service_response}  Run SO Post request    ${SO_REST_URI_CREATE_SERVICE}    ${service_body}
+    log    retunred ${create_service_response}
+    Return From Keyword If    ${create_service_response.status_code} != ${HTTP_ACCEPTED}    ${EMPTY}    ${EMPTY}    ${EMPTY}    ${create_service_response.status_code}
+    ${request_id_string}    Get Json Value    ${create_service_response.content}    /requestReferences/requestId
+    ${request_id}    Get Substring    ${request_id_string}    1    -1
+    ${instance_id_string}    Get Json Value    ${create_service_response.content}    /requestReferences/instanceId
+    ${instance_id}    Get Substring    ${instance_id_string}    1    -1
+    Log    ${instance_id}
+    ${request_completion_status}    ${orchestration_failure_message}    Run Keyword If    ${create_service_response.status_code} == ${HTTP_ACCEPTED}
+                                                   ...    Poll Orchestration Request    ${request_id}
+
+    [Return]    ${instance_id}    ${request_id}    ${request_completion_status}    ${create_service_response.status_code}
+ Invoke Delete Service Instance Flow
+    [Documentation]    Delete a service instance.
+    [Arguments]    ${service_body}    ${service_instance}
+
+    ${delete_service_response}    Run SO Delete request    ${SO_REST_URI_DELETE_SERVICE}/${service_instance}    data=${service_body}
+
+    Return From Keyword If    ${delete_service_response.status_code} != ${HTTP_ACCEPTED}    ${EMPTY}    ${EMPTY}    ${EMPTY}    ${delete_service_response.status_code}
+
+    ${request_id_string}    Get Json Value    ${delete_service_response.content}    /requestReferences/requestId
+    ${request_id}    Get Substring    ${request_id_string}    1    -1
+    ${instance_id_string}    Get Json Value    ${delete_service_response.content}    /requestReferences/instanceId
+    ${instance_id}    Get Substring    ${instance_id_string}    1    -1
+
+    ${request_completion_status}    ${orchestration_failure_message}    Run Keyword If    ${delete_service_response.status_code} == ${HTTP_ACCEPTED}
+                                                   ...    Poll Orchestration Request    ${request_id}
+
+    [Return]    ${instance_id}    ${request_id}    ${request_completion_status}    ${delete_service_response.status_code}
diff --git a/tests/so/orchestration/resources/common/SoVariables.robot b/tests/so/orchestration/resources/common/SoVariables.robot
new file mode 100644 (file)
index 0000000..3bdfdc6
--- /dev/null
@@ -0,0 +1,68 @@
+*** Variables ***
+### Orchestration Polling Properties ###
+${POLL_WAIT_TIME}    5
+${MEGA_POLL_WAIT_TIME}    5
+${MAX_POLL_COUNT}    72
+
+### Common Properties ###
+${VNFS}     vnfs
+${VFMODULES}     vfModules
+${SO_REST_URI}       /onap/so/infra/serviceInstantiation/v7/serviceInstances
+${SO_ORCHESTRATION_REQUESTS_URI}       /onap/so/infra/orchestrationRequests/v7
+${SO_HEALTHCHECK_URI}    /manage/health
+
+### Layer3 Properties ###
+&{SO_LAYER3_HEADERS}     Content-Type=application/xml     Accept=application/xml     Authorization=Basic YXBpaEJwbW46Y2FtdW5kYS1SMTUxMiE=
+### Service Properties ###
+${SO_REST_URI_CREATE_SERVICE}    ${SO_REST_URI}
+${SO_REST_URI_DELETE_SERVICE}    ${SO_REST_URI}
+
+### VNF Module Properties ###
+${SO_REST_URI_CREATE_VFMODULE}    ${SO_REST_URI}/<SERVICEINSTANCEID>/vnfs/<VNFINSTANCEID>/vfModules
+${SO_REST_URI_DELETE_VFMODULE}    ${SO_REST_URI}/<SERVICEINSTANCEID>/vnfs/<VNFINSTANCEID>/vfModules/<VFMODULEINSTANCEID>
+### Messages ###
+${TIME_OUT_MESSAGE}    No Successful response within specified time
+${ORCH_FAILURE_MESSAGE}    Orchestration request has failed
+
+#####  VF SPECIFIC PROPERTIES  #####
+${INVALID_SERVICE_ID_MSG}    "Error parsing request.${SPACE}${SPACE}No valid serviceInstanceId is specified"
+${INVALID_VNF_INST_ID_MSG}    "Error parsing request.${SPACE}${SPACE}No valid vnfInstanceId is specified"
+${DELETE_VNF_FAIL_MSG}    "Can't Delete Generic Vnf. Generic Vnf is still in use."
+
+#####  NETWORK SPECIFIC PROPERTIES  #####
+${INVALID_NW_INST_ID_MSG}    "Error parsing request.${SPACE}${SPACE}No valid networkInstanceId is specified"
+${INV_MODEL_NAME_MSG}    "Received error from Network Adapter: Unknown Network Type: CONTRAIL_INTERNAL"
+${BLANK_MODEL_NAME_MSG}    "Error parsing request.${SPACE}${SPACE}No valid modelName is specified"
+${INV_REGION_ID_MSG}    "Received error from Network Adapter: Cloud Site [RegionTwo] not found"
+${BLANK_REGION_ID_MSG}    "Error parsing request.${SPACE}${SPACE}No valid lcpCloudRegionId is specified"
+${INV_TENANT_MSG}     "Received error from Network Adapter: 404 Not Found: "
+${BLANK_TENANT_ID_MSG}    "Error parsing request.${SPACE}${SPACE}No valid tenantId is specified"
+${INV_SOURCE_MSG}    "Recipe does not exist in catalog DB"
+${BLANK_SOURCE_MSG}    "Error parsing request.${SPACE}${SPACE}No valid source is specified"
+${BLANK_INVAR_ID_MSG}    "Error parsing request.${SPACE}${SPACE}No valid modelInvariantId is specified"
+${BLANK_VER_ID_MSG}    "Error parsing request.${SPACE}${SPACE}No valid modelVersionId is specified"
+${BLANK_REQ_ID_MSG}    "Error parsing request.${SPACE}${SPACE}No valid requestorId is specified"
+
+### Orchestration Constants ###
+${ORCH_REQUEST_COMPLETE}    COMPLETE
+${ORCH_REQUEST_COMPLETED}    COMPLETED
+${ORCH_REQUEST_FAILED}    FAILED
+${ORCH_REQUEST_IN_PROGRESS}     IN_PROGRESS
+
+### MODEL TYPE ###
+${MODEL_TYPE_SERVICE}    service
+${MODEL_TYPE_VNF}    vnf
+${MODEL_TYPE_VFMODULE}    vfModule
+${MODEL_TYPE_VOLUME_GROUP}      volumeGroup
+${MODEL_TYPE_NETWORK}     network
+${INV_MODEL_TYPE_VNF}    vnf1
+${INVALID_MODEL_TYPE}             INVALID_MODEL_TYPE
+${INVALID_SERVICE_MODEL_NAME}     INVALID_SERVICE_MODEL
+${INVALID_VFMODULE_MODEL_NAME}    INVALID_VFMODULE_MODEL
+${INVALID_CLOUD_REGION_ID}        INVALID_CLR
+
+
+### CLOUD DATA ###
+${TENANT_ID}             22eb191dd41a4f3c9be370fc638322f4
+
+
diff --git a/tests/so/orchestration/resources/common/Variables.robot b/tests/so/orchestration/resources/common/Variables.robot
new file mode 100644 (file)
index 0000000..a6ee32b
--- /dev/null
@@ -0,0 +1,15 @@
+*** Variables ***
+###  HTTP response Codes ###
+${HTTP_OK}             200
+${HTTP_ACCEPTED}       202
+${HTTP_NO_CONTENT}     204
+${HTTP_BAD_REQUEST}    400
+${HTTP_BAD_GATEWAY}    502
+${HTTP_RESOURCE_NOT_FOUND}    404
+${INTERNAL_SERVER_ERROR}    500
+${METHOD_NOT_ALLOWED}    405
+
+###TRUE FLASE#####
+${TRUE_VALUE}      true
+${FALSE_VALUE}     false
+
diff --git a/tests/so/orchestration/resources/global_properties.robot b/tests/so/orchestration/resources/global_properties.robot
new file mode 100644 (file)
index 0000000..a4a0f44
--- /dev/null
@@ -0,0 +1,74 @@
+*** Settings ***
+Documentation        store all properties that can change or are used in multiple places here
+...                    format is all caps with underscores between words and prepended with GLOBAL
+...                   make sure you prepend them with GLOBAL so that other files can easily see it is from this file.
+
+
+*** Variables ***
+${GLOBAL_APPLICATION_ID}           robot-ete
+${GLOBAL_SELENIUM_BROWSER}        chrome
+${GLOBAL_SELENIUM_BROWSER_CAPABILITIES}        Create Dictionary
+${GLOBAL_SELENIUM_DELAY}          0
+${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}        5
+${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}        15
+${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE}    orchestration
+${GLOBAL_OPENSTACK_CINDER_SERVICE_TYPE}    volume
+${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE}    compute
+${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE}    network
+${GLOBAL_OPENSTACK_GLANCE_SERVICE_TYPE}    image
+${GLOBAL_OPENSTACK_KEYSTONE_SERVICE_TYPE}    identity
+${GLOBAL_OPENSTACK_STACK_DEPLOYMENT_TIMEOUT}    600s
+${GLOBAL_AAI_CLOUD_OWNER}    CloudOwner
+${GLOBAL_AAI_CLOUD_OWNER_DEFINED_TYPE}    OwnerType
+${GLOBAL_AAI_COMPLEX_NAME}    clli1
+${GLOBAL_AAI_PHYSICAL_LOCATION_ID}    clli1
+${GLOBAL_BUILD_NUMBER}    0
+${GLOBAL_VID_UI_TIMEOUT_SHORT}    20s
+${GLOBAL_VID_UI_TIMEOUT_MEDIUM}    60s
+${GLOBAL_VID_UI_TIMEOUT_LONG}    120s
+${GLOBAL_VM_PRIVATE_KEY}   ${EXECDIR}/robot/assets/keys/robot_ssh_private_key.pvt
+${GLOBAL_AAI_ZONE_ID}    nova1
+${GLOBAL_AAI_ZONE_NAME}    nova
+${GLOBAL_AAI_DESIGN_TYPE}    integration
+${GLOBAL_AAI_ZONE_CONTEXT}    labs
+${GLOBAL_AAI_SERVER_PROTOCOL}    http
+${GLOBAL_INJECTED_AAI1_IP_ADDR}    localhost
+${GLOBAL_AAI_SERVER_PORT}    9900
+${GLOBAL_AAI_USERNAME}    test
+${GLOBAL_AAI_PASSWORD}    test
+${GLOBAL_INJECTED_OPENSTACK_TENANT_ID}    test
+${GLOBAL_INJECTED_OPENSTACK_USERNAME}    test
+${GLOBAL_INJECTED_OPENSTACK_PASSWORD}    test
+${GLOBAL_INJECTED_KEYSTONE}    test
+${GLOBAL_PACKET_GENERATOR_PORT}     test
+${GLOBAL_PACKET_GENERATOR_USERNAME}       test
+${GLOBAL_PACKET_GENERATOR_PASSWORD}     test
+${GLOBAL_SERVICE_TEMPLATE_MAPPING}    test
+${GLOBAL_DNS_TRAFFIC_DURATION}    test
+${GLOBAL_INJECTED_NETWORK}    test
+${GLOBAL_SO_SERVER_PROTOCOL}    http
+${GLOBAL_INJECTED_SO_IP_ADDR}    localhost
+${GLOBAL_SO_SERVER_PORT}    8080
+${GLOBAL_SO_ASDC_PORT}    8085
+${GLOBAL_SO_CATALOG_PORT}    8082
+${GLOBAL_SO_CAMUNDA_PORT}    8081
+${GLOBAL_SO_SIMULATOR_PORT}    10000
+${resourceLocation}    /app/csar/
+${GLOBAL_SO_CATDB_API_URI}    aaaa
+
+${GLOBAL_INJECTED_PROPERTIES}    None
+${GLOBAL_INJECTED_ARTIFACTS_VERSION}    None
+${GLOBAL_INJECTED_PUBLIC_NET_ID}    None
+${GLOBAL_INJECTED_CLOUD_ENV}    None
+${GLOBAL_INJECTED_SCRIPT_VERSION}    None
+${GLOBAL_INJECTED_VM_IMAGE_NAME}    None
+${GLOBAL_INJECTED_VM_FLAVOR}    None
+${GLOBAL_PRELOAD_PARAMETERS}    None
+
+${GLOBAL_SDNGC_USERNAME}    admin
+${GLOBAL_SDNGC_PASSWORD}    admin
+${GLOBAL_SDNGC_SERVER_PROTOCOL}    https
+#${GLOBAL_INJECTED_SDNC_IP_ADDR}    
+${GLOBAL_INJECTED_SDNC_IP_ADDR}    aaaa
+${GLOBAL_SDNGC_REST_PORT}    8443
+${GLOBAL_SDNGC_ADMIN_PORT}    8443
\ No newline at end of file
diff --git a/tests/so/orchestration/resources/json_templater.robot b/tests/so/orchestration/resources/json_templater.robot
new file mode 100644 (file)
index 0000000..0dd88b9
--- /dev/null
@@ -0,0 +1,42 @@
+*** Settings ***
+Documentation     This resource is filling out json string templates and returning the json back
+Library              RequestsLibrary
+Library           StringTemplater
+Library           OperatingSystem
+Library           CSVLibrary
+Library           Collections
+Resource          global_properties.robot
+
+*** Keywords ***
+Fill JSON Template
+    [Documentation]    Runs substitution on template to return a filled in json
+    [Arguments]    ${json}    ${arguments}
+    ${returned_string}=    Template String    ${json}    ${arguments}
+    Log    ${returned_string}
+    ${returned_json}=  To Json    ${returned_string}
+    [Return]    ${returned_json}
+
+Fill JSON Template File
+    [Documentation]    Runs substitution on template to return a filled in json
+    [Arguments]    ${json_file}    ${arguments}
+    ${json}=    OperatingSystem.Get File    ${json_file}
+    ${returned_json}=  Fill JSON Template    ${json}    ${arguments}
+    [Return]    ${returned_json}
+    
+Read CSV Data And Create Dictionary
+    [Documentation]    Read CSV Data And Create Dictionary
+    [Arguments]        ${file}
+
+     ${status}    Run Keyword And Return Status    Variable Should Exist    ${file}
+     ${csv_file} =     set variable if  ${status}==True    ${file}
+     LOG    ${csv_file}
+     ${dictionary}    Create Dictionary
+     ${dictionary_list}    read csv file to associative  ${csv_file}
+
+     ${dict_count}    Get Length    ${dictionary_list}
+     : FOR    ${row_num}    IN RANGE    0    ${dict_count}
+     \    Log    ${dictionary_list[${row_num}]}
+     \    ${dict_key}    Get From Dictionary    ${dictionary_list[${row_num}]}    uniqueKey
+     \    Set To Dictionary    ${dictionary}    ${dict_key}    ${dictionary_list[${row_num}]}
+
+     [Return]    ${dictionary}
\ No newline at end of file
diff --git a/tests/so/orchestration/resources/properties/cloudRegion.robot b/tests/so/orchestration/resources/properties/cloudRegion.robot
new file mode 100644 (file)
index 0000000..b38f428
--- /dev/null
@@ -0,0 +1,13 @@
+*** Settings ***
+Documentation        Properties for CloudRegion
+
+
+*** Variables ***
+${cloudOwner}    CloudOwner
+${cloudRegionId}    regionOne
+${cloudType}    openstack
+${ownerDefinedType}    LCP
+${cloudRegionVersion}    3.0.3
+${cloudZone}    TEST1
+${complexName}    regionOne
+${sriovAutomation}    false
\ No newline at end of file
diff --git a/tests/so/orchestration/resources/properties/tenant.robot b/tests/so/orchestration/resources/properties/tenant.robot
new file mode 100644 (file)
index 0000000..2e1ae75
--- /dev/null
@@ -0,0 +1,7 @@
+*** Settings ***
+Documentation        Properties for Tenant
+
+
+*** Variables ***
+${aai_tenant_Id}    0422ffb57ba042c0800a29dc85ca70f8
+${aai_tenant_Name}    tenantName
\ No newline at end of file
diff --git a/tests/so/orchestration/resources/so_interface.robot b/tests/so/orchestration/resources/so_interface.robot
new file mode 100644 (file)
index 0000000..6db22bf
--- /dev/null
@@ -0,0 +1,76 @@
+*** Settings ***
+Documentation     The main interface for interacting with SO. It handles low level stuff like managing the http request library and SO required fields
+Library              RequestsLibrary
+Library                  UUID
+Library           OperatingSystem
+Library           Collections
+Library           HTTPUtils
+Resource          global_properties.robot
+Resource          json_templater.robot
+*** Variables ***
+${SO_ENDPOINT}     ${GLOBAL_SO_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SO_IP_ADDR}:${GLOBAL_SO_SERVER_PORT}
+${CATALOG_DB_ENDPOINT}   ${GLOBAL_SO_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SO_IP_ADDR}:${GLOBAL_SO_CATALOG_PORT}
+${CAMUNDA_DB_ENDPOINT}    ${GLOBAL_SO_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SO_IP_ADDR}:${GLOBAL_SO_CAMUNDA_PORT}
+${SIMULATOR_ENDPOINT}    ${GLOBAL_SO_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SO_IP_ADDR}:${GLOBAL_SO_SIMULATOR_PORT}
+
+*** Keywords ***
+  
+Run SO Get Request
+    [Documentation]    Runs an SO get request
+    [Arguments]    ${full_path}    ${accept}=application/json    ${endPoint}=${SO_ENDPOINT}
+    Disable Warnings
+    Log    Creating session ${SO_ENDPOINT}
+    ${session}=    Create Session      so      ${SO_ENDPOINT}
+    ${uuid}=    Generate UUID
+    ${uuidstring}=    Convert To String    ${uuid}
+    &{headers}=  Create Dictionary    Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==    Content-Type=application/json    Accept=application/json
+    ${resp}=   Get Request     so      ${full_path}     headers=${headers}
+    Log    Received response from so ${resp.text}
+    [Return]    ${resp}
+
+Poll SO Get Request
+    [Documentation]    Runs an SO get request until a certain status is received. valid values are COMPLETE
+    [Arguments]    ${data_path}     ${status}
+    Disable Warnings
+    Log    Creating session ${SO_ENDPOINT}
+    ${session}=    Create Session      so      ${SO_ENDPOINT}
+    ${uuid}=    Generate UUID
+    ${uuidstring}=    Convert To String    ${uuid}
+    &{headers}=  Create Dictionary    Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==    Content-Type=application/json    Accept=application/json
+    #do this until it is done
+    :FOR    ${i}    IN RANGE    20
+    \    ${resp}=      Get Request     so      ${data_path}     headers=${headers}
+    \    Should Not Contain    ${resp.text}    FAILED
+    \    Log    ${resp.json()['request']['requestStatus']['requestState']}
+    \    ${exit_loop}=    Evaluate    "${resp.json()['request']['requestStatus']['requestState']}" == "${status}"
+    \    Exit For Loop If  ${exit_loop}
+    \    Sleep    15s
+    Log    Received response from so ${resp.text}
+    [Return]    ${resp}
+
+Run SO Post request
+    [Documentation]    Runs an SO post request
+    [Arguments]  ${data_path}  ${data}
+    Disable Warnings
+    Log    Creating session ${SO_ENDPOINT}
+    ${session}=    Create Session      so      ${SO_ENDPOINT}
+    ${uuid}=    Generate UUID
+    ${uuidstring}=    Convert To String    ${uuid}
+    &{headers}=  Create Dictionary    Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==    Content-Type=application/json    Accept=application/json
+       ${resp}=        Post Request    so      ${data_path}     data=${data}   headers=${headers}
+       Log    Received response from so ${resp.text}
+       [Return]  ${resp}
+       
+
+Run SO Delete request
+    [Documentation]    Runs an SO Delete request
+    [Arguments]  ${data_path}  ${data}
+    Disable Warnings
+    Log    Creating session ${SO_ENDPOINT}
+    ${session}=    Create Session      so      ${SO_ENDPOINT}
+    ${uuid}=    Generate UUID
+    ${uuidstring}=    Convert To String    ${uuid}
+    &{headers}=  Create Dictionary    Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==    Content-Type=application/json    Accept=application/json
+    ${resp}=    Delete Request    so    ${data_path}    ${data}    headers=${headers}
+    Log    Received response from so ${resp.text}
+    [Return]    ${resp}
diff --git a/tests/so/orchestration/testsuites/bpmn-infra/aLaCarte/Create/ServiceInstantiationTest.robot b/tests/so/orchestration/testsuites/bpmn-infra/aLaCarte/Create/ServiceInstantiationTest.robot
new file mode 100644 (file)
index 0000000..c4edba1
--- /dev/null
@@ -0,0 +1,34 @@
+*** Settings ***
+Documentation    Testing Create Generic ALaCarte Service Instance flow
+Resource    ../../../../resources/bpmn-infra/aLaCarte/Create/ServiceInstance.robot
+Resource    ../../../../resources/common/Variables.robot
+Resource    ../../../../resources/common/SoVariables.robot
+Resource    ../../../../resources/aai/service_instance.robot
+
+*** Variables ***
+${serv_inst_id}    shouldOverWrite
+${create_service_instance_template_file}    ../../../../assets/templates/bpmn-infra/aLaCarte/Create/ServiceInstance.template
+
+*** Settings ***
+*** Test Cases ***
+Create and Delete Service Alacarte GR_API
+    [Tags]    Smoke    Sanity
+    [Setup]   Setup GR Create Service Instance    TC_1
+    log    starting create SI
+    ${serv_inst_id}    ${request_id}    ${request_completion_status}    ${status_code}    ${service_body}    Create Service Instance    TC_1    ${create_service_instance_template_file}
+    Should Be Equal As Strings    ${status_code}    202
+    Should Be Equal As Strings    ${request_completion_status}    COMPLETE
+    log    validating SI
+    Validate Service Instance    Robot_SI    Robot_Test_Service_Type    Robot_Test_Subscriber_ID    Active
+    Validate Owning Entity    c3f57fa8-ac7d-11e8-98d0-529269fb1459    200
+    Validate Project    GR_API_OE_SO_Test200    200
+    
+    log    starting delete SI
+    ${instance_id}    ${delete_si_request_id}    ${request_completion_status}    ${delete_service_response.status_code}    Invoke Delete Service Instance Flow    ${service_body}    ${serv_inst_id}
+    Should Be Equal As Strings    ${delete_service_response.status_code}    202
+    Should Be Equal As Strings    ${request_completion_status}    COMPLETE
+    Validate Service Instance Not Exist By Id    ${serv_inst_id}
+    Validate Owning Entity    c3f57fa8-ac7d-11e8-98d0-529269fb1459    200
+    Validate Project    GR_API_OE_SO_Test200    200
+
+    [Teardown]    Teardown GR Create Service Instance    ${serv_inst_id}
\ No newline at end of file