Fix json reponse
authorLuis Gomez <luis.gomez@ericsson.com>
Sun, 5 Jan 2014 23:00:24 +0000 (15:00 -0800)
committerLuis Gomez <luis.gomez@ericsson.com>
Sun, 5 Jan 2014 23:00:24 +0000 (15:00 -0800)
Change-Id: I4b61ef52350443715b73d9801c081e59cf48a09d
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/sp/005__topology_manager.txt
test/csit/suites/sp/010__statistics_manager.txt
test/csit/suites/vtn/005__topology_manager.txt
test/csit/suites/vtn/010__statistics_manager.txt

index 2f402c7971cc57e01734e21de346374301f806e6..076d5e44ee50836068b2d7876f7de277ad1a50d2 100644 (file)
@@ -8,10 +8,9 @@ Library           ../../libraries/Common.py
 Variables         ../../variables/Variables.py
 
 *** Variables ***
-${nodeconn1}   NodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:01"},"id":"1"}
-${nodeconn2}   NodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:01"},"id":"2"}
-${nodeconn3}   NodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:02"},"id":"3"}
-${nodeconn4}   NodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:03"},"id":"3"}
+${node1}   "00:00:00:00:00:00:00:01"
+${node2}   "00:00:00:00:00:00:00:02"
+${node3}   "00:00:00:00:00:00:00:03"
 ${name}           test_userlink1
 ${key}            userLinks
 ${REST_CONTEXT}    /controller/nb/v2/topology
@@ -23,10 +22,9 @@ Get Topology
     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}
     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
-    Should Contain X Times  ${resp.content}   ${nodeconn3}   2
-    Should Contain X Times  ${resp.content}   ${nodeconn4}   2
+    Should Contain X Times  ${resp.content}   ${node1}   4
+    Should Contain X Times  ${resp.content}   ${node2}   2
+    Should Contain X Times  ${resp.content}   ${node3}   2
 Add a userlink
     [Documentation]    Add a userlink, list to validate the result.
     [Tags]    add
@@ -39,7 +37,6 @@ Add a userlink
     ${result}    To JSON    ${resp.content}
     ${content}    Get From Dictionary    ${result}    ${key}
     List Should Contain Value    ${content}    ${body}
-
 Remove a userlink
     [Documentation]    Remove a userlink, list to validate the result.
     [Tags]    remove
index fb5943d5ccc8f9ec9017e484087500dad5e14ed1..49d2e83914b9db26e725935bf80d39ffa2165e56 100644 (file)
@@ -8,18 +8,9 @@ Library           ../../libraries/Common.py
 Variables         ../../variables/Variables.py
 
 *** Variables ***
-${node1}       "node":{"type":"OF","id":"00:00:00:00:00:00:00:01"}
-${node2}       "node":{"type":"OF","id":"00:00:00:00:00:00:00:02"}
-${node3}       "node":{"type":"OF","id":"00:00:00:00:00:00:00:03"}
-${nodeconn1}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:01"},"id":"1"}
-${nodeconn2}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:01"},"id":"2"}
-${nodeconn3}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:02"},"id":"1"}
-${nodeconn4}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:02"},"id":"2"}
-${nodeconn5}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:02"},"id":"3"}
-${nodeconn6}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:03"},"id":"1"}
-${nodeconn7}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:03"},"id":"2"}
-${nodeconn8}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:03"},"id":"3"}
-
+${node1}       "00:00:00:00:00:00:00:01"
+${node2}       "00:00:00:00:00:00:00:02"
+${node3}       "00:00:00:00:00:00:00:03"
 ${key}             portStatistics
 ${REST_CONTEXT}    /controller/nb/v2/statistics
 
@@ -29,14 +20,9 @@ get port stats
     [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}
