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-26 09:58:37 -0500
committerLeonardo Bellini <leonardo.bellini@att.com>2018-03-26 10:32:37 -0500
commit735c8e14ca903a09c3409957b8b91800774d7f4b (patch)
tree2dc17cf4ea697601314acd36d20b8673daacea83 /test/csit/tests/optf-has/has/optf_has_test.robot
parent3faaa3d54204746f12ff9973cbaf6b98b9dce7cc (diff)
Add optf-has healthcheck and other test cases
Issue-ID: OPTFRA-204 Change-Id: I847a8ea755190be05537c2f6dd332bc21ddd3728 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.robot58
1 files changed, 58 insertions, 0 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 4882c229f..08a32105d 100644
--- a/test/csit/tests/optf-has/has/optf_has_test.robot
+++ b/test/csit/tests/optf-has/has/optf_has_test.robot
@@ -11,6 +11,8 @@ ${RESP_MESSAGE_WITHOUT_DEMANDS} Undefined Demand
#global variables
${generatedPlanId}
+${generatedAID}
+${resultStatus}
*** Test Cases ***
Check Cassandra Docker Container
@@ -114,6 +116,62 @@ Get Root Url
Log To Console body = ${resp.text}
Should Be Equal As Integers ${resp.status_code} 200
+Conductor AddHealthcheck Row Into Music
+ [Documentation] It sends a REST PUT request to Music to inject healthcheck plan
+ Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT}
+ ${data}= Get Binary File ${CURDIR}${/}data${/}healthcheck.json
+ &{headers}= Create Dictionary ns=conductor userId=conductor password=c0nduct0r Content-Type=application/json Accept=application/json
+ ${resp}= Put Request musicaas /MUSIC/rest/v2/keyspaces/conductor/tables/plans/rows?id=healthcheck data=${data} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ ${response_json} json.loads ${resp.content}
+ Should Be Equal As Integers ${resp.status_code} 200
+ Sleep 5s Wait Injection effectiveness
+
+Healthcheck
+ [Documentation] It sends a REST GET request to healthcheck url
+ 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/healthcheck headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+
+
+SendPlanWithLatiAndLongi
+ [Documentation] It sends a POST GET 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
+ ${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
+
+GetPlanWithLatiAndLongi
+ [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 done ${resultStatus}
+
+
*** Keywords ***
1345' - name: 'so/openstack-adapter' version: '1.7.6-20201027T1345' - name: 'so/sdnc-adapter' version: '1.7.6-20201027T1345' - name: 'so/vfc-adapter' version: '1.7.6-20201027T1345' - name: 'so/sdc-controller' version: '1.7.6-20201027T1345' - name: 'so/bpmn-infra' version: '1.7.6-20201027T1345' - name: 'so/so-monitoring' version: '1.7.6-20201027T1345' - name: 'so/api-handler-infra' version: '1.7.6-20201027T1345' - name: 'so/nssmf-adapter' version: '1.7.6-20201027T1345' - name: 'so/mso-cnf-adapter' version: '1.7.6-20201027T1345' - name: 'so/so-oof-adapter' version: '1.7.6-20201027T1345'