NSF test improvements
authorLuis Gomez <luis.gomez@ericsson.com>
Sun, 22 Dec 2013 12:21:49 +0000 (04:21 -0800)
committerLuis Gomez <luis.gomez@ericsson.com>
Sun, 22 Dec 2013 17:10:17 +0000 (09:10 -0800)
Change-Id: I518d85c66d8185dbba1f3a46fae1591ea91917e9
Signed-off-by: Luis Gomez <luis.gomez@ericsson.com>
test/csit/suites/base/005__topology_manager.txt
test/csit/suites/base/010__statistics_manager.txt
test/csit/suites/base/020__forwarding_rules_manager.txt
test/csit/suites/base/025__host_tracker.txt
test/csit/suites/base/035__forwarding_manager.txt
test/csit/suites/sp/020__forwarding_rules_manager.txt
test/csit/suites/vtn/020__forwarding_rules_manager.txt

index e9ae23aa5f446348b5f199450caf5432a43fb494..2f402c7971cc57e01734e21de346374301f806e6 100644 (file)
@@ -21,7 +21,7 @@ Get Topology
     [Documentation]    Get Topology and validate the result.
     [Tags]    get
     ${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 
     Log    ${resp.content}
     Should Contain X Times  ${resp.content}   ${nodeconn1}   2
     Should Contain X Times  ${resp.content}   ${nodeconn2}   2
@@ -33,9 +33,9 @@ Add a userlink
     ${body}    Create Dictionary    name    ${name}    status    Success    srcNodeConnector
     ...    OF|1@OF|00:00:00:00:00:00:00:02    dstNodeConnector    OF|1@OF|00:00:00:00:00:00:00:03
     ${resp}    Put    session    ${REST_CONTEXT}/${CONTAINER}/userLink/${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}/userLinks
-    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}
@@ -46,9 +46,9 @@ Remove a userlink
     ${body}    Create Dictionary    name    ${name}    status    Success    srcNodeConnector
     ...    OF|1@OF|00:00:00:00:00:00:00:02    dstNodeConnector    OF|1@OF|00:00:00:00:00:00:00:03
     ${resp}    Delete    session    ${REST_CONTEXT}/${CONTAINER}/userLink/${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}/userLinks
-    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}
index 3b2e7899263605b6d93b32bb1b66117073575c27..fb5943d5ccc8f9ec9017e484087500dad5e14ed1 100644 (file)
@@ -28,6 +28,7 @@ get port stats
     [Documentation]    Show port stats and validate result
     [Tags]    get
     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/port
+    Should Be Equal As Strings    ${resp.status_code}    200 
     Should Contain    ${resp.content}    ${nodeconn1}
     Should Contain    ${resp.content}    ${nodeconn2}
     Should Contain    ${resp.content}    ${nodeconn3}
@@ -40,6 +41,7 @@ get flow stats
     [Documentation]    Show flow stats and validate result
     [Tags]    get
     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/flow
+    Should Be Equal As Strings    ${resp.status_code}    200 
     Should Contain    ${resp.content}    ${node1}
     Should Contain    ${resp.content}    ${node2}
     Should Contain    ${resp.content}    ${node3}
@@ -47,6 +49,7 @@ get table stats
     [Documentation]    Show flow stats and validate result
     [Tags]    get
     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/table
+    Should Be Equal As Strings    ${resp.status_code}    200 
     Should Contain    ${resp.content}    ${node1}
     Should Contain    ${resp.content}    ${node2}
     Should Contain    ${resp.content}    ${node3}
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}
+
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}
+
index 4479555c9b6b47ebe621a27088132389d84636f0..4ee28d4f5e0d0e0338795611da52b872bd3b63a6 100644 (file)
@@ -20,22 +20,21 @@ Add a static route
     ${body}    Create Dictionary    name    ${name}    prefix    192.168.1.0/24    nextHop
     ...    10.0.0.2
     ${resp}    Put    session    ${REST_CONTEXT}/${CONTAINER}/route/${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}/routes
     Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
     ${result}    To JSON    ${resp.content}
     ${content}    Get From Dictionary    ${result}    ${key}
     List Should Contain Value    ${content}    ${body}
-    Sleep    3
 Remove a static route
     [Documentation]    Remove a static route, list to validate the result.
     [Tags]    remove
     ${body}    Create Dictionary    name    ${name}    prefix    192.168.1.0/24    nextHop
     ...    10.0.0.2
     ${resp}    Delete    session    ${REST_CONTEXT}/${CONTAINER}/route/${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}/routes
-    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}
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}
+
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}
+