Fix HTTP return codes checks to allow for broader ranges
[integration/test.git] / csit / suites / sfc / SFC_Basic / 030__sfc_service_nodes.robot
index 43fe85ad3f803ccf74b9ee74ce160cade716e9bc..1a9f1e56d24cda2b263c495519f13280a22e56cb 100644 (file)
@@ -8,6 +8,7 @@ Library           OperatingSystem
 Library           RequestsLibrary
 Variables         ../../../variables/Variables.py
 Resource          ../../../libraries/Utils.robot
+Resource          ../../../libraries/TemplatedRequests.robot
 
 *** Test Cases ***
 Put Service Nodes
@@ -17,7 +18,7 @@ Put Service Nodes
     ${jsonbody}    To Json    ${body}
     ${nodes}    Get From Dictionary    ${jsonbody}    service-nodes
     ${resp}    RequestsLibrary.Get Request    session    ${SERVICE_NODES_URI}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     ${result}    To JSON    ${resp.content}
     ${node}    Get From Dictionary    ${result}    service-nodes
     Lists Should be Equal    ${node}    ${nodes}
@@ -26,7 +27,7 @@ Delete All Service Nodes
     [Documentation]    Delete all Service Nodes
     Add Elements To URI From File    ${SERVICE_NODES_URI}    ${SERVICE_NODES_FILE}
     ${resp}    RequestsLibrary.Get Request    session    ${SERVICE_NODES_URI}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     Remove All Elements At URI    ${SERVICE_NODES_URI}
     ${resp}    RequestsLibrary.Get Request    session    ${SERVICE_NODES_URI}
     Should Be Equal As Strings    ${resp.status_code}    404
@@ -51,7 +52,7 @@ Delete A Service Node
     Add Elements To URI From File    ${SERVICE_NODES_URI}    ${SERVICE_NODES_FILE}
     Remove All Elements At URI    ${SERVICE_NODES_URI}service-node/node-101
     ${resp}    RequestsLibrary.Get Request    session    ${SERVICE_NODES_URI}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     Should Not Contain    ${resp.content}    node-101
 
 Delete A Non-existing Service Node
@@ -63,7 +64,7 @@ Delete A Non-existing Service Node
     ${nodes}    Get From Dictionary    ${jsonbody}    service-nodes
     Remove All Elements At URI    ${SERVICE_NODES_URI}service-node/non-existing-sn
     ${resp}    RequestsLibrary.Get Request    session    ${SERVICE_NODES_URI}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     ${result}    To JSON    ${resp.content}
     ${node}    Get From Dictionary    ${result}    service-nodes
     Lists Should be Equal    ${node}    ${nodes}