NSF test improvements
[integration/test.git] / test / csit / suites / base / 020__forwarding_rules_manager.txt
index 1dcb2a48380aaa19b2a661ea2d3bd5293e0ec956..390949a4cd33f9fbd2bc55078f0127ffce9d1281 100644 (file)
@@ -12,6 +12,8 @@ ${name}           flow1
 ${key}            flowConfig
 ${node_id}        00:00:00:00:00:00:00:02
 ${REST_CONTEXT}    /controller/nb/v2/flowprogrammer
+${REST_CONTEXT_ST}    /controller/nb/v2/statistics
+${FLOW}           "10.0.0.1"
 
 *** Test Cases ***
 Add a flow
@@ -23,13 +25,20 @@ Add a flow
     ...    ${node}    priority    1    etherType    0x800    nwDst
     ...    10.0.0.1/32    actions    ${actions}
     ${resp}    Put    session    ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name}    data=${body}
-    Should Be Equal As Strings    ${resp.status_code}    201    Response status code error
+    Should Be Equal As Strings    ${resp.status_code}    201
     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}
-    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 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    ${resp.content}    ${FLOW}
 Remove a flow
     [Documentation]    Remove a flow, list to validate the result.
     [Tags]    remove
@@ -39,9 +48,18 @@ Remove a flow
     ...    ${node}    priority    1    etherType    0x800    nwDst
     ...    10.0.0.1/32    actions    ${actions}
     ${resp}    Delete    session    ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${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}
-    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}
+