[CORD-3029] XOS end-end RCORD_lite tests

Change-Id: Ibe050b0885114e9185eaba35913c084ff55c5205
diff --git a/src/test/cord-api/Properties/RestApiProperties.py b/src/test/cord-api/Properties/RestApiProperties.py
index d3d4606..cd0b07d 100644
--- a/src/test/cord-api/Properties/RestApiProperties.py
+++ b/src/test/cord-api/Properties/RestApiProperties.py
@@ -16,10 +16,10 @@
 
 #!/usr/bin/env python
 
-SERVER_IP = 'ms1343.utah.cloudlab.us'
-SERVER_PORT = '8080'
-XOS_USER = 'xosadmin@opencord.org'
-XOS_PASSWD = 'TbVle45watOPMeB1q93N'
+SERVER_IP = '10.128.22.7'
+SERVER_PORT = '30006'
+XOS_USER = 'admin@opencord.org'
+XOS_PASSWD = 'letmein'
 VOLT_SUBSCRIBER = '/xosapi/v1/rcord/cordsubscriberroots'
 VOLT_TENANT = '/xosapi/v1/volt/voltserviceinstances'
 VOLT_DEVICE = '/xosapi/v1/volt/oltdevices'
@@ -60,3 +60,4 @@
 CH_CORE_SITEDEPLOYMENTS = '/xosapi/v1/core/sitedeployments'
 CH_CORE_NETWORK_TEMPLATES = '/xosapi/v1/core/networktemplates'
 VSG_TENANT = '/xosapi/v1/vsg/vsgserviceinstances'
