aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/tests/optf-has/has/optf_has_test.robot
diff options
context:
space:
mode:
authorLeonardo Bellini <leonardo.bellini@att.com>2018-03-27 11:52:58 -0500
committerLeonardo Bellini <leonardo.bellini@att.com>2018-03-27 11:53:17 -0500
commitd776cf56f04032fa42727ad94b6712e52022fb8d (patch)
tree86b2a057789f00068ca5ca9bff0b0f9ed27527d9 /test/csit/tests/optf-has/has/optf_has_test.robot
parentd984f526a6708622301cd7fa7cea1ef953b8108a (diff)
Complete optf-has csit for M4
Issue-ID: OPTFRA-204 Change-Id: I09afb088c343699be78d2195638596ac09a0c875 Signed-off-by: Leonardo Bellini <leonardo.bellini@att.com>
Diffstat (limited to 'test/csit/tests/optf-has/has/optf_has_test.robot')
-rw-r--r--test/csit/tests/optf-has/has/optf_has_test.robot65
1 files changed, 63 insertions, 2 deletions
diff --git a/test/csit/tests/optf-has/has/optf_has_test.robot b/test/csit/tests/optf-has/has/optf_has_test.robot
index d6de27632..62db10774 100644
--- a/test/csit/tests/optf-has/has/optf_has_test.robot
+++ b/test/csit/tests/optf-has/has/optf_has_test.robot
@@ -170,8 +170,6 @@ GetPlanWithWrongVersion
Should Be Equal As Integers ${resp.status_code} 200
Should Be Equal error ${resultStatus}
-
-
SendPlanWithoutDemandSection
[Documentation] It sends a POST request to conductor
Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
@@ -203,6 +201,37 @@ GetPlanWithoutDemandSection
Should Be Equal As Integers ${resp.status_code} 200
Should Be Equal error ${resultStatus}
+SendPlanWithWrongConstraint
+ [Documentation] It sends a POST request to conductor
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_wrong_distance_constraint.json
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ ${response_json} json.loads ${resp.content}
+ ${generatedPlanId}= Convert To String ${response_json['id']}
+ Set Global Variable ${generatedPlanId}
+ Log To Console generatedPlanId = ${generatedPlanId}
+ Should Be Equal As Integers ${resp.status_code} 201
+ Sleep 10s Wait Plan Resolution
+
+GetPlanWithWrongConstraint
+ [Documentation] It sends a REST GET request to capture error
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ ${response_json} json.loads ${resp.content}
+ ${resultStatus}= Convert To String ${response_json['plans'][0]['status']}
+ Set Global Variable ${resultStatus}
+ Log To Console resultStatus = ${resultStatus}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+ Should Be Equal error ${resultStatus}
+
SendPlanWithLatiAndLongi
[Documentation] It sends a POST request to conductor
@@ -235,6 +264,38 @@ GetPlanWithLatiAndLongi
Should Be Equal As Integers ${resp.status_code} 200
Should Be Equal done ${resultStatus}
+SendPlanWithShortDistanceConstraint
+ [Documentation] It sends a POST request to conductor
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_short_distance_constraint.json
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ ${response_json} json.loads ${resp.content}
+ ${generatedPlanId}= Convert To String ${response_json['id']}
+ Set Global Variable ${generatedPlanId}
+ Log To Console generatedPlanId = ${generatedPlanId}
+ Should Be Equal As Integers ${resp.status_code} 201
+ Sleep 60s Wait Plan Resolution
+
+GetPlanWithShortDistanceConstraint
+ [Documentation] It sends a REST GET request to capture recommendations
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ ${response_json} json.loads ${resp.content}
+ ${resultStatus}= Convert To String ${response_json['plans'][0]['status']}
+ Set Global Variable ${resultStatus}
+ Log To Console resultStatus = ${resultStatus}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+ Should Be Equal not found ${resultStatus}
+
+
*** Keywords ***