-    Should Contain    ${resp.content}    ${nodeconn4}
-    Should Contain    ${resp.content}    ${nodeconn5}
-    Should Contain    ${resp.content}    ${nodeconn6}
-    Should Contain    ${resp.content}    ${nodeconn7}
-    Should Contain    ${resp.content}    ${nodeconn8}
+    Should Contain X Times   ${resp.content}    ${node1}    4
+    Should Contain X Times   ${resp.content}    ${node2}    5
+    Should Contain X Times   ${resp.content}    ${node3}    5
 get flow stats
     [Documentation]    Show flow stats and validate result
     [Tags]    get
index e9ae23aa5f446348b5f199450caf5432a43fb494..076d5e44ee50836068b2d7876f7de277ad1a50d2 100644 (file)
@@ -8,10 +8,9 @@ Library           ../../libraries/Common.py
 Variables         ../../variables/Variables.py
 
 *** Variables ***
-${nodeconn1}   NodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:01"},"id":"1"}
-${nodeconn2}   NodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:01"},"id":"2"}
-${nodeconn3}   NodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:02"},"id":"3"}
-${nodeconn4}   NodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:03"},"id":"3"}
+${node1}   "00:00:00:00:00:00:00:01"
+${node2}   "00:00:00:00:00:00:00:02"
+${node3}   "00:00:00:00:00:00:00:03"
 ${name}           test_userlink1
 ${key}            userLinks
 ${REST_CONTEXT}    /controller/nb/v2/topology
@@ -21,34 +20,32 @@ 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
-    Should Contain X Times  ${resp.content}   ${nodeconn3}   2
-    Should Contain X Times  ${resp.content}   ${nodeconn4}   2
+    Should Contain X Times  ${resp.content}   ${node1}   4
+    Should Contain X Times  ${resp.content}   ${node2}   2
+    Should Contain X Times  ${resp.content}   ${node3}   2
 Add a userlink
     [Documentation]    Add a userlink, list to validate the result.
     [Tags]    add
     ${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}
