A&AI health check improvement: 12/111912/5
authorNagendra90287 <nagendrakumar.pal@amdocs.com>
Mon, 31 Aug 2020 16:21:42 +0000 (21:51 +0530)
committerMorgan Richomme <morgan.richomme@orange.com>
Wed, 16 Sep 2020 19:37:29 +0000 (19:37 +0000)
Issue-ID: AAI-3123
Change-Id: Ib3d53712b0ad3a0e73e4eed931bde0b301eb50a4
Signed-off-by: Nagendra90287 <nagendrakumar.pal@amdocs.com>
Change-Id: I36b3914e829485d0137e532f84d1569e710ca428
Signed-off-by: Nagendra90287 <nagendrakumar.pal@amdocs.com>
robot/resources/aai/aai_interface.robot
robot/testsuites/health-check.robot

index d43f35c..6402699 100644 (file)
@@ -7,8 +7,13 @@ Resource            ../global_properties.robot
 
 *** Variables ***
 ${AAI_HEALTH_PATH}  /aai/util/echo?action=long
-${VERSIONED_INDEX_PATH}     /aai/v11
+${VERSIONED_INDEX_PATH}     /aai/v19
 ${AAI_FRONTEND_ENDPOINT}    ${GLOBAL_AAI_SERVER_PROTOCOL}://${GLOBAL_INJECTED_AAI_IP_ADDR}:${GLOBAL_AAI_SERVER_PORT}
+${model_invariant_id}    AAI-HealthCheck-Dummy
+${data_path}                ${VERSIONED_INDEX_PATH}/service-design-and-creation/models/model/${model_invariant_id}
+${PUT_data}    {"model-invariant-id": "AAI-HealthCheck-Dummy","model-type": "service"}
+${traversal_data_path}    ${VERSIONED_INDEX_PATH}/query?format=count
+${traversal_data}   {"start" : "service-design-and-creation/models"}
 
 
 *** Keywords ***
@@ -17,6 +22,38 @@ Run A&AI Health Check
     ${resp}=    AAI.Run Get Request    ${AAI_FRONTEND_ENDPOINT}    ${AAI_HEALTH_PATH}    auth=${GLOBAL_AAI_AUTHENTICATION}
     Should Be Equal As Strings         ${resp.status_code}     200
 
+Run Resource API AAI Inventory check
+    [Documentation]    Runs  A&AI Inventory health check Resource API
+    ${GET_res}=    AAI.Run Get Request    ${AAI_FRONTEND_ENDPOINT}    ${data_path}    auth=${GLOBAL_AAI_AUTHENTICATION}
+    Run Keyword If    ${GET_res.status_code}== 200    Run Delete dummy data    ${GET_res}
+    Run Resource API
+
+Run Delete dummy data
+    [Documentation]    Delete Existing dummy data
+    [Arguments]   ${GET_res}
+    ${json} =      Set Variable   ${GET_res.json()}
+    ${resource_version}  Set Variable  ${json["resource-version"]}
+    ${delete_response}=    AAI.Run Delete Request    ${AAI_FRONTEND_ENDPOINT}    ${data_path}    ${resource_version}    auth=${GLOBAL_AAI_AUTHENTICATION}
+    Should Be Equal As Strings  ${delete_response.status_code}     204
+
+Run Resource API
+    [Documentation]    Resource API check with put get and delete request
+    #PUT Request
+    ${Put_resp}=    AAI.Run Put Request    ${AAI_FRONTEND_ENDPOINT}    ${data_path}    ${PUT_data}    auth=${GLOBAL_AAI_AUTHENTICATION}
+    Should Be Equal As Strings  ${Put_resp.status_code}     201
+    #GET Request
+    ${GET_resp}=    AAI.Run Get Request    ${AAI_FRONTEND_ENDPOINT}    ${data_path}    auth=${GLOBAL_AAI_AUTHENTICATION}
+    Should Be Equal As Strings  ${GET_resp.status_code}     200
+    ${res_body}=   Convert to string     ${GET_resp.content}
+    Should contain    ${res_body}   ${model_invariant_id}
+    #DELETE Request
+    Run Delete dummy data    ${GET_resp}
+
+Run Traversal API AAI Inventory check
+    [Documentation]    Runs  A&AI Inventory health check Traversal API
+    ${Put_resp}=    AAI.Run Put Request    ${AAI_FRONTEND_ENDPOINT}    ${traversal_data_path}    ${traversal_data}    auth=${GLOBAL_AAI_AUTHENTICATION}
+    Should Be Equal As Strings  ${Put_resp.status_code}     200
+
 Delete A&AI Entity
     [Documentation]    Deletes an entity in A&AI
     [Arguments]    ${uri}
@@ -27,4 +64,4 @@ Delete A&AI Entity Exists
     [Documentation]    Deletes an  A&AI        entity
     [Arguments]    ${uri}    ${resource_version_id}
     ${put_resp}=    AAI.Run Delete Request    ${AAI_FRONTEND_ENDPOINT}    ${VERSIONED_INDEX_PATH}${uri}    ${resource_version_id}    auth=${GLOBAL_AAI_AUTHENTICATION}
-    Should Be Equal As Strings         ${put_resp.status_code}         204
\ No newline at end of file
+    Should Be Equal As Strings         ${put_resp.status_code}         204
index 3aed94b..9e9e839 100644 (file)
@@ -35,6 +35,11 @@ Basic A&AI Health Check
     [Tags]    health    core  health-aai
     Run A&AI Health Check
 
+Enhanced A&AI Health Check
+    [Tags]    health    core  health-aai
+    Run Resource API AAI Inventory check
+    Run Traversal API AAI Inventory check
+
 Basic AAF Health Check
     [Tags]    health    small  health-aaf
     Run AAF Health Check