[CORD-3089] implemented new ONU design model, updated E2E

Change-Id: Ie268e67f5e167552cfb17593e04231d9a0d99a7b
diff --git a/src/test/cord-api/Properties/RestApiProperties.py b/src/test/cord-api/Properties/RestApiProperties.py
index cd0b07d..a06473d 100644
--- a/src/test/cord-api/Properties/RestApiProperties.py
+++ b/src/test/cord-api/Properties/RestApiProperties.py
@@ -16,13 +16,14 @@
 
 #!/usr/bin/env python
 
-SERVER_IP = '10.128.22.7'
+SERVER_IP = ''
 SERVER_PORT = '30006'
 XOS_USER = 'admin@opencord.org'
-XOS_PASSWD = 'letmein'
-VOLT_SUBSCRIBER = '/xosapi/v1/rcord/cordsubscriberroots'
+XOS_PASSWD = ''
+VOLT_SUBSCRIBER = '/xosapi/v1/rcord/rcordsubscribers'
 VOLT_TENANT = '/xosapi/v1/volt/voltserviceinstances'
 VOLT_DEVICE = '/xosapi/v1/volt/oltdevices'
+ONU_DEVICE = '/xosapi/v1/volt/onudevices'
 VOLT_SERVICE = '/xosapi/v1/volt/voltservices'
 PON_PORT = '/xosapi/v1/volt/ponports'
 CH_CORE_SERVICELINK = '/xosapi/v1/core/serviceinstancelinks'
diff --git a/src/test/cord-api/Tests/RCORDLite_E2ETest.txt b/src/test/cord-api/Tests/RCORDLite_E2ETest.txt
index bcbfbf2..057aeee 100644
--- a/src/test/cord-api/Tests/RCORDLite_E2ETest.txt
+++ b/src/test/cord-api/Tests/RCORDLite_E2ETest.txt
@@ -1,7 +1,7 @@
 *** 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
+Test Template     Service Chain Validation For Subscriber
 Library           Collections
 Library           String
 Library           OperatingSystem
@@ -14,11 +14,11 @@
 ${PATHFILE}       ${CURDIR}/data/RCORDLite_Subscriber.json
 
 *** Test Cases ***    TYPE                 LISTINDEX
-#Test Create Subscriber-1
-#                      SUBSCRIBER_CREATE    0
+Test Create Subscriber-1
+                      SUBSCRIBER_CREATE    0
 
-#Test Create Subscriber-2
-#                      SUBSCRIBER_CREATE    1
+Test Create Subscriber-2
+                      SUBSCRIBER_CREATE    1
 
 Test Create Subscriber-3
                       SUBSCRIBER_CREATE    2
@@ -30,7 +30,7 @@
     @{instanceList}=    Create List
     Set Suite Variable    @{instanceList}
 
-Verify Service Chain Validation for Subscribers
+Service Chain Validation For Subscriber
     [Arguments]    ${type}    ${listIndex}
     Run Keyword If    "${type}" == "SUBSCRIBER_CREATE"    Test Post Subscriber Create    ${listIndex}
 
diff --git a/src/test/cord-api/Tests/VOLTDevice_Test.txt b/src/test/cord-api/Tests/VOLTDevice_Test.txt
index 1bbf672..75444a8 100644
--- a/src/test/cord-api/Tests/VOLTDevice_Test.txt
+++ b/src/test/cord-api/Tests/VOLTDevice_Test.txt
@@ -13,6 +13,7 @@
 *** Variables ***
 ${PATHFILE}       ${CURDIR}/data/VOLTDevice.json
 ${PATHFILE1}      ${CURDIR}/data/PONPort.json
+${PATHFILE2}      ${CURDIR}/data/ONUDevice.json
 
 *** Test Cases ***    TYPE                         LISTINDEX
 Test Create VOLTDevice-1
@@ -21,9 +22,12 @@
                       RETRIEVE                     0
 Test Create PONPort-1
                       PONCREATE                       0
-
 Test Get PONPort-1
                       PONRETRIEVE                     0
+Test Create ONUDevice-1
+                      ONUCREATE                       0
+Test Get ONUDevice-1
+                      ONURETRIEVE                     0
 Test Create VOLTDevice-2
                       CREATE       1
 Test Get VOLTDevice-2
@@ -32,6 +36,10 @@
                       PONCREATE       1
 Test Get PONPort-2
                       PONRETRIEVE     1
+Test Create ONUDevice-2
+                      ONUCREATE                       1
+Test Get ONUDevice-2
+                      ONURETRIEVE                     1
 Test Create VOLTDevice-3
                       CREATE       2
 Test Get VOLTDevice-3
@@ -40,6 +48,10 @@
                       PONCREATE       2
 Test Get PONPort-3
                       PONRETRIEVE     2
+Test Create ONUDevice-3
+                      ONUCREATE                       2
+Test Get ONUDevice-3
+                      ONURETRIEVE                     2
 
 
 *** Keywords ***
@@ -50,6 +62,9 @@
     ${PONPortList}=    utils.jsonToList    ${PATHFILE1}    PONPortInfo
     Set Suite Variable    ${plist}    ${PONPortList}
     Set Suite Variable    ${PONPort_Id}    ${EMPTY}
