[SEBA-238] WIP test structural changes
Change-Id: I2504222beffe23d2d930c7cad138c584b1ded84f
diff --git a/src/test/cord-api/Tests/AttWhiteList.txt b/src/test/cord-api/Tests/WorkflowValidations/ATTWhiteList.txt
similarity index 97%
rename from src/test/cord-api/Tests/AttWhiteList.txt
rename to src/test/cord-api/Tests/WorkflowValidations/ATTWhiteList.txt
index 19f305e..d550439 100644
--- a/src/test/cord-api/Tests/AttWhiteList.txt
+++ b/src/test/cord-api/Tests/WorkflowValidations/ATTWhiteList.txt
@@ -11,7 +11,7 @@
Library ../Framework/restApi.py
*** Variables ***
-${PATHFILE} ${CURDIR}/data/AttWhiteList.json
+${PATHFILE} ${CURDIR}/data/ATTWhiteList.json
*** Test Cases *** TYPE LISTINDEX
Test Create ONUWhiteList-1
diff --git a/src/test/cord-api/Tests/AttWorkFlowDriver.txt b/src/test/cord-api/Tests/WorkflowValidations/ATTWorkFlowDriver.txt
similarity index 96%
rename from src/test/cord-api/Tests/AttWorkFlowDriver.txt
rename to src/test/cord-api/Tests/WorkflowValidations/ATTWorkFlowDriver.txt
index c0ac9c0..f09ddd5 100644
--- a/src/test/cord-api/Tests/AttWorkFlowDriver.txt
+++ b/src/test/cord-api/Tests/WorkflowValidations/ATTWorkFlowDriver.txt
@@ -11,7 +11,7 @@
Library ../Framework/restApi.py
*** Variables ***
-${PATHFILE} ${CURDIR}/data/AttWorkFlowDriver.json
+${PATHFILE} ${CURDIR}/data/ATTWorkFlowDriver.json
*** Test Cases *** TYPE LISTINDEX
Test Create AttWorkFlow-1
diff --git a/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.txt b/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.txt
new file mode 100644
index 0000000..3240c5c
--- /dev/null
+++ b/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.txt
@@ -0,0 +1,102 @@
+*** Settings ***
+Documentation Test to Configure White List
+Suite Setup Read InputFile
+Test Template Configuring White List
+Library Collections
+Library String
+Library OperatingSystem
+Library XML
+Library RequestsLibrary
+Library ../Framework/utils/utils.py
+Library ../Framework/restApi.py
+
+*** Variables ***
+${PATHFILE} ${CURDIR}/data/ATTWhiteList.json
+
+*** Test Cases *** TYPE LISTINDEX
+Test Create ONUWhiteList-1
+ CREATE 0
+Test Get ONUWhiteList-1
+ RETRIEVE 0
+Test Service Instance States
+ STATUS_CHECK 0
+Test ONU States
+ ONU_STATUS 0
+
+*** Keywords ***
+Read InputFile
+ ${AttWhiteListList}= utils.jsonToList ${PATHFILE} AttWhiteListInfo
+ Set Suite Variable ${slist} ${AttWhiteListList}
+ ${AttWhiteListList} = Get Variable Value ${slist}
+ ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
+ ${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number
+ Log ${onu_device}
+ Set Global Variable ${AttWorkFlowDriver_Id} ${EMPTY}
+ Set Global Variable ${AttWhiteList_Id} ${EMPTY}
+ Set Global Variable ${onu_device} ALPHe3d1cfa7
+ Set Global Variable ${AttServiceInstance_Id} ${EMPTY}
+ Set Global Variable ${authentication_status} ${EMPTY}
+
+
+Configuring White List
+ [Arguments] ${type} ${listIndex}
+ Run Keyword If "${type}" == "CREATE" Post White List ${listIndex}
+ Run Keyword If "${type}" == "RETRIEVE" Get White List ${listIndex}
+ Run Keyword If "${type}" == "STATUS_CHECK" Service Instance Status Check ${listIndex}
+ Run Keyword If "${type}" == "ONU_STATUS" ONU Status Check ${listIndex}
+
+Post White List
+ [Arguments] ${listIndex}
+ ${AttWhiteListList} = Get Variable Value ${slist}
+ ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} ${listIndex}
+ ${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number
+ Log ${onu_device}
+ # Retrieve ATT Service Driver Id
+ ${api_getResult}= restApi.ApiGet ATT_SERVICE
+ ${AttWorkFlowDriverList}= Get From Dictionary ${api_getResult} items
+ ${AttWorkFlowDriverDict}= utils.getDictFromListOfDict ${AttWorkFlowDriverList} leaf_model_name AttWorkflowDriverService
+ ${AttWorkFlowDriver_Id}= Get From Dictionary ${AttWorkFlowDriverDict} id
+ ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${AttWorkFlowDriver_Id}
+ Log ${AttWhiteListDict}
+ ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson ATT_WHITELIST ${AttWhiteListDict}
+ Should Be True ${api_result_status}
+ ${AttWhiteList_Id}= Get From Dictionary ${api_result_json} id
+ Set Global Variable ${AttWhiteList_Id}
+ Set Global Variable ${onu_device}
+
+Get White List
+ [Arguments] ${listIndex}
+ Log ${AttWhiteList_Id}
+ ${json_result}= restApi.ApiChameleonGet ATT_WHITELIST ${AttWhiteList_Id}
+ Log ${json_result}
+ ${AttWhiteListList} = Get Variable Value ${slist}
+ ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} ${listIndex}
+ Log ${AttWhiteListDict}
+ ${test_result}= utils.compare_dict ${AttWhiteListDict} ${json_result}
+ Should Be True ${test_result}
+
+Service Instance Status Check
+ [Arguments] ${listIndex}
+ Set Global Variable ${AttServiceInstance_Id} ${EMPTY}
+ Log ${AttServiceInstance_Id}
+ ${json_result}= restApi.ApiGet ATT_SERVICEINSTANTCES
+ Log ${json_result}
+ ${json_result_list}= Get From dictionary ${json_result} items
+ ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} serial_number ${onu_device}
+ ${status}= Get From Dictionary ${getJsonDict} valid
+ ${authentication_status}= Get From Dictionary ${getJsonDict} authentication_state
+ ${AttServiceInstance_Id}= Get From Dictionary ${getJsonDict} id
+ Set Global Variable ${AttServiceInstance_Id}
+ Should Be Equal ${status} valid
+ Should Be Equal ${authentication_status} AWAITING
+
+ONU Status Check
+ [Arguments] ${listIndex}
+ ${json_result}= restApi.ApiGet ONU_DEVICE
+ Log ${json_result}
+ ${json_result_list}= Get From dictionary ${json_result} items
+ ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} serial_number ${onu_device}
+ ${operational_status}= Get From Dictionary ${getJsonDict} oper_status
+ ${admin_status}= Get From Dictionary ${getJsonDict} admin_state
+ Should Be Equal ${operational_status} ACTIVE
+ Should Be Equal ${admin_status} ENABLED
diff --git a/src/test/cord-api/Tests/BNGPortMapping.txt b/src/test/cord-api/Tests/WorkflowValidations/BNGPortMapping.txt
similarity index 100%
rename from src/test/cord-api/Tests/BNGPortMapping.txt
rename to src/test/cord-api/Tests/WorkflowValidations/BNGPortMapping.txt
diff --git a/src/test/cord-api/Tests/data/Subscriber_Att.json b/src/test/cord-api/Tests/WorkflowValidations/data/ATTSubscriber.json
similarity index 100%
rename from src/test/cord-api/Tests/data/Subscriber_Att.json
rename to src/test/cord-api/Tests/WorkflowValidations/data/ATTSubscriber.json
diff --git a/src/test/cord-api/Tests/data/AttWhiteList.json b/src/test/cord-api/Tests/WorkflowValidations/data/ATTWhiteList.json
similarity index 100%
rename from src/test/cord-api/Tests/data/AttWhiteList.json
rename to src/test/cord-api/Tests/WorkflowValidations/data/ATTWhiteList.json
diff --git a/src/test/cord-api/Tests/data/AttWorkFlowDriver.json b/src/test/cord-api/Tests/WorkflowValidations/data/ATTWorkFlowDriver.json
similarity index 100%
rename from src/test/cord-api/Tests/data/AttWorkFlowDriver.json
rename to src/test/cord-api/Tests/WorkflowValidations/data/ATTWorkFlowDriver.json
diff --git a/src/test/cord-api/Tests/data/BNGPortMapping.json b/src/test/cord-api/Tests/WorkflowValidations/data/BNGPortMapping.json
similarity index 100%
rename from src/test/cord-api/Tests/data/BNGPortMapping.json
rename to src/test/cord-api/Tests/WorkflowValidations/data/BNGPortMapping.json