summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--robot/resources/dcae/hvves.robot40
-rw-r--r--robot/testsuites/hvves.robot20
2 files changed, 44 insertions, 16 deletions
diff --git a/robot/resources/dcae/hvves.robot b/robot/resources/dcae/hvves.robot
index 898c2866..e838aa9e 100644
--- a/robot/resources/dcae/hvves.robot
+++ b/robot/resources/dcae/hvves.robot
@@ -1,16 +1,22 @@
*** Settings ***
-Documentation Template contains stuff for HV-VES use case.
-Library OperatingSystem
-Library RequestsLibrary
-Library BuiltIn
-Library Collections
-Library ONAPLibrary.Utilities
+Documentation Template contains stuff for HV-VES use case.
+Library OperatingSystem
+Library RequestsLibrary
+Library BuiltIn
+Library Collections
+Library ONAPLibrary.Utilities
Library String
Library ONAPLibrary.Kafka
Resource ../mr_interface.robot
+Resource ../consul_interface.robot
*** Variables ***
${HVVES_MESSAGE} \xaa\x01\x00\x00\x00\x00\x00\x01\x00\x00\x01'\n\x94\x02\n\x0esample-version\x12\x08perf3gpp\x18\x01 \x01*\nperf3GPP222\x11sample-event-name:\x11sample-event-type@\xf1\x9a\xfd\xdd\x05H\xf1\x9a\xfd\xdd\x05R\x15sample-nf-naming-codeZ\x16sample-nfc-naming-codeb\x15sample-nf-vendor-namej\x1asample-reporting-entity-idr\x1csample-reporting-entity-namez\x10sample-source-id\x82\x01\x0fsample-xnf-name\x8a\x01\tUTC+02:00\x92\x01\x057.0.2\x12\x0etest test test
+${HVVES_CONFIG_SSL} {"security.sslDisable": false, "logLevel": "INFO", "security.keys.trustStoreFile": "/tmp/ca.p12", "server.listenPort": 6061, "server.idleTimeoutSec": 300, "cbs.requestIntervalSec": 5, "streams_publishes": {"perf3gpp": {"type": "kafka", "aaf_credentials": {"username": "admin", "password": "admin_secret"}, "kafka_info": {"bootstrap_servers": "message-router-kafka:9092", "topic_name": "HV_VES_PERF3GPP_SSL"}}}, "security.keys.keyStoreFile": "/tmp/server.p12", "security.keys.trustStorePasswordFile": "/dev/null", "security.keys.keyStorePasswordFile": "/dev/null"}
+${HVVES_CONFIG} {"security.sslDisable": true, "logLevel": "INFO", "security.keys.trustStoreFile": "/tmp/ca.p12", "server.listenPort": 6061, "server.idleTimeoutSec": 300, "cbs.requestIntervalSec": 5, "streams_publishes": {"perf3gpp": {"type": "kafka", "aaf_credentials": {"username": "admin", "password": "admin_secret"}, "kafka_info": {"bootstrap_servers": "message-router-kafka:9092", "topic_name": "HV_VES_PERF3GPP"}}}, "security.keys.keyStoreFile": "/tmp/server.p12", "security.keys.trustStorePasswordFile": "/dev/null", "security.keys.keyStorePasswordFile": "/dev/null"}
+${CA_CERT} /tmp/ca.pem
+${CLIENT_CERT} /tmp/client.pem
+${CLIENT_KEY} /tmp/client.key
*** Keywords ***
Check Message Router Api
@@ -26,19 +32,31 @@ Check If Topic Exists
[Arguments] ${message_router} ${message_router_port} ${topic}
${session}= Create Session session http://${message_router}:${message_router_port}/topics
${resp}= Get Request session /
- ${value}= Catenate ${resp.json()['topics']}
+ ${value}= Catenate ${resp.json()['topics']}
Should Contain ${value} ${topic}
-Start HV-VES TCP Client And Send Message
- [Documentation] Starts HV-VES TCP client sends message to the collector.
+Send Message
+ [Documentation] Sends message to HV-VES over TCP.
[Arguments] ${hvves_server_ip} ${hvves_server_port}
${msg}= Convert To Bytes ${HVVES_MESSAGE}
Send Binary Data ${hvves_server_ip} ${hvves_server_port} ${msg}
+Send Message Over Ssl
+ [Documentation] Sends message to HV-VES over TCP wih SSL enabled.
+ [Arguments] ${hvves_server_ip} ${hvves_server_port}
+ ${msg}= Convert To Bytes ${HVVES_MESSAGE}
+ Send Binary Data ${hvves_server_ip} ${hvves_server_port} ${msg} ${TRUE} ${TRUE} ${CA_CERT} ${CLIENT_CERT} ${CLIENT_KEY}
+
Decode Last Message From Topic
[Documentation] Decode last message from Kafka topic.
[Arguments] ${kafka_server} ${kafka_port} ${kafka_topic} ${username} ${password}
- Connect kakfa ${kafka_server}:${kafka_port} ${username} ${password}
- ${msg}= Consume kakfa ${kafka_topic}
+ Connect kafka ${kafka_server}:${kafka_port} ${username} ${password}
+ ${msg}= Consume kafka ${kafka_topic}
[Return] ${msg}
+Mode
+ [Documentation] Changes HV-VES config.
+ [Arguments] ${config}
+ ${resp}= Run Consul Put Request /v1/kv/dcae-hv-ves-collector?dc=dc1 ${config}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Sleep 10s
diff --git a/robot/testsuites/hvves.robot b/robot/testsuites/hvves.robot
index 73ef1c10..383ef255 100644
--- a/robot/testsuites/hvves.robot
+++ b/robot/testsuites/hvves.robot
@@ -1,21 +1,31 @@
*** Settings ***
Documentation HV-VES 'Sunny Scenario' Robot Framework test - message is sent to the collector and Kafka topic is checked if the message has been published. Content is decoded and checked.
Default Tags hvves ete
-Test Timeout 3m
+Test Timeout 1m
Resource ../resources/global_properties.robot
Resource ../resources/dcae/hvves.robot
Library OperatingSystem
-Library ONAPLibrary.Protobuf
+Library ONAPLibrary.Protobuf
*** Variable ***
${HVVES_KAFKA_TOPIC} HV_VES_PERF3GPP
+${HVVES_KAFKA_TOPIC_SSL} HV_VES_PERF3GPP_SSL
*** Test Cases ***
HV-VES test case
Check Message Router Api ${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_NAME} ${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_PORT} ${HVVES_KAFKA_TOPIC}
- Start HV-VES TCP Client And Send Message ${GLOBAL_DCAE_HVVES_SERVER_NAME} ${GLOBAL_DCAE_HVVES_SERVER_PORT}
- Wait Until Keyword Succeeds 30s 5s Check If Topic Exists ${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_NAME} ${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_PORT} ${HVVES_KAFKA_TOPIC}
+ Send Message ${GLOBAL_DCAE_HVVES_SERVER_NAME} ${GLOBAL_DCAE_HVVES_SERVER_PORT}
+ Wait Until Keyword Succeeds 10s 2s Check If Topic Exists ${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_NAME} ${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_PORT} ${HVVES_KAFKA_TOPIC}
Check Message Router Api ${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_NAME} ${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_PORT} ${HVVES_KAFKA_TOPIC}
${msg}= Decode Last Message From Topic ${GLOBAL_DMAAP_KAFKA_SERVER_NAME} ${GLOBAL_DMAAP_KAFKA_SERVER_PORT} ${HVVES_KAFKA_TOPIC} ${GLOBAL_DMAAP_KAFKA_JAAS_USERNAME} ${GLOBAL_DMAAP_KAFKA_JAAS_PASSWORD}
${results}= Compare File To Message ${EXECDIR}/robot/assets/dcae/hvves_msg.raw ${msg}
- Should Be True ${results} \ No newline at end of file
+ Should Be True ${results}
+HV-VES SSL test case
+ Mode ${HVVES_CONFIG_SSL}
+ Send Message Over Ssl ${GLOBAL_DCAE_HVVES_SERVER_NAME} ${GLOBAL_DCAE_HVVES_SERVER_PORT}
+ Wait Until Keyword Succeeds 10s 2s Check If Topic Exists ${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_NAME} ${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_PORT} ${HVVES_KAFKA_TOPIC_SSL}
+ Check Message Router Api ${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_NAME} ${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_PORT} ${HVVES_KAFKA_TOPIC_SSL}
+ ${msg}= Decode Last Message From Topic ${GLOBAL_DMAAP_KAFKA_SERVER_NAME} ${GLOBAL_DMAAP_KAFKA_SERVER_PORT} ${HVVES_KAFKA_TOPIC_SSL} ${GLOBAL_DMAAP_KAFKA_JAAS_USERNAME} ${GLOBAL_DMAAP_KAFKA_JAAS_PASSWORD}
+ ${results}= Compare File To Message ${EXECDIR}/robot/assets/dcae/hvves_msg.raw ${msg}
+ Should Be True ${results}
+ [Teardown] Mode ${HVVES_CONFIG}