large rework to optimize test code.
[integration/test.git] / test / csit / suites / karaf-compatible / 020__MD_SAL_NSF_OF13 / 010__restconf_inventory.txt
index ab87a8961aac44cb422abd7fde15d1f83f8b0575..bb7c8207c53c90cd9913ce65d14cca9f169a3edb 100644 (file)
@@ -1,46 +1,42 @@
 *** Settings ***
 Documentation     Test suite for RESTCONF inventory
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../../libraries/RequestsLibrary.py
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
 ${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+@{node_list}      openflow:1    openflow:2    openflow:3
 
-*** Test Cases *** 
+*** Test Cases ***
 Get list of nodes
     [Documentation]    Get the inventory
-       ${resp}    Get    session    ${REST_CONTEXT}
-       Should Be Equal As Strings    ${resp.status_code}    200
-       Should Contain     ${resp.content}      openflow:1
-       Should Contain     ${resp.content}      openflow:2
-       Should Contain     ${resp.content}      openflow:3
-       
+    ${resp}    Get    session    ${REST_CONTEXT}
+    Wait Until Keyword Succeeds    30s    2s    Ensure All Nodes Are In Response    ${REST_CONTEXT}    ${node_list}
+
 Get nodeconnector for a node 1
     [Documentation]    Get the inventory for a node
-        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:1
-        Should Be Equal As Strings   ${resp.status_code}    200
-        Should Contain     ${resp.content}      openflow:1:1
-        Should Contain     ${resp.content}      openflow:1:2
+    ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:1
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    openflow:1:1
+    Should Contain    ${resp.content}    openflow:1:2
 
 Get nodeconnector for a node 2
     [Documentation]    Get the inventory for a node
-        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:2
-        Should Be Equal As Strings   ${resp.status_code}    200
-        Should Contain     ${resp.content}      openflow:2:1
-        Should Contain     ${resp.content}      openflow:2:2
-        Should Contain     ${resp.content}      openflow:2:3
+    ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:2
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    openflow:2:1
+    Should Contain    ${resp.content}    openflow:2:2
+    Should Contain    ${resp.content}    openflow:2:3
 
 Get nodeconnector for a node 3
     [Documentation]    Get the inventory for a node
-       ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:3
-       Should Be Equal As Strings   ${resp.status_code}    200
-       Should Contain     ${resp.content}      openflow:3:1
-       Should Contain     ${resp.content}      openflow:3:2
-       Should Contain     ${resp.content}      openflow:3:3
-
-       
-    
+    ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:3
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    openflow:3:1
+    Should Contain    ${resp.content}    openflow:3:2
+    Should Contain    ${resp.content}    openflow:3:3