fix the tests due to statuscode change 54/44154/1
authorDavid Goldberg <gdavid@hpe.com>
Wed, 17 Aug 2016 15:04:56 +0000 (18:04 +0300)
committerDavid Goldberg <gdavid@hpe.com>
Wed, 17 Aug 2016 15:04:56 +0000 (18:04 +0300)
Change-Id: I5cfe6179cc3dc94fe837ed8195418a475e3c8175
Signed-off-by: David Goldberg <gdavid@hpe.com>
csit/suites/unimgr/basic/010_Restconf_OK.robot
csit/suites/unimgr/uni_operations/010_unimanager_restconf.robot

index 8ec9c49d1119c3404f770c57068b64b76b493689..88ec222db05611425aa0507fd5c79d75dfde32b0 100644 (file)
@@ -6,11 +6,12 @@ Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
 Resource          ../../../libraries/Utils.robot
+Resource          ../../../libraries/TemplatedRequests.robot
 
 *** Test Cases ***
 Get Controller Modules
     [Documentation]    Get the controller modules via Restconf
     ${resp}    RequestsLibrary.Get Request    session    ${MODULES_API}
     Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     Should Contain    ${resp.content}    ietf-restconf
index 4cbb60d0229207ea45ee7866cf8f09abe1e00ecc..34db8163d4e257560a7151ec98be384c1f589dd5 100644 (file)
@@ -11,6 +11,7 @@ Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
 Resource          ../../../libraries/Utils.robot
 Resource          ../../../libraries/UnimgrKeywords.robot
+Resource          ../../../libraries/TemplatedRequests.robot
 
 *** Variables ***
 ${DEFAULT_LINUX_PROMPT}    ${EMPTY}
@@ -30,10 +31,10 @@ Create source and destination UNIs at the OVS instances using Restconf API
     ${uniDest}    Get Add Uni Json    ${Mininet2_IP}    ${UNI2_MAC}
     ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/${Uni_topo_API}${Mininet1_IP}    data=${uniSource}
     Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/${Uni_topo_API}${Mininet2_IP}    data=${uniDest}
     Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     ${elements}    Create List    ${Mininet1_IP}    ${Mininet2_IP}
     Wait Until Keyword Succeeds    16s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/unimgr:uni/    ${elements}
 
@@ -43,10 +44,10 @@ Update UNI Speed
     ${speedJson}    OperatingSystem.Get File    ${UniMgr_variables_DIR}/uni_speed.json
     ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/${Uni_topo_API}${Mininet1_IP}/cl-unimgr-mef:speed    data=${speedJson}
     Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/${Uni_topo_API}${Mininet2_IP}/cl-unimgr-mef:speed    data=${speedJson}
     Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}    
     ${elements}    Create List    speed-10G
     Wait Until Keyword Succeeds    16s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/unimgr:uni/    ${elements}
 
@@ -56,7 +57,7 @@ Create EVC tunnel between the Unis
     ${evc}    Get Add Evc Json    ${Mininet1_IP}    ${Mininet2_IP}
     ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/${Evc_topo_API}    data=${evc}
     Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     ${elements}    Create List    evc://1
     Wait Until Keyword Succeeds    16s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/unimgr:evc/    ${elements}
 
@@ -67,10 +68,10 @@ Update EVC Ingress and Egress Speed
     ${egressJson}    OperatingSystem.Get File    ${UniMgr_variables_DIR}/evc_egress_speed.json
     ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/${Evc_topo_API}/cl-unimgr-mef:ingress-bw    data=${ingressJson}
     Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/${Evc_topo_API}/cl-unimgr-mef:egress-bw    data=${egressJson}
     Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     ${elements}    Create List    speed-1G
     Wait Until Keyword Succeeds    16s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/unimgr:evc/    ${elements}
 
@@ -79,7 +80,7 @@ Delete EVC tunnel between the Unis
     [Tags]    UniMgr EVC Delete
     ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/${Evc_topo_API}
     Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     ${elements}    Create List    evc://1
     Wait Until Keyword Succeeds    16s    2s    Check For Elements Not At URI    ${CONFIG_TOPO_API}/topology/unimgr:evc/    ${elements}
 
@@ -88,9 +89,9 @@ Delete UNIs source and destination
     [Tags]    UniMgr UNI Delete
     ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/${Uni_topo_API}${Mininet1_IP}
     Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/${Uni_topo_API}${Mininet2_IP}
     Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     ${elements}    Create List    ${Mininet1_IP}    ${Mininet2_IP}
     Wait Until Keyword Succeeds    16s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/unimgr:uni/    ${elements}