large rework to optimize test code.
[integration/test.git] / test / csit / suites / karaf-compatible / 010__MD_SAL_NSF / 020__restconf_statistics.txt
index 17c33c0f9407678d1aac73dea1e54bd23057d403..162542ad80a90c4f80126a69908475588fbce6c7 100644 (file)
@@ -1,33 +1,27 @@
 *** Settings ***
 Documentation     Test suite for RESTCONF statistics
-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 Stats for node 1
     [Documentation]    Get the stats for a node
-        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:1
-        Should Be Equal As Strings   ${resp.status_code}    200
-        Should Contain     ${resp.content}      flow-capable-node-connector-statistics
-        Should Contain     ${resp.content}      flow-table-statistics
+    Wait Until Keyword Succeeds    30s    2s    Ensure All Nodes Are In Response    ${REST_CONTEXT}    ${node_list}
+    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:1
 
 Get Stats for node 2
     [Documentation]    Get the stats for a node
-        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:2
-        Should Be Equal As Strings   ${resp.status_code}    200
-        Should Contain     ${resp.content}      flow-capable-node-connector-statistics
-        Should Contain     ${resp.content}      flow-table-statistics
+    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:2
 
 Get Stats for node 3
     [Documentation]    Get the stats for a node
-       ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:3
-       Should Be Equal As Strings   ${resp.status_code}    200
-       Should Contain     ${resp.content}      flow-capable-node-connector-statistics
-       Should Contain     ${resp.content}      flow-table-statistics    
+    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:3