[SDNC] Enhance health check for new SDNC version 44/143144/2
authorFiete Ostkamp <fiete.ostkamp@telekom.de>
Mon, 9 Feb 2026 20:42:29 +0000 (21:42 +0100)
committerFiete Ostkamp <fiete.ostkamp@telekom.de>
Mon, 9 Feb 2026 20:53:51 +0000 (21:53 +0100)
- pass test also when the healthcheck endpoint is returning
  a 204 No Content
- keep passing with the old healthcheck response too
- adjust Enhanced SDNC Health Check to not fail when no data
  from previous runs exists

Issue-ID: INT-2351
Change-Id: I7a353f5f8c7e3ab8e3f67763da6f31d1f098e3af
Signed-off-by: Fiete Ostkamp <fiete.ostkamp@telekom.de>
robot/resources/sdnc_interface.robot

index 56c7f93..7d2fb4b 100644 (file)
@@ -34,14 +34,23 @@ ${GR_SI}    GRSIdummy123
 
 *** Keywords ***
 Run SDNC Health Check
-    [Documentation]    Runs an SDNC healthcheck
-    ${resp}=   SDNC.Run Post Request   ${SDNC_REST_ENDPOINT}   ${SDNC_INDEX PATH}${SDNCGC_HEALTHCHECK_OPERATION_PATH}     data=${None}    auth=${GLOBAL_SDNC_AUTHENTICATION}
-    Should Be Equal As Strings         ${resp.status_code}     200
+    [Documentation]    Runs an SDNC healthcheck. Accepts both 200 (older versions) and 204 No Content (newer versions)
+    ${resp}=   SDNC.Run Post Request   ${SDNC_REST_ENDPOINT}   ${SDNC_INDEX_PATH}${SDNCGC_HEALTHCHECK_OPERATION_PATH}     data=${None}    auth=${GLOBAL_SDNC_AUTHENTICATION}
+    Run Keyword If    '${resp.status_code}' == '200'    Validate SDNC 200 Response    ${resp}
+    ...    ELSE IF    '${resp.status_code}' == '204'    Log    SDNC returned 204 No Content (newer version)
+    ...    ELSE    Fail    Expected status code 200 or 204, but got ${resp.status_code}
+
+Validate SDNC 200 Response
+    [Documentation]    Validates the JSON response for SDNC 200 status code
+    [Arguments]    ${resp}
     Should Be Equal As Strings         ${resp.json()['SLI-API: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}
+    # Initial delete is just cleanup - accept 204 (deleted), 404 (not found), or 409 (data-missing)
+    Run Keyword If    '${delete_response.status_code}' not in ['204', '404', '409']
+    ...    Fail    Initial cleanup delete failed with unexpected status: ${delete_response.status_code}
     #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