[CORD-2371] WIP: M-CORD tests
Change-Id: I9dcb8055b5204a6f880d98d0d6c9504410fcdfb3
diff --git a/src/test/cord-api/MCORD-Tests/EPCInstanceTest.txt b/src/test/cord-api/MCORD-Tests/EPCInstanceTest.txt
new file mode 100644
index 0000000..218e32b
--- /dev/null
+++ b/src/test/cord-api/MCORD-Tests/EPCInstanceTest.txt
@@ -0,0 +1,62 @@
+*** Settings ***
+Documentation Test suite for EPC Creation
+Suite Setup Read InputFile
+Test Template Verify EPC Instance Functionality
+Library Collections
+Library String
+Library OperatingSystem
+Library XML
+Library RequestsLibrary
+Library ../Framework/utils/utils.py
+Library ../Framework/restApi.py
+
+*** Variables ***
+${USER} admin
+${PASSWORD} admin
+${PATHFILE} ${CURDIR}/data/EPCInstance.json
+
+*** Test Cases *** TYPE LISTINDEX
+Test Create EPC EPC_CREATE 0
+
+Test Instance creation validation
+ INSTANCE_VALIDATE 0
+
+*** Keywords ***
+Read InputFile
+ ${subscriberList} = utils.jsonToList ${PATHFILE} EPCInfo
+ Set Suite Variable ${slist} ${subscriberList}
+ @{instanceList}= Create List
+ Set Suite Variable @{instanceList}
+
+Verify Single Instance functionality
+ [Arguments] ${type} ${listIndex}
+ Run Keyword If "${type}" == "EPC_CREATE" Test Post EPC Create ${listIndex}
+ Run Keyword If "${type}" == "INSTANCE_VALIDATE" Test Instance Validation ${listIndex}
+
+Test Post EPC Create
+ [Arguments] ${listIndex}
+ ${EPCList} = Get Variable Value ${elist}
+ ${InputDict}= utils.listToDict ${EPCList} ${listIndex}
+ ${api_result}= restApi.ApiPost EPC_INSTANCES ${InputDict}
+ ${service_specific_id}= utils.getFieldValueFromDict ${InputDict} site_id
+ ${json_result}= restApi.ApiGet EPC_INSTANCES
+ Log ${json_result}
+ ${json_result_list}= Get From Dictionary ${json_result} items
+ ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} site_id ${site_id}
+ ${result}= utils.compare_dict ${InputDict} ${getJsonDict}
+ Should Be True ${result}
+ ${instanceList} Create List
+
+Test Instance Validation
+ [Arguments] ${listIndex}
+ ${get_result}= restApi.ApiGet CORE_INSTANCES
+ Should Be True ${get_result}
+ ${get_result_List}= Get From Dictionary ${get_result} items
+ ${instanceFinalList}= Remove Duplicates ${instanceList}
+ Log ${instanceFinalList}
+ ${instanceCount}= Get Length ${instanceFinalList}
+ Log ${instanceCount}
+ Should Be True ${instanceCount} == 1
+ ${instance_id}= Get From List ${instanceFinalList} 0
+ ${get_CoreInstanceresult}= restApi.ApiChameleonGet CORE_INSTANCES ${instance_id}
+ Should Be True ${get_CoreInstanceresult}
diff --git a/src/test/cord-api/MCORD-Tests/data/EPCInstance.json b/src/test/cord-api/MCORD-Tests/data/EPCInstance.json
new file mode 100644
index 0000000..3151d45
--- /dev/null
+++ b/src/test/cord-api/MCORD-Tests/data/EPCInstance.json
@@ -0,0 +1,9 @@
+{
+ "EPCInfo":
+ [
+ {
+ "blueprint": "build",
+ "site_id":"1"
+ }
+ ]
+}
diff --git a/src/test/cord-api/Properties/ECORD_RestApiProperties.py b/src/test/cord-api/Properties/ECORD_RestApiProperties.py
new file mode 100644
index 0000000..b165b5d
--- /dev/null
+++ b/src/test/cord-api/Properties/ECORD_RestApiProperties.py
@@ -0,0 +1,23 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# REST APIs for testing control plane functionalities of ECORD (global and local)
+
+#!/usr/bin/env python
+
+SERVER_IP = 'c220g2-011013.wisc.cloudlab.us'
+SERVER_PORT = '8080'
+USER = 'xosadmin@opencord.org'
+PASSWD = ''
diff --git a/src/test/cord-api/Properties/MCORD_RestApiProperties.py b/src/test/cord-api/Properties/MCORD_RestApiProperties.py
new file mode 100644
index 0000000..de757aa
--- /dev/null
+++ b/src/test/cord-api/Properties/MCORD_RestApiProperties.py
@@ -0,0 +1,25 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# REST APIs for testing control plane functionalities in MCORD
+
+#!/usr/bin/env python
+
+SERVER_IP = 'c220g2-011013.wisc.cloudlab.us'
+SERVER_PORT = '8080'
+USER = 'xosadmin@opencord.org'
+PASSWD = ''
+EPC_INSTANCES = '/xosapi/v1/vepc/vepcserviceinstances'
+CORE_INSTANCES = '/xosapi/v1/core/instances'