From 75a1f2c7f068204948d7e9cc1643e319f6a125de Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Tue, 4 Mar 2025 12:08:17 +0100 Subject: [PATCH] Update deprecated Request syntax in testsuite - replace '[Get,Post,Put,Delete] Request' with '[...] On Session' - declare mod_openssl module for the lighttpd server to address startup warning in the pod Issue-ID: INT-2299 Change-Id: I13343390a2fd275275d39ce963333f94708e9999 Signed-off-by: Fiete Ostkamp --- docker/lighttpd.conf | 1 + requirements.txt | 6 ++++-- robot/resources/aaf_interface.robot | 2 +- robot/resources/cds_interface.robot | 18 +++++++++--------- robot/resources/clamp_interface.robot | 2 +- robot/resources/cli_interface.robot | 3 +-- robot/resources/policy_interface.robot | 30 +++++++++++++++--------------- 7 files changed, 32 insertions(+), 30 deletions(-) diff --git a/docker/lighttpd.conf b/docker/lighttpd.conf index 7fc50dbb..b9d203c0 100644 --- a/docker/lighttpd.conf +++ b/docker/lighttpd.conf @@ -26,6 +26,7 @@ index-file.names = ( "index.html" ) server.modules += ( "mod_auth" ) server.modules += ( "mod_alias" ) server.modules += ( "mod_compress" ) +server.modules += ( "mod_openssl" ) auth.debug = 2 auth.backend = "plain" auth.backend.plain.userfile = "/etc/lighttpd/authorization" diff --git a/requirements.txt b/requirements.txt index 9129ced2..f6c147e4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,10 @@ --extra-index-url https://nexus3.onap.org/repository/PyPi.staging/simple robotframework==3.2.2 pyrsistent==0.16.1 -selenium -robotframework-seleniumlibrary==5.1.0 +# last version to work with chrome_options +# https://github.com/SeleniumHQ/selenium/commit/9f5801c82fb3be3d5850707c46c3f8176e3ccd8e +selenium==4.9.1 +robotframework-seleniumlibrary==4.9.1 robotframework-archivelibrary robotframework-sshlibrary robotframework-httplibrary diff --git a/robot/resources/aaf_interface.robot b/robot/resources/aaf_interface.robot index 28da33d2..5cf223ec 100644 --- a/robot/resources/aaf_interface.robot +++ b/robot/resources/aaf_interface.robot @@ -21,6 +21,6 @@ Run AAF Get Request ${session}= Create Session aaf ${GLOBAL_AAF_SERVER} auth=${GLOBAL_AAF_AUTHENTICATION} ${uuid}= Generate UUID4 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} - ${resp}= Get Request aaf ${data_path} headers=${headers} + ${resp}= GET On Session aaf ${data_path} headers=${headers} Log Received response from aaf ${resp.text} [Return] ${resp} diff --git a/robot/resources/cds_interface.robot b/robot/resources/cds_interface.robot index 358ef64e..73e7dd7c 100644 --- a/robot/resources/cds_interface.robot +++ b/robot/resources/cds_interface.robot @@ -7,8 +7,8 @@ Library OperatingSystem Library String *** Variables *** -${CDS_HEALTH_CHECK_PATH} /api/v1/execution-service/health-check ${CDS_HEALTH_ENDPOINT} ${GLOBAL_CCSDK_CDS_SERVER_PROTOCOL}://${GLOBAL_INJECTED_CCSDK_CDS_BLUEPRINT_PROCESSOR_IP_ADDR}:${GLOBAL_CCSDK_CDS_HEALTH_SERVER_PORT} +${CDS_HEALTH_CHECK_PATH} /api/v1/execution-service/health-check ${CDS_CREATE_DATA_DICTIONARY_ENDPOINT} /api/v1/dictionary/definition ${CDS_RETRIEVE_DATA_DICTIONARY_ENDPOINT} /api/v1/dictionary/search/ ${CDS_BOOTSTRAP_ENDPOINT} /api/v1/blueprint-model/bootstrap @@ -30,7 +30,7 @@ Run CDS Basic Health Check ${auth}= Create List ${GLOBAL_CCSDK_CDS_USERNAME} ${GLOBAL_CCSDK_CDS_PASSWORD} ${session}= Create Session cds ${CDS_HEALTH_ENDPOINT} auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request cds ${CDS_HEALTH_CHECK_PATH} headers=${headers} + ${resp}= GET On Session cds ${CDS_HEALTH_CHECK_PATH} headers=${headers} Log Received response code from cds ${resp} Log Received content from cds ${resp.content} Should Be Equal As Strings ${resp.status_code} 200 @@ -41,7 +41,7 @@ Run CDS Create Data Dictionary Health Check ${session}= Create Session cds ${CDS_HEALTH_ENDPOINT} auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json ${json} Get Binary File ${CREATE_DICTIONARY_JSON_PATH} - ${resp}= Post Request cds ${CDS_CREATE_DATA_DICTIONARY_ENDPOINT} data=${json} headers=${headers} + ${resp}= POST On Session cds ${CDS_CREATE_DATA_DICTIONARY_ENDPOINT} data=${json} headers=${headers} Log Received response code from cds ${resp} Log Received content from cds ${resp.content} Should Be Equal As Strings ${resp.status_code} 200 @@ -51,7 +51,7 @@ Run CDS GET Data Dictionary Health Check ${auth}= Create List ${GLOBAL_CCSDK_CDS_USERNAME} ${GLOBAL_CCSDK_CDS_PASSWORD} ${session}= Create Session cds ${CDS_HEALTH_ENDPOINT} auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request cds ${CDS_RETRIEVE_DATA_DICTIONARY_ENDPOINT}${CDS_CD_TAG} headers=${headers} + ${resp}= GET On Session cds ${CDS_RETRIEVE_DATA_DICTIONARY_ENDPOINT}${CDS_CD_TAG} headers=${headers} Log Received response code from cds ${resp} Log Received content from cds ${resp.content} Should Be Equal As Strings ${resp.status_code} 200 @@ -64,7 +64,7 @@ Run CDS Bootstrap Health Check ${session}= Create Session cds ${CDS_HEALTH_ENDPOINT} auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json ${json_bootstrap} Get Binary File ${BOOTSTRAP_JSON_PATH} - ${resp}= Post Request cds ${CDS_BOOTSTRAP_ENDPOINT} data=${json_bootstrap} headers=${headers} + ${resp}= POST On Session cds ${CDS_BOOTSTRAP_ENDPOINT} data=${json_bootstrap} headers=${headers} Log Received response code from cds ${resp} Log Received content from cds ${resp.content} Should Be Equal As Strings ${resp.status_code} 200 @@ -75,7 +75,7 @@ Run CDS Enrich CBA Health Check ${session}= Create Session cds ${CDS_HEALTH_ENDPOINT} auth=${auth} ${data}= Get Binary File ${CDS_CBA_PACKAGE_FILE} ${file}= Create Dictionary file=${data} - ${resp}= Post Request cds ${CDS_CBA_ENRICH_ENDPOINT} files=${file} + ${resp}= POST On Session cds ${CDS_CBA_ENRICH_ENDPOINT} files=${file} Should Be Equal As Strings ${resp.status_code} 200 Create File ${CDS_CBA_ENRICHED_FILE} ${resp.text} encoding=ISO-8859-1 @@ -85,7 +85,7 @@ Run CDS Publish CBA Health Check ${session}= Create Session cds ${CDS_HEALTH_ENDPOINT} auth=${auth} ${data}= Get Binary File ${CDS_CBA_ENRICHED_FILE} ${file}= Create Dictionary file=${data} - ${resp}= Post Request cds ${CDS_CBA_PUBLISH_ENDPOINT} files=${file} + ${resp}= POST On Session cds ${CDS_CBA_PUBLISH_ENDPOINT} files=${file} Should Be Equal As Strings ${resp.status_code} 200 And ${resp.json()['blueprintModel']['id']}!= ${NONE} Set Global Variable ${blueprintModel} ${resp.json()['blueprintModel']['id']} @@ -95,7 +95,7 @@ Run CDS Process CBA Health Check ${session}= Create Session cds ${CDS_HEALTH_ENDPOINT} auth=${auth} ${headers}= Create Dictionary Accept=*/* Content-Type=application/json ${file} Get Binary File ${CDS_CBA_PROCESS_FILE_PATH} - ${resp}= Post Request cds ${CDS_CBA_PROCESS_API_ENDPOINT} data=${file} headers=${headers} + ${resp}= POST On Session cds ${CDS_CBA_PROCESS_API_ENDPOINT} data=${file} headers=${headers} Should Be Equal As Strings ${resp.status_code} 200 Should Be Equal As Strings ${resp.json()['status']['eventType']} ${SUCCESS} @@ -104,5 +104,5 @@ Run CDS Delete CBA Health Check ${auth}= Create List ${GLOBAL_CCSDK_CDS_USERNAME} ${GLOBAL_CCSDK_CDS_PASSWORD} ${session}= Create Session cds ${CDS_HEALTH_ENDPOINT} auth=${auth} ${headers}= Create Dictionary Accept=*/* Content-Type=application/json - ${resp}= Delete Request cds ${CDS_CBA_DELETE_ENDPOINT}${blueprintModel} headers=${headers} + ${resp}= DELETE On Session cds ${CDS_CBA_DELETE_ENDPOINT}${blueprintModel} headers=${headers} Should Be Equal As Strings ${resp.status_code} 200 diff --git a/robot/resources/clamp_interface.robot b/robot/resources/clamp_interface.robot index fe592329..bf236a7d 100644 --- a/robot/resources/clamp_interface.robot +++ b/robot/resources/clamp_interface.robot @@ -103,7 +103,7 @@ Run CLAMP Get Request [Documentation] Runs CLAMP Get request [Arguments] ${data_path} ${session}= Create Session session ${CLAMP_ENDPOINT} - ${resp}= Get Request session ${data_path} + ${resp}= GET On Session session ${data_path} Should Be Equal As Integers ${resp.status_code} 200 Log Received response from CLAMP ${resp.text} [Return] ${resp} diff --git a/robot/resources/cli_interface.robot b/robot/resources/cli_interface.robot index 01178f0d..5d52c000 100644 --- a/robot/resources/cli_interface.robot +++ b/robot/resources/cli_interface.robot @@ -18,7 +18,6 @@ Run CLI Get Request [Documentation] Runs CLI Get request [Arguments] ${data_path} ${session}= Create Session cli ${CLI_ENDPOINT} - ${resp}= Get Request cli ${data_path} + ${resp}= GET On Session cli ${data_path} Log Received response from CLI ${resp.text} [Return] ${resp} - diff --git a/robot/resources/policy_interface.robot b/robot/resources/policy_interface.robot index 8e87085e..22962658 100644 --- a/robot/resources/policy_interface.robot +++ b/robot/resources/policy_interface.robot @@ -38,7 +38,7 @@ Run Policy Health Check Log Creating session ${POLICY_NEW_HEALTHCHECK_ENDPOINT} ${session}= Create Session policy ${POLICY_NEW_HEALTHCHECK_ENDPOINT} auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy ${POLICY_NEW_HEALTHCHECK_PATH} headers=${headers} + ${resp}= GET On Session policy ${POLICY_NEW_HEALTHCHECK_PATH} headers=${headers} Log Received response from policy ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 Should Be True ${resp.json()['healthy']} @@ -50,7 +50,7 @@ Run Policy Pap Get Request Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy ${data_path} headers=${headers} + ${resp}= GET On Session policy ${data_path} headers=${headers} Log Received response from Policy Pap ${resp.text} [Return] ${resp} @@ -61,7 +61,7 @@ Run Policy Api Get Request ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy ${data_path} headers=${headers} + ${resp}= GET On Session policy ${data_path} headers=${headers} Log Received response from policy API ${resp.text} [Return] ${resp} @@ -72,7 +72,7 @@ Run Policy Api Post Request ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy ${data_path} data=${data} headers=${headers} + ${resp}= POST On Session policy ${data_path} data=${data} headers=${headers} Log Received response from policy ${resp.text} [Return] ${resp} @@ -83,7 +83,7 @@ Run Policy Pap Post Request ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy ${data_path} data=${data} headers=${headers} + ${resp}= POST On Session policy ${data_path} data=${data} headers=${headers} Log Received response from policy ${resp.text} [Return] ${resp} @@ -94,7 +94,7 @@ Undeploy Policy ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Delete Request policy /policy/pap/v1/pdps/policies/${policy_name} headers=${headers} + ${resp}= DELETE On Session policy /policy/pap/v1/pdps/policies/${policy_name} headers=${headers} Log Received response from policy ${resp.text} Should Be Equal As Strings ${resp.status_code} 202 @@ -165,7 +165,7 @@ Run Create Policy Post Request Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json ${json_policy} Get Binary File ${json_path_policy}create_policy.json - ${resp}= Post Request policy ${POLICY_CREATE_POLICY_URI} data=${json_policy} headers=${headers} + ${resp}= POST On Session policy ${POLICY_CREATE_POLICY_URI} data=${json_policy} headers=${headers} Log Received response from policy ${resp.text} [Return] ${resp} Should Be Equal As Strings ${resp.status_code} 201 @@ -177,7 +177,7 @@ Run Get Policy Get Request ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy ${POLICY_GET_POLICY_URI} headers=${headers} + ${resp}= GET On Session policy ${POLICY_GET_POLICY_URI} headers=${headers} expected_status=any Log Received response from policy ${resp.text} [Return] ${resp} @@ -189,7 +189,7 @@ Run Deploy Policy Pap Post Request Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json ${json_deploy} Get Binary File ${json_path_policy}deploy_policy.json - ${resp}= Post Request policy /policy/pap/v1/pdps/policies data=${json_deploy} headers=${headers} + ${resp}= POST On Session policy /policy/pap/v1/pdps/policies data=${json_deploy} headers=${headers} Log Received response from policy ${resp.text} [Return] ${resp} Should Be Equal As Strings ${resp.status_code} 202 @@ -201,7 +201,7 @@ Run Undeploy Policy ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Delete Request policy /policy/pap/v1/pdps/policies/operational.modifyconfig headers=${headers} + ${resp}= DELETE On Session policy /policy/pap/v1/pdps/policies/operational.modifyconfig headers=${headers} Log Received response from policy ${resp.text} Should Be Equal As Strings ${resp.status_code} 202 @@ -212,7 +212,7 @@ Run Undeploy vFW Monitoring Policy ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Delete Request policy /policy/pap/v1/pdps/policies/onap.vfirewall.tca headers=${headers} + ${resp}= DELETE On Session policy /policy/pap/v1/pdps/policies/onap.vfirewall.tca headers=${headers} Log Received response from policy ${resp.text} Should Be Equal As Strings ${resp.status_code} 202 @@ -224,7 +224,7 @@ Run Delete vFW Monitoring Policy ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies/onap.vfirewall.tca/versions/1.0.0 headers=${headers} + ${resp}= DELETE On Session policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies/onap.vfirewall.tca/versions/1.0.0 headers=${headers} Log Received response from policy ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 @@ -235,7 +235,7 @@ Run Delete vFW Operational Policy ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies/operational.modifyconfig/versions/1.0.0 headers=${headers} + ${resp}= DELETE On Session policy /policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies/operational.modifyconfig/versions/1.0.0 headers=${headers} Log Received response from policy ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 @@ -246,7 +246,7 @@ Run Delete Policy Request ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Delete Request policy ${POLICY_GET_POLICY_URI} headers=${headers} + ${resp}= DELETE On Session policy ${POLICY_GET_POLICY_URI} headers=${headers} Log Received response from policy ${resp.text} [Return] ${resp} Should Be Equal As Strings ${resp.status_code} 200 @@ -257,7 +257,7 @@ Run Policy Deployment Verification ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp_deployed_policy}= Get Request policy ${POLICY_PAP_STATUS_QUERY} headers=${headers} + ${resp_deployed_policy}= GET On Session policy ${POLICY_PAP_STATUS_QUERY} headers=${headers} Log Received response from policy status ${resp_deployed_policy.text} Return From Keyword If ${resp_deployed_policy.status_code}==404 Should Be Equal As Strings ${resp_deployed_policy.status_code} 200 -- 2.16.6