SDNC new Healthcheck TC 69/112469/4
authordeswali07 <biswajit.deswali@amdocs.com>
Thu, 10 Sep 2020 10:17:47 +0000 (15:47 +0530)
committerMorgan Richomme <morgan.richomme@orange.com>
Tue, 22 Sep 2020 15:53:59 +0000 (15:53 +0000)
Issue-ID: SDNC-1349
Change-Id: I2c44e5e470950c7592a74d24ff117f9df79ff4ec
Signed-off-by: deswali07 <biswajit.deswali@amdocs.com>
robot/resources/sdnc_interface.robot
robot/testsuites/health-check.robot

index d8a73cf..2e71421 100644 (file)
@@ -28,6 +28,9 @@ ${SDNC_ADMIN_ENDPOINT}    ${GLOBAL_SDNC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDN
 ${SDNC_ADMIN_SIGNUP_URL}    ${SDNC_ADMIN_ENDPOINT}/signup
 ${SDNC_ADMIN_LOGIN_URL}    ${SDNC_ADMIN_ENDPOINT}/login
 ${SDNC_ADMIN_VNF_PROFILE_URL}    ${SDNC_ADMIN_ENDPOINT}/mobility/getVnfProfile
+${GRAPI_SIPath}     ${SDNC_INDEX_PATH}/config/GENERIC-RESOURCE-API:services/service/${GR_SI}
+${Data_GRAPI}    { "service": [ { "service-instance-id": "GRSIdummy123" } ] }
+${GR_SI}    GRSIdummy123
 
 *** Keywords ***
 Run SDNC Health Check
@@ -36,6 +39,30 @@ Run SDNC Health Check
     Should Be Equal As Strings         ${resp.status_code}     200
     Should Be Equal As Strings         ${resp.json()['output']['response-code']}       200
 
+Run SDNC Health Check Generic Resource API
+    [Documentation]    Runs an GENERIC-RESOURCE-API API check for SDNC healthcheck
+    ${delete_response}    Run SDNC Delete Request    ${GRAPI_SIPath}
+    #Put Dummy data
+    ${Put_resp}=    SDNC.Run Put Request   ${SDNC_REST_ENDPOINT}    ${GRAPI_SIPath}    data=${Data_GRAPI}    auth=${GLOBAL_SDNC_AUTHENTICATION}
+    Should Be Equal As Strings  ${Put_resp.status_code}     201
+    #Get request and validation
+    ${resp}=    SDNC.Run Get Request    ${SDNC_REST_ENDPOINT}    ${GRAPI_SIPath}    auth=${GLOBAL_SDNC_AUTHENTICATION}
+    Should Be Equal As Strings  ${resp.status_code}     200
+    ${res_body}=   Convert to string     ${resp.content}
+    Should contain    ${res_body}   ${GR_SI}
+    #Delete Dummy Data
+    ${delete_response}    Run SDNC Delete Request    ${GRAPI_SIPath}
+    Should Be Equal As Strings  ${delete_response.status_code}     200
+
+Run SDNC Delete Request
+    [Documentation]    Runs an SDNC Delete Request
+    [Arguments]    ${URL}
+    Disable Warnings
+    ${session}=    Create Session       SDNC     ${SDNC_REST_ENDPOINT}    auth=${GLOBAL_SDNC_AUTHENTICATION}
+    ${headers}=  Create Dictionary     Accept=*/*    Accept-Encoding=gzip, deflate, br    Connection=keep-alive
+    ${resp}=    Delete Request  SDNC     ${URL}     data=${None}    headers=${headers}
+    [Return]    ${resp}
+
 Preload Vcpe Networks
     Preload Network    cpe_public    10.2.0.2   10.2.0.1
     Preload Network    cpe_signal    10.4.0.2    10.4.0.1
index 5624b84..c80ed71 100644 (file)
@@ -197,6 +197,10 @@ Basic SDNC Health Check
     [Tags]    health    core   health-sdnc
     Run SDNC Health Check
 
+Enhanced SDNC Health Check
+    [Tags]    health    core   health-sdnc
+    Run SDNC Health Check Generic Resource API
+
 Basic SO Health Check
     [Tags]    health    core   health-so
     SO.Run Get Request    ${GLOBAL_SO_APIHAND_ENDPOINT}    ${GLOBAL_SO_HEALTH_CHECK_PATH}