NSF test improvements
[integration/test.git] / test / csit / suites / base / 025__host_tracker.txt
index f82715f1cdb69befeae4e41991d4e8a3346019e5..34856e3f2a5fbcf643f221a5a615686f74956cef 100644 (file)
@@ -11,32 +11,50 @@ Variables         ../../variables/Variables.py
 ${name}           10.0.1.4
 ${key}            hostConfig
 ${REST_CONTEXT}    /controller/nb/v2/hosttracker
+${REST_CONTEXT_ST}    /controller/nb/v2/statistics
+${FLOW}           "10.0.1.4"
 
 *** Test Cases ***
 Add a host
     [Documentation]    Add a host, list to validate the result.
     [Tags]    add
     ${body}    Create Dictionary    nodeType    OF    dataLayerAddress    5e:bf:79:84:10:a6    vlan
-    ...    1    nodeId    00:00:00:00:00:00:00:03    nodeConnectorId    9    networkAddress
+    ...    1    nodeId    00:00:00:00:00:00:00:03    nodeConnectorId    2    networkAddress
     ...    10.0.1.4    staticHost    ${True}    nodeConnectorType    OF
     ${resp}    Put    session    ${REST_CONTEXT}/${CONTAINER}/address/${name}    data=${body}
-    Should Be Equal As Strings    ${resp.status_code}    201    Response status code error
-    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/hosts/inactive
-    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    Should Be Equal As Strings    ${resp.status_code}    201
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/hosts/active
+    Should Be Equal As Strings    ${resp.status_code}    200 
     ${result}    To JSON    ${resp.content}
     ${content}    Get From Dictionary    ${result}    ${key}
-    List Should Contain Value    ${content}    ${body}
-
+    List Should Contain Value    ${content}    ${body} 
+Check flow in flow stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]   get
+    Sleep   10
+    ${resp}    Get    session    ${REST_CONTEXT_ST}/${CONTAINER}/flow
+    Should Be Equal As Strings    ${resp.status_code}    200 
+    Log    ${resp.content}
+    Should Contain X Times   ${resp.content}    ${FLOW}   3
 Remove a host
     [Documentation]    Remove a host, list to validate the result.
     [Tags]    remove
     ${body}    Create Dictionary    nodeType    OF    dataLayerAddress    5e:bf:79:84:10:a6    vlan
-    ...    1    nodeId    00:00:00:00:00:00:00:03    nodeConnectorId    9    networkAddress
+    ...    1    nodeId    00:00:00:00:00:00:00:03    nodeConnectorId    2    networkAddress
     ...    10.0.1.4    staticHost    ${True}    nodeConnectorType    OF
     ${resp}    Delete    session    ${REST_CONTEXT}/${CONTAINER}/address/${name}
-    Should Be Equal As Strings    ${resp.status_code}    204    Response status code error
+    Should Be Equal As Strings    ${resp.status_code}    204
     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/hosts/inactive
-    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    Should Be Equal As Strings    ${resp.status_code}    200
     ${result}    To JSON    ${resp.content}
     ${content}    Get From Dictionary    ${result}    ${key}
     List Should Not Contain Value    ${content}    ${body}
+Check flow is not in flow stats
+    [Documentation]    Show flow stats and validate result
+    [Tags]    get
+    Sleep    10
+    ${resp}    Get    session    ${REST_CONTEXT_ST}/${CONTAINER}/flow
+    Should Be Equal As Strings    ${resp.status_code}    200 
+    Log    ${resp.content}
+    Should Not Contain    ${resp.content}    ${FLOW}
+