+HWVSG_TENANT = '/xosapi/v1/vsg-hw/vsghwserviceinstances'
diff --git a/src/test/cord-api/Tests/RCORDLite_E2ETest.txt b/src/test/cord-api/Tests/RCORDLite_E2ETest.txt
new file mode 100644
index 0000000..bcbfbf2
--- /dev/null
+++ b/src/test/cord-api/Tests/RCORDLite_E2ETest.txt
@@ -0,0 +1,68 @@
+*** Settings ***
+Documentation     Test suite for end-end service chain validation for RCORD Lite Profile (without hardware vSG instances)
+Suite Setup       Read InputFile
+Test Template     Verify Service Chain Validation for Subscriber
+Library           Collections
+Library           String
+Library           OperatingSystem
+Library           XML
+Library           RequestsLibrary
+Library           ../Framework/utils/utils.py
+Library           ../Framework/restApi.py
+
+*** Variables ***
+${PATHFILE}       ${CURDIR}/data/RCORDLite_Subscriber.json
+
+*** Test Cases ***    TYPE                 LISTINDEX
+#Test Create Subscriber-1
+#                      SUBSCRIBER_CREATE    0
+
+#Test Create Subscriber-2
+#                      SUBSCRIBER_CREATE    1
+
+Test Create Subscriber-3
+                      SUBSCRIBER_CREATE    2
+
+*** Keywords ***
+Read InputFile
+    ${subscriberList} =    utils.jsonToList    ${PATHFILE}    SubscriberInfo
+    Set Suite Variable    ${slist}    ${subscriberList}
+    @{instanceList}=    Create List
+    Set Suite Variable    @{instanceList}
+
+Verify Service Chain Validation for Subscribers
+    [Arguments]    ${type}    ${listIndex}
+    Run Keyword If    "${type}" == "SUBSCRIBER_CREATE"    Test Post Subscriber Create    ${listIndex}
+
+Test Post Subscriber Create
+    [Arguments]    ${listIndex}
+    ${subscriberList} =    Get Variable Value    ${slist}
+    ${subscriberDict}=    utils.listToDict    ${subscriberList}    ${listIndex}
+    ${api_result}=    restApi.ApiPost    VOLT_SUBSCRIBER    ${subscriberDict}
+    Sleep    90
+    ${service_specific_id}=    utils.getFieldValueFromDict    ${subscriberDict}    service_specific_id
+    ${json_result}=    restApi.ApiGet    VOLT_SUBSCRIBER
+    Log    ${json_result}
+    ${json_result_list}=    Get From Dictionary    ${json_result}    items
+    ${getJsonDict}=    utils.getDictFromListOfDict    ${json_result_list}    service_specific_id    ${service_specific_id}
+    ${result}=    utils.compare_dict    ${subscriberDict}    ${getJsonDict}
+    Should Be True    ${result}
+    ${instanceList}    Create List
+    # Retrieve Subscribed_links_id from Posted Subscriber
+    ${subscribed_links_ids_list}=    utils.getFieldValueFromDict    ${getJsonDict}    subscribed_links_ids
+    ${subscribed_links_ids}=    Get From List    ${subscribed_links_ids_list}    0
+    # Retrieve Provided_Service_Instance_Id from "ServiceInstanceLinks"
+    ${getServiceLink}=    restApi.ApiChameleonGet    CH_CORE_SERVICELINK    ${subscribed_links_ids}
+    ${provider_service_instance_id}=    Get From Dictionary    ${getServiceLink}    provider_service_instance_id
+    # RETRIEVE VOLT OBJECT USING PROVIDER INSTANCE ID   
+    ${getVoltDict}=    restApi.ApiChameleonGet    VOLT_TENANT    ${provider_service_instance_id}
+    # RETRIEVE SUBSCRIBED_LINKS_IDS FROM THE VOLT DICTIONARY
+    ${subscribed_links_ids_list}=    utils.getFieldValueFromDict    ${getVoltDict}    subscribed_links_ids
+    ${subscribed_links_ids}=    Get From List    ${subscribed_links_ids_list}    0
+    # RETRIEVE PROVIDED_SERVICE_INSTANCE_ID 
+    ${serviceLinkDict}=    restApi.ApiChameleonGet    CH_CORE_SERVICELINK    ${subscribed_links_ids}
+    Log    ${serviceLinkDict}
+    ${VSGTenant}=    Get From Dictionary    ${serviceLinkDict}    provider_service_instance_id
+    # Retrieve VSGTenant to retrieve instance_id
+    ${getVSG_result}=    restApi.ApiChameleonGet    HWVSG_TENANT    ${VSGTenant}
+    Should Be True    ${getVSG_result}
diff --git a/src/test/cord-api/Tests/data/PONPort.json b/src/test/cord-api/Tests/data/PONPort.json
index da28e42..f40c058 100644
--- a/src/test/cord-api/Tests/data/PONPort.json
+++ b/src/test/cord-api/Tests/data/PONPort.json
@@ -3,17 +3,20 @@
     {
             "name": "volt-port-1",
             "s_tag": 222,
-            "olt_device_id": 1
+            "olt_device_id": 1,
+            "port_id" : "of:0000000000000002/1"
     },
     {
             "name": "volt-port-2",
             "s_tag": 444,
-            "olt_device_id": 1
+            "olt_device_id": 1,
+            "port_id" : "of:0000000000000001/2"
     },
     {
             "name": "volt-port-3",
             "s_tag": 333,
-            "olt_device_id": 1
+            "olt_device_id": 1,
+            "port_id" : "of:0000000000000001/1"
     }
   ]
 }
diff --git a/src/test/cord-api/Tests/data/RCORDLite_Subscriber.json b/src/test/cord-api/Tests/data/RCORDLite_Subscriber.json
new file mode 100644
index 0000000..76b0881
--- /dev/null
+++ b/src/test/cord-api/Tests/data/RCORDLite_Subscriber.json
@@ -0,0 +1,39 @@
+{
+    "SubscriberInfo" : [
+    {
+            "cdn_enable": true,
+            "uplink_speed": 1000000000,
+            "downlink_speed": 1000000000,
+            "enable_uverse": true,
+            "status": "enabled",
+            "service_specific_id": "304",
+            "name": "My House-304",
+            "c_tag": 888,
+            "olt_device": "volt-1",
+            "olt_port": "volt-port-1"
+    },
+    {
+            "cdn_enable": false,
+            "uplink_speed": 500000000,
+            "downlink_speed": 500000000,
+            "enable_uverse": false,
+            "status": "enabled",
+            "service_specific_id": "305",
+            "name": "My House-305",
+            "c_tag": 999,
+            "olt_device": "volt-2",
+            "olt_port": "volt-port-2",
+            "mac_address" : "00:AA:00:00:00:01",
+            "ip_address" : "10.8.1.1"
+    },
+    {
+            "cdn_enable": true,
+            "uplink_speed": 500000000,
+            "service_specific_id": "306",
+            "name": "My House-306",
+            "c_tag": 661,
+            "olt_device": "volt-3",
+            "olt_port": "volt-port-3"
+    }
+  ]
+}