summaryrefslogtreecommitdiffstats
path: root/robot/resources
diff options
context:
space:
mode:
authorRuoyu Ying <ruoyu.ying@intel.com>2019-04-11 02:31:44 +0800
committerRuoyu Ying <ruoyu.ying@intel.com>2019-04-11 02:38:24 +0800
commitc014e9208017bb712665fd70ee1f60f0ac519f99 (patch)
tree7ceb3af2f8a6190803135d024a47aa59e346c360 /robot/resources
parent124bd57e9cf4efab66335848fb989f43aafb4167 (diff)
Add CSIT testing for optf-has
Add one more test case for OOF homing. Change-Id: I2e022964c1448b53cb629ccd850b3660fe069270 Issue-ID: OPTFRA-449 Signed-off-by: Ruoyu Ying <ruoyu.ying@intel.com>
Diffstat (limited to 'robot/resources')
-rw-r--r--robot/resources/oof_interface.robot22
1 files changed, 21 insertions, 1 deletions
diff --git a/robot/resources/oof_interface.robot b/robot/resources/oof_interface.robot
index 24a23459..aad06526 100644
--- a/robot/resources/oof_interface.robot
+++ b/robot/resources/oof_interface.robot
@@ -1,5 +1,6 @@
*** Settings ***
Documentation The main interface for interacting with OOF: SNIRO and Homing Service
+Library json5
Library RequestsLibrary
Library UUID
Library String
@@ -16,11 +17,14 @@ ${OOF_CMSO_HEALTH_CHECK_PATH} /cmso/v1/health?checkInterfaces=true
${OOF_CMSO_TEMPLATE_FOLDER} robot/assets/templates/cmso
${OOF_CMSO_UTC} %Y-%m-%dT%H:%M:%SZ
+${OOF_HOMING_PLAN_FOLDER} robot/assets/templates/optf-has
${OOF_HOMING_ENDPOINT} ${GLOBAL_OOF_SERVER_PROTOCOL}://${GLOBAL_INJECTED_OOF_HOMING_IP_ADDR}:${GLOBAL_OOF_HOMING_SERVER_PORT}
${OOF_SNIRO_ENDPOINT} ${GLOBAL_OOF_SERVER_PROTOCOL}://${GLOBAL_INJECTED_OOF_SNIRO_IP_ADDR}:${GLOBAL_OOF_SNIRO_SERVER_PORT}
${OOF_CMSO_ENDPOINT} ${GLOBAL_OOF_CMSO_PROTOCOL}://${GLOBAL_INJECTED_OOF_CMSO_IP_ADDR}:${GLOBAL_OOF_CMSO_SERVER_PORT}
+${OOF_HOMING_AUTH} Basic YWRtaW4xOnBsYW4uMTU=
+
*** Keywords ***
Run OOF-Homing Health Check
[Documentation] Runs OOF-Homing Health check
@@ -36,6 +40,22 @@ Run OOF-Homing Get Request
Log Received response from OOF-Homing ${resp.text}
[Return] ${resp}
+RUN OOF-Homing SendPlanWithWrongVersion
+ [Documentation] It sends a POST request to conductor
+ ${session}= Create Session optf-cond ${OOF_HOMING_ENDPOINT}
+ ${data}= Get Binary File ${OOF_HOMING_PLAN_FOLDER}${/}plan_with_wrong_version.json
+ &{headers}= Create Dictionary Authorization=${OOF_HOMING_Auth} Content-Type=application/json Accept=application/json
+ ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers}
+ Log *********************
+ Log response = ${resp}
+ Log body = ${resp.text}
+ ${response_json} json5.Loads ${resp.content}
+ ${generatedPlanId}= Convert To String ${response_json['id']}
+ Set Global Variable ${generatedPlanId}
+ Log generatedPlanId = ${generatedPlanId}
+ Should Be Equal As Integers ${resp.status_code} 201
+ Sleep 10s Wait Plan Resolution
+
Run OOF-SNIRO Health Check
[Documentation] Runs OOF-SNIRO Health check
${resp}= Run OOF-SNIRO Get Request ${OOF_SNIRO_HEALTH_CHECK_PATH}
@@ -143,4 +163,4 @@ OOF-CMSO Json Escape
[Arguments] ${json}
${json_string}= Evaluate json.dumps(${json}) json
${escaped}= Replace String ${json_string} " \\"
- [Return] ${escaped} \ No newline at end of file
+ [Return] ${escaped}