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>
diff --git a/robot/resources/oof_interface.robot b/robot/resources/oof_interface.robot
index 24a2345..aad0652 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_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 @@
      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 @@
     [Arguments]    ${json}
     ${json_string}=    Evaluate    json.dumps(${json})    json
     ${escaped}=   Replace String    ${json_string}   "   \\"
-    [Return]   ${escaped}
\ No newline at end of file
+    [Return]   ${escaped}