diff options
author | Gary Wu <gary.i.wu@huawei.com> | 2018-03-27 14:23:07 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-03-27 14:23:07 +0000 |
commit | 2fd354e7fd2528521b1d37b8cc029c6cb193e290 (patch) | |
tree | 62865062f2394407011c5a9ca3c0c0da6ce66629 /test/csit/tests/optf-has/has/optf_has_test.robot | |
parent | d3e6f379bee2a3f38ba70756e94476becfece344 (diff) | |
parent | 853238d1b2e02ba573b5185ebb2c83c48e3b3333 (diff) |
Merge "complete test cases for M4"
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.robot | 67 |
1 files changed, 65 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 08a32105d..d6de27632 100644 --- a/test/csit/tests/optf-has/has/optf_has_test.robot +++ b/test/csit/tests/optf-has/has/optf_has_test.robot @@ -139,9 +139,73 @@ Healthcheck Log To Console body = ${resp.text} Should Be Equal As Integers ${resp.status_code} 200 +SendPlanWithWrongVersion + [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_version.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 + +GetPlanWithWrongVersion + [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} + + + +SendPlanWithoutDemandSection + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_without_demand_section.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 + +GetPlanWithoutDemandSection + [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 GET request to conductor + [Documentation] It sends a POST request to conductor Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_lati_and_longi.json &{headers}= Create Dictionary Content-Type=application/json Accept=application/json @@ -172,7 +236,6 @@ GetPlanWithLatiAndLongi Should Be Equal done ${resultStatus} - *** Keywords *** |