+    ${ONUDeviceList}=    utils.jsonToList    ${PATHFILE2}    ONUDeviceInfo
+    Set Suite Variable    ${nlist}    ${ONUDeviceList}
+    Set Suite Variable    ${ONUDevice_Id}    ${EMPTY}
 
 Verify VOLTDevice functionality
     [Arguments]    ${type}    ${listIndex}
@@ -58,6 +73,8 @@
     Run Keyword If    "${type}" == "DELETE"    Test Delete VOLT Device API    ${listIndex}
     Run Keyword If    "${type}" == "PONCREATE"    Test Post PONPort API    ${listIndex}
     Run Keyword If    "${type}" == "PONRETRIEVE"    Test Get PONPort API    ${listIndex}
+    Run Keyword If    "${type}" == "ONUCREATE"    Test Post ONUDevice API    ${listIndex}
+    Run Keyword If    "${type}" == "ONURETRIEVE"    Test Get ONUDevice API    ${listIndex}
 
 Test Post VOLT Device API
     [Arguments]    ${listIndex}
@@ -106,6 +123,27 @@
     ${test_result}=    utils.compare_dict    ${PONPortDict}    ${json_result}
     Should Be True    ${test_result}
 
+Test Post ONUDevice API
+    [Arguments]    ${listIndex}
+    ${ONUDeviceList}=    Get Variable Value    ${nlist}
+    ${ONUDeviceDict}=    utils.listToDict    ${ONUDeviceList}    ${listIndex}
+    ${ONUDeviceDict}=    utils.setFieldValueInDict    ${ONUDeviceDict}    pon_port_id    ${PONPort_Id}
+    ${api_result_status}    ${api_result_json}=    restApi.ApiPostReturnJson    ONU_DEVICE    ${ONUDeviceDict}
+    Should Be True    ${api_result_status}
+    ${ONUDevice_Id}=    Get From Dictionary    ${api_result_json}    id
+    Set Global Variable    ${ONUDevice_Id}
+
+Test Get ONUDevice API
+    [Arguments]    ${listIndex}
+    Log    ${ONUDevice_Id}
+    ${json_result}=    restApi.ApiChameleonGet    ONU_DEVICE    ${ONUDevice_Id}
+    Log    ${json_result}
+    ${ONUDeviceList} =    Get Variable Value    ${nlist}
+    ${ONUDeviceDict}=    utils.listToDict    ${ONUDeviceList}    ${listIndex}
+    Log    ${ONUDeviceDict}
+    ${test_result}=    utils.compare_dict    ${ONUDeviceDict}    ${json_result}
+    Should Be True    ${test_result}
+
 Test Delete VOLT Device API
     [Arguments]    ${listIndex}
     ${test_result}=    restApi.ApiChameleonDelete    VOLT_DEVICE    ${VOLTDevice_Id}
diff --git a/src/test/cord-api/Tests/data/ONUDevice.json b/src/test/cord-api/Tests/data/ONUDevice.json
new file mode 100644
index 0000000..398d5cc
--- /dev/null
+++ b/src/test/cord-api/Tests/data/ONUDevice.json
@@ -0,0 +1,22 @@
+{
+    "ONUDeviceInfo" : [
+    {
+            "pon_port_id": 1,
+            "serial_number": "ONUSerialNumber1",
+            "vendor": "Vendor5",
+            "device_type": "asfvolt16_olt"
+    },
+    {
+            "pon_port_id": 1,
+            "serial_number": "ONUSerialNumber2",
+            "vendor": "Vendor5",
+            "device_type": "asfvolt16_olt"
+    },
+    {
+            "pon_port_id": 1,
+            "serial_number": "ONUSerialNumber3",
+            "vendor": "Vendor5",
+            "device_type": "asfvolt16_olt"
+    }
+  ]
+}
diff --git a/src/test/cord-api/Tests/data/RCORDLite_Subscriber.json b/src/test/cord-api/Tests/data/RCORDLite_Subscriber.json
index 76b0881..14d777a 100644
--- a/src/test/cord-api/Tests/data/RCORDLite_Subscriber.json
+++ b/src/test/cord-api/Tests/data/RCORDLite_Subscriber.json
@@ -9,8 +9,7 @@
             "service_specific_id": "304",
             "name": "My House-304",
             "c_tag": 888,
-            "olt_device": "volt-1",
-            "olt_port": "volt-port-1"
+            "onu_device": "ONUSerialNumber1"
     },
     {
             "cdn_enable": false,
@@ -21,10 +20,9 @@
             "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"
+            "ip_address" : "10.8.1.1",
+            "onu_device": "ONUSerialNumber2"
     },
     {
             "cdn_enable": true,
@@ -32,8 +30,7 @@
             "service_specific_id": "306",
             "name": "My House-306",
             "c_tag": 661,
-            "olt_device": "volt-3",
-            "olt_port": "volt-port-3"
+            "onu_device": "ONUSerialNumber3"
     }
   ]
 }