Add support for netconf entities 82/37982/6
authorJozef Behran <jbehran@cisco.com>
Thu, 21 Apr 2016 16:12:57 +0000 (18:12 +0200)
committerVratko Polák <vrpolak@cisco.com>
Thu, 16 Jun 2016 11:03:40 +0000 (11:03 +0000)
Change-Id: I6ec8a9fd629c893ae6c5f63cd4b3089584e167db
Signed-off-by: Jozef Behran <jbehran@cisco.com>
csit/libraries/ClusterKeywords.robot
csit/libraries/KarafKeywords.robot

index 4f9cab6c5843e895b520ba0f81985e0be8fc7e24..f332c5c3b30a3eb427e3696cdbaa26c1cd731872 100644 (file)
@@ -73,12 +73,14 @@ Get Device Entity Owner And Candidates Indexes
     ${candidates_list}=    Create List
     ${data}=    Utils.Get Data From URI    ${session}    /restconf/operational/entity-owners:entity-owners
     Log    ${data}
     ${candidates_list}=    Create List
     ${data}=    Utils.Get Data From URI    ${session}    /restconf/operational/entity-owners:entity-owners
     Log    ${data}
-    ${clear_data}=    Run Keyword If    '${device_type}' == 'openflow'    Extract OpenFlow Device Data    ${data}
-    ...    ELSE IF    '${device_type}' == 'ovsdb'    Extract Ovsdb Device Data    ${data}
+    ${device_style}=    BuiltIn.Set_Variable_If    '${device_type}' == 'netconf'    openflow    ${device_type}
+    ${entity_type}=    BuiltIn.Set_Variable_If    '${device_type}' == 'netconf'    netconf-node/${device}    ${device_type}
+    ${clear_data}=    Run Keyword If    '${device_style}' == 'openflow'    Extract OpenFlow Device Data    ${data}
+    ...    ELSE IF    '${device_style}' == 'ovsdb'    Extract Ovsdb Device Data    ${data}
     ...    ELSE    Fail    Not recognized device type: ${device_type}
     ${json}=    RequestsLibrary.To Json    ${clear_data}
     ${entity_type_list}=    Get From Dictionary    &{json}[entity-owners]    entity-type
     ...    ELSE    Fail    Not recognized device type: ${device_type}
     ${json}=    RequestsLibrary.To Json    ${clear_data}
     ${entity_type_list}=    Get From Dictionary    &{json}[entity-owners]    entity-type
-    ${entity_type_index}=    Get Index From List Of Dictionaries    ${entity_type_list}    type    ${device_type}
+    ${entity_type_index}=    Get Index From List Of Dictionaries    ${entity_type_list}    type    ${entity_type}
     Should Not Be Equal    ${entity_type_index}    -1    No Entity Owner found for ${device_type}
     ${entity_list}=    Get From Dictionary    @{entity_type_list}[${entity_type_index}]    entity
     ${entity_index}=    Utils.Get Index From List Of Dictionaries    ${entity_list}    id    ${device}
     Should Not Be Equal    ${entity_type_index}    -1    No Entity Owner found for ${device_type}
     ${entity_list}=    Get From Dictionary    @{entity_type_list}[${entity_type_index}]    entity
     ${entity_index}=    Utils.Get Index From List Of Dictionaries    ${entity_list}    id    ${device}
index a50dbbfb9566e09fe9fb0e1567b6434f345d72d3..59308aae0289f314506ad68ae16176e414002019 100644 (file)
@@ -135,8 +135,8 @@ Execute Controller Karaf Command On Background
     BuiltIn.Run Keyword If    '${status_write}' != 'PASS'    BuiltIn.Fail    Failed to send the command: ${command}
     BuiltIn.Log    ${message_wait}
     BuiltIn.Run Keyword If    '${status_wait}' != 'PASS'    BuiltIn.Fail    Failed to see prompt after sending the command: ${command}
     BuiltIn.Run Keyword If    '${status_write}' != 'PASS'    BuiltIn.Fail    Failed to send the command: ${command}
     BuiltIn.Log    ${message_wait}
     BuiltIn.Run Keyword If    '${status_wait}' != 'PASS'    BuiltIn.Fail    Failed to see prompt after sending the command: ${command}
-    [Teardown]    Restore Current SSH Connection From Index    ${current_connection_index}
     [Return]    ${message_wait}
     [Return]    ${message_wait}
+    [Teardown]    Restore Current SSH Connection From Index    ${current_connection_index}
 
 Execute Controller Karaf Command With Retry On Background
     [Arguments]    ${command}
 
 Execute Controller Karaf Command With Retry On Background
     [Arguments]    ${command}