aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbenzelleroehr <ben.zelleroehr@telekom.de>2025-03-20 11:41:28 +0100
committerbenzelleroehr <ben.zelleroehr@telekom.de>2025-03-20 11:49:21 +0100
commitdec5a744f6b9e3222002b2eb46212e142e22c427 (patch)
tree705acb769615a5a80b0b59c33107097504dd1ea9
parent3474722cb30d86b0d41a56323fd66d4710e0f750 (diff)
Fix: vescollector testcases
- change the use of dmaap to kafka in vescollector testcases Issue-ID: INT-2305 Change-Id: Idd0d11a244f72bb8f1a08124b2a295bc4bef159a Signed-off-by: benzelleroehr <ben.zelleroehr@telekom.de>
-rw-r--r--robot/resources/dcae/ves_interface.robot36
-rw-r--r--robot/resources/strimzi_kafka.robot5
-rw-r--r--robot/resources/usecases/5gbulkpm_helm_interface.robot2
-rw-r--r--robot/testsuites/ves.robot10
4 files changed, 22 insertions, 31 deletions
diff --git a/robot/resources/dcae/ves_interface.robot b/robot/resources/dcae/ves_interface.robot
index 5cf081b7..89abbcdc 100644
--- a/robot/resources/dcae/ves_interface.robot
+++ b/robot/resources/dcae/ves_interface.robot
@@ -1,7 +1,9 @@
+*** Settings ***
Documentation The main interface for interacting with VES Collector
-Library RequestsLibrary
+Library RequestsLibrary
Library OperatingSystem
Library String
+Resource ../strimzi_kafka.robot
*** Variables ***
${INVENTORY_SERVER} ${GLOBAL_INVENTORY_SERVER_PROTOCOL}://${GLOBAL_INVENTORY_SERVER_NAME}:${GLOBAL_INVENTORY_SERVER_PORT}
@@ -17,11 +19,11 @@ ${PerformanceAssurance_json} ${EXECDIR}/robot/assets/dcae
${Provisioning_json} ${EXECDIR}/robot/assets/dcae/ves_stdnDefined_3GPP-Provisioning.json
${MR_TOPIC_CHECK_PATH} /topics
${DR_SUB_CHECK_PATH} /internal/prov
-${MR_TOPIC_URL_PATH} /events/unauthenticated.SEC_FAULT_OUTPUT/CG1/C1
-${MR_FAULTSUPERVISION_TOPIC_URL_PATH} /events/unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT/CG1/C1
-${MR_HEARTBEAT_TOPIC_URL_PATH} /events/unauthenticated.SEC_3GPP_HEARTBEAT_OUTPUT/CG1/C1
-${MR_PERFORMANCEASSURANCE_TOPIC_URL_PATH} /events/unauthenticated.SEC_3GPP_PERFORMANCEASSURANCE_OUTPUT/CG1/C1
-${MR_PROVISIONING_TOPIC_URL_PATH} /events/unauthenticated.SEC_3GPP_PROVISIONING_OUTPUT/CG1/C1
+${MR_TOPIC_URL_PATH} unauthenticated.SEC_FAULT_OUTPUT
+${MR_FAULTSUPERVISION_TOPIC_URL_PATH} unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT
+${MR_HEARTBEAT_TOPIC_URL_PATH} unauthenticated.SEC_3GPP_HEARTBEAT_OUTPUT
+${MR_PERFORMANCEASSURANCE_TOPIC_URL_PATH} unauthenticated.SEC_3GPP_PERFORMANCEASSURANCE_OUTPUT
+${MR_PROVISIONING_TOPIC_URL_PATH} unauthenticated.SEC_3GPP_PROVISIONING_OUTPUT
${DMAAP_BC_MR_CLIENT_PATH} /webapi/mr_clients
${DMAAP_BC_MR_CLUSTER_PATH} /webapi/mr_clusters
${VES_LISTENER_PATH} /eventListener/v7
@@ -40,26 +42,14 @@ Send Event to VES Collector
Should Be Equal As Strings ${resp.status_code} 202
Topic Validate
- [Documentation] Keyword checks content of DMAAP topic and evaluate it's content with desired value
+ [Documentation] Keyword checks content of Kafka topic and evaluate it's content with desired value
[Arguments] ${topic_name} ${expected_text}
- ${timestamp}= Get Current Date
- ${dict}= Create Dictionary timestamp=${timestamp}
- Templating.Create Environment mr ${GLOBAL_TEMPLATE_FOLDER}
- ${data}= Templating.Apply Template mr ${MR_PUBLISH_TEMPLATE} ${dict}
- ${resp}= Run MR Get Request ${topic_name}
- Should Contain ${resp.text} ${expected_text}
+ ${bytes}= Encode String To Bytes ${expected_text} UTF-8
+ ${resp}= Get Last Message From Topic ${topic_name}
+ Should Contain ${resp} ${bytes}
Send Event to VES & Validate Topic
- [Documentation] Keyword is a test template which alows to send event through VES Collector and check if ivent is routed to proper DMAAP topic
+ [Documentation] Keyword is a test template which alows to send event through VES Collector and check if ivent is routed to proper Kafka topic
[Arguments] ${event} ${topic_name} ${expected_text}
Send Event to VES Collector ${event}
Wait Until Keyword Succeeds 10x 1s Topic Validate ${topic_name} ${expected_text}
-
-Activate DMAAP Topics
- [Documentation] Currently first event routed to empty DMAAP topic is gone, so there is need to "activate" topics for testing pourposes
- Wait Until Keyword Succeeds 10x 5s Send Event to VES & Validate Topic ${ves7_valid_json} ${MR_TOPIC_URL_PATH} Fault_Vscf:Acs-Ericcson_PilotNumberPoolExhaustion
- Wait Until Keyword Succeeds 10x 5s Send Event to VES & Validate Topic ${FaultSupervision_json} ${MR_FAULTSUPERVISION_TOPIC_URL_PATH} ves_stdnDefined_3GPP-FaultSupervision
- Wait Until Keyword Succeeds 10x 5s Send Event to VES & Validate Topic ${Heartbeat_json} ${MR_HEARTBEAT_TOPIC_URL_PATH} ves_stdnDefined_3GPP-Heartbeat
- Wait Until Keyword Succeeds 10x 5s Send Event to VES & Validate Topic ${PerformanceAssurance_json} ${MR_PERFORMANCEASSURANCE_TOPIC_URL_PATH} ves_stdnDefined_3GPP-PerformanceAssurance
- Wait Until Keyword Succeeds 10x 5s Send Event to VES & Validate Topic ${Provisioning_json} ${MR_PROVISIONING_TOPIC_URL_PATH} ves_stdnDefined_3GPP-Provisioning
- Sleep 10s
diff --git a/robot/resources/strimzi_kafka.robot b/robot/resources/strimzi_kafka.robot
index 262d28e6..c8c8e484 100644
--- a/robot/resources/strimzi_kafka.robot
+++ b/robot/resources/strimzi_kafka.robot
@@ -14,10 +14,11 @@ ${KAFKA_GET_PASSWORD} kubectl -n onap get secret strimzi-kafka-admin -o jso
*** Keywords ***
Get Last Message From Topic
[Documentation] Decode last message from Kafka topic.
- [Arguments] ${kafka_server} ${kafka_topic} ${username}
+ [Arguments] ${kafka_topic}
${command_output} = Run And Return Rc And Output ${KAFKA_GET_PASSWORD}
Should Be Equal As Integers ${command_output[0]} 0
${password} Set Variable ${command_output[1]}
- Connect kafka ${kafka_server} ${username} ${password} SCRAM-SHA-512
+ Connect kafka ${GLOBAL_KAFKA_BOOTSTRAP_SERVICE} ${GLOBAL_KAFKA_USER} ${password} SCRAM-SHA-512
${msg}= Consume kafka ${kafka_topic}
[Return] ${msg}
+
diff --git a/robot/resources/usecases/5gbulkpm_helm_interface.robot b/robot/resources/usecases/5gbulkpm_helm_interface.robot
index 17a5cff0..e02f04dd 100644
--- a/robot/resources/usecases/5gbulkpm_helm_interface.robot
+++ b/robot/resources/usecases/5gbulkpm_helm_interface.robot
@@ -35,7 +35,7 @@ xNF PM File Validate
... This keyword gets the last event from the PM topic and validates if the expected string is present: "${expected_pm_str}" .
[Arguments] ${expected_pm_str}
${bytes} = Encode String To Bytes ${expected_pm_str} UTF-8
- ${msg}= Run Keyword Get Last Message From Topic ${GLOBAL_KAFKA_BOOTSTRAP_SERVICE} unauthenticated.PERFORMANCE_MEASUREMENTS ${GLOBAL_KAFKA_USER}
+ ${msg}= Run Keyword Get Last Message From Topic unauthenticated.PERFORMANCE_MEASUREMENTS
Should Contain ${msg} ${bytes}
diff --git a/robot/testsuites/ves.robot b/robot/testsuites/ves.robot
index 8e98f860..bb867160 100644
--- a/robot/testsuites/ves.robot
+++ b/robot/testsuites/ves.robot
@@ -19,11 +19,11 @@ Suite Setup Activate DMAAP Topics
*** Variables ***
${MR_TOPIC_CHECK_PATH} /topics
${DR_SUB_CHECK_PATH} /internal/prov
-${MR_TOPIC_URL_PATH} /events/unauthenticated.SEC_FAULT_OUTPUT/CG1/C1
-${MR_FAULTSUPERVISION_TOPIC_URL_PATH} /events/unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT/CG1/C1
-${MR_HEARTBEAT_TOPIC_URL_PATH} /events/unauthenticated.SEC_3GPP_HEARTBEAT_OUTPUT/CG1/C1
-${MR_PERFORMANCEASSURANCE_TOPIC_URL_PATH} /events/unauthenticated.SEC_3GPP_PERFORMANCEASSURANCE_OUTPUT/CG1/C1
-${MR_PROVISIONING_TOPIC_URL_PATH} /events/unauthenticated.SEC_3GPP_PROVISIONING_OUTPUT/CG1/C1
+${MR_TOPIC_URL_PATH} unauthenticated.SEC_FAULT_OUTPUT
+${MR_FAULTSUPERVISION_TOPIC_URL_PATH} unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT
+${MR_HEARTBEAT_TOPIC_URL_PATH} unauthenticated.SEC_3GPP_HEARTBEAT_OUTPUT
+${MR_PERFORMANCEASSURANCE_TOPIC_URL_PATH} unauthenticated.SEC_3GPP_PERFORMANCEASSURANCE_OUTPUT
+${MR_PROVISIONING_TOPIC_URL_PATH} unauthenticated.SEC_3GPP_PROVISIONING_OUTPUT
${DMAAP_BC_MR_CLIENT_PATH} /webapi/mr_clients
${DMAAP_BC_MR_CLUSTER_PATH} /webapi/mr_clusters
${VES_LISTENER_PATH} /eventListener/v7