-
 Remove a userlink
     [Documentation]    Remove a userlink, list to validate the result.
     [Tags]    remove
     ${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..49d2e83914b9db26e725935bf80d39ffa2165e56 100644 (file)
@@ -8,18 +8,9 @@ Library           ../../libraries/Common.py
 Variables         ../../variables/Variables.py
 
 *** Variables ***
-${node1}       "node":{"type":"OF","id":"00:00:00:00:00:00:00:01"}
-${node2}       "node":{"type":"OF","id":"00:00:00:00:00:00:00:02"}
-${node3}       "node":{"type":"OF","id":"00:00:00:00:00:00:00:03"}
-${nodeconn1}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:01"},"id":"1"}
-${nodeconn2}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:01"},"id":"2"}
-${nodeconn3}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:02"},"id":"1"}
-${nodeconn4}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:02"},"id":"2"}
-${nodeconn5}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:02"},"id":"3"}
-${nodeconn6}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:03"},"id":"1"}
-${nodeconn7}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:03"},"id":"2"}
-${nodeconn8}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:03"},"id":"3"}
-
+${node1}       "00:00:00:00:00:00:00:01"
+${node2}       "00:00:00:00:00:00:00:02"
+${node3}       "00:00:00:00:00:00:00:03"
 ${key}             portStatistics
 ${REST_CONTEXT}    /controller/nb/v2/statistics
 
@@ -28,18 +19,15 @@ get port stats
     [Documentation]    Show port stats and validate result
     [Tags]    get
     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/port
-    Should Contain    ${resp.content}    ${nodeconn1}
-    Should Contain    ${resp.content}    ${nodeconn2}
-    Should Contain    ${resp.content}    ${nodeconn3}
-    Should Contain    ${resp.content}    ${nodeconn4}
-    Should Contain    ${resp.content}    ${nodeconn5}
-    Should Contain    ${resp.content}    ${nodeconn6}
-    Should Contain    ${resp.content}    ${nodeconn7}
-    Should Contain    ${resp.content}    ${nodeconn8}
+    Should Be Equal As Strings    ${resp.status_code}    200 
+    Should Contain X Times   ${resp.content}    ${node1}    4
+    Should Contain X Times   ${resp.content}    ${node2}    5
+    Should Contain X Times   ${resp.content}    ${node3}    5
 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 +35,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 e9ae23aa5f446348b5f199450caf5432a43fb494..076d5e44ee50836068b2d7876f7de277ad1a50d2 100644 (file)
@@ -8,10 +8,9 @@ Library           ../../libraries/Common.py
 Variables         ../../variables/Variables.py
 
 *** Variables ***
-${nodeconn1}   NodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:01"},"id":"1"}
-${nodeconn2}   NodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:01"},"id":"2"}
-${nodeconn3}   NodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:02"},"id":"3"}
-${nodeconn4}   NodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:03"},"id":"3"}
+${node1}   "00:00:00:00:00:00:00:01"
+${node2}   "00:00:00:00:00:00:00:02"
+${node3}   "00:00:00:00:00:00:00:03"
 ${name}           test_userlink1
 ${key}            userLinks
 ${REST_CONTEXT}    /controller/nb/v2/topology
@@ -21,34 +20,32 @@ 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
-    Should Contain X Times  ${resp.content}   ${nodeconn3}   2
-    Should Contain X Times  ${resp.content}   ${nodeconn4}   2
+    Should Contain X Times  ${resp.content}   ${node1}   4
+    Should Contain X Times  ${resp.content}   ${node2}   2
+    Should Contain X Times  ${resp.content}   ${node3}   2
 Add a userlink
     [Documentation]    Add a userlink, list to validate the result.
     [Tags]    add
     ${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}
-
 Remove a userlink
     [Documentation]    Remove a userlink, list to validate the result.
     [Tags]    remove
     ${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..49d2e83914b9db26e725935bf80d39ffa2165e56 100644 (file)
@@ -8,18 +8,9 @@ Library           ../../libraries/Common.py
 Variables         ../../variables/Variables.py
 
 *** Variables ***
-${node1}       "node":{"type":"OF","id":"00:00:00:00:00:00:00:01"}
-${node2}       "node":{"type":"OF","id":"00:00:00:00:00:00:00:02"}
-${node3}       "node":{"type":"OF","id":"00:00:00:00:00:00:00:03"}
-${nodeconn1}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:01"},"id":"1"}
-${nodeconn2}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:01"},"id":"2"}
-${nodeconn3}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:02"},"id":"1"}
-${nodeconn4}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:02"},"id":"2"}
-${nodeconn5}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:02"},"id":"3"}
-${nodeconn6}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:03"},"id":"1"}
-${nodeconn7}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:03"},"id":"2"}
-${nodeconn8}   "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:03"},"id":"3"}
-
+${node1}       "00:00:00:00:00:00:00:01"
+${node2}       "00:00:00:00:00:00:00:02"
+${node3}       "00:00:00:00:00:00:00:03"
 ${key}             portStatistics
 ${REST_CONTEXT}    /controller/nb/v2/statistics
 
@@ -28,18 +19,15 @@ get port stats
     [Documentation]    Show port stats and validate result
     [Tags]    get
     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/port
-    Should Contain    ${resp.content}    ${nodeconn1}
-    Should Contain    ${resp.content}    ${nodeconn2}
-    Should Contain    ${resp.content}    ${nodeconn3}
-    Should Contain    ${resp.content}    ${nodeconn4}
-    Should Contain    ${resp.content}    ${nodeconn5}
-    Should Contain    ${resp.content}    ${nodeconn6}
-    Should Contain    ${resp.content}    ${nodeconn7}
-    Should Contain    ${resp.content}    ${nodeconn8}
+    Should Be Equal As Strings    ${resp.status_code}    200 
+    Should Contain X Times   ${resp.content}    ${node1}    4
+    Should Contain X Times   ${resp.content}    ${node2}    5
+    Should Contain X Times   ${resp.content}    ${node3}    5
 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 +35,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}