aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTomasz Wrobel <tomasz.wrobel@nokia.com>2021-09-01 14:24:33 +0200
committerTomasz Wrobel <tomasz.wrobel@nokia.com>2021-09-01 15:32:02 +0200
commit70d73b28bf67092efc4c7983ac04ad759f5056e9 (patch)
treee1b3caeeecaf17602a1dc5d3ea5ef245bba65464 /tests
parentee72614cc6fe35737d24db1c99ceb13b7e5e54fd (diff)
Align HV-VES tests to use mounted config file instead of Consul
Issue-ID: DCAEGEN2-2718 Signed-off-by: Tomasz Wrobel <tomasz.wrobel@nokia.com> Change-Id: Ia16192b432eadab6e2d10ed1435e888f3e700da1
Diffstat (limited to 'tests')
-rw-r--r--tests/dcaegen2-collectors-hv-ves/testcases/__init__.robot10
-rw-r--r--tests/dcaegen2-collectors-hv-ves/testcases/configuration.robot7
-rw-r--r--tests/dcaegen2-collectors-hv-ves/testcases/libraries/ConsulLibrary.py33
-rw-r--r--tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot7
-rw-r--r--tests/dcaegen2-collectors-hv-ves/testcases/resources/hv-ves-configuration-with-different-topic.json16
-rw-r--r--tests/dcaegen2-collectors-hv-ves/testcases/resources/hv-ves-configuration-with-different-topic.yaml9
-rw-r--r--tests/dcaegen2-collectors-hv-ves/testcases/resources/hv-ves-configuration.json27
-rw-r--r--tests/dcaegen2-collectors-hv-ves/testcases/resources/hv-ves-configuration.yaml17
8 files changed, 40 insertions, 86 deletions
diff --git a/tests/dcaegen2-collectors-hv-ves/testcases/__init__.robot b/tests/dcaegen2-collectors-hv-ves/testcases/__init__.robot
index df47b861..5c8258f3 100644
--- a/tests/dcaegen2-collectors-hv-ves/testcases/__init__.robot
+++ b/tests/dcaegen2-collectors-hv-ves/testcases/__init__.robot
@@ -18,9 +18,10 @@
*** Settings ***
Library DcaeAppSimulatorLibrary
-Library ConsulLibrary
Library VesHvContainersUtilsLibrary
+Resource resources/common-keywords.robot
+
Suite Setup HV-VES Collector Suites Setup
*** Keywords ***
@@ -32,10 +33,7 @@ HV-VES Collector Suites Setup
Configure collector
- ${CONSUL_API_ACCESS}= Get Consul Api Access Url ${HTTP_METHOD_URL} ${CONSUL_CONTAINER_HOST} ${CONSUL_CONTAINER_PORT}
- ${CONSUL_API_URL}= Catenate SEPARATOR= ${CONSUL_API_ACCESS} ${CONSUL_HV_VES_CONFIGURATION_KEY_PATH}
- Set Suite Variable ${CONSUL_API_URL} children=True
- Publish HV VES Configuration In Consul ${CONSUL_API_URL} ${HV_VES_CONFIGURATION_JSON_FILEPATH}
+ Set New Mounted Configuration ${HV_VES_CONFIGURATION_JSON_FILEPATH}
Configure Dcae App
Wait until keyword succeeds 10 sec 5 sec
@@ -58,4 +56,4 @@ ${SECOND_PERF3GPP_TOPIC} TEST_HV_VES_PERF3GPP_BUT_WITH_EXT
${DEFAULT_STNDDEFINED_3GPP_HEARTBEAT_TOPIC} TEST_SEC_3GPP_HEARTBEAT_OUTPUT
${HV_VES_RESOURCES} %{WORKSPACE}/tests/dcaegen2-collectors-hv-ves/testcases/resources
-${HV_VES_CONFIGURATION_JSON_FILEPATH} ${HV_VES_RESOURCES}/hv-ves-configuration.json
+${HV_VES_CONFIGURATION_JSON_FILEPATH} ${HV_VES_RESOURCES}/hv-ves-configuration.yaml
diff --git a/tests/dcaegen2-collectors-hv-ves/testcases/configuration.robot b/tests/dcaegen2-collectors-hv-ves/testcases/configuration.robot
index 945cb81e..5f87f89b 100644
--- a/tests/dcaegen2-collectors-hv-ves/testcases/configuration.robot
+++ b/tests/dcaegen2-collectors-hv-ves/testcases/configuration.robot
@@ -18,7 +18,6 @@
*** Settings ***
Library DcaeAppSimulatorLibrary
-Library ConsulLibrary
Library BuiltIn
Resource resources/common-keywords.robot
@@ -35,7 +34,7 @@ Configuration Changes Suite Setup
Change Configuration
[Arguments] ${CONFIGURATION_JSON_FILEPATH} ${MESSAGES_TOPIC}
- Publish HV VES Configuration In Consul ${CONSUL_API_URL} ${CONFIGURATION_JSON_FILEPATH}
+ Set New Mounted Configuration ${CONFIGURATION_JSON_FILEPATH}
# Assure configuration fetch in hv-ves
Sleep 10
@@ -79,5 +78,5 @@ ${HV_VES_SCENARIOS} %{WORKSPACE}/tests/dcaegen2-
${XNF_VALID_MESSAGES_REQUEST} ${HV_VES_SCENARIOS}/configuration-change/xnf-valid-messages-request.json
${HV_VES_RESOURCES} %{WORKSPACE}/tests/dcaegen2-collectors-hv-ves/testcases/resources
-${HV_VES_CONFIGURATION_JSON_FILEPATH} ${HV_VES_RESOURCES}/hv-ves-configuration.json
-${DIFFERENT_TOPIC_CONFIGURATION_JSON_FILEPATH} ${HV_VES_RESOURCES}/hv-ves-configuration-with-different-topic.json
+${HV_VES_CONFIGURATION_JSON_FILEPATH} ${HV_VES_RESOURCES}/hv-ves-configuration.yaml
+${DIFFERENT_TOPIC_CONFIGURATION_JSON_FILEPATH} ${HV_VES_RESOURCES}/hv-ves-configuration-with-different-topic.yaml
diff --git a/tests/dcaegen2-collectors-hv-ves/testcases/libraries/ConsulLibrary.py b/tests/dcaegen2-collectors-hv-ves/testcases/libraries/ConsulLibrary.py
deleted file mode 100644
index 295c4721..00000000
--- a/tests/dcaegen2-collectors-hv-ves/testcases/libraries/ConsulLibrary.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# ============LICENSE_START=======================================================
-# csit-dcaegen2-collectors-hv-ves
-# ================================================================================
-# Copyright (C) 2018 NOKIA
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-from robot.api import logger
-import HttpRequests
-
-CONSUL_NAME = "Consul"
-
-class ConsulLibrary:
-
- def publish_hv_ves_configuration_in_consul(self, consul_url, consul_configuration_filepath):
- logger.info("Reading consul configuration file from: " + consul_configuration_filepath)
- file = open(consul_configuration_filepath, "rb")
- data = file.read()
- file.close()
-
- logger.info("PUT at: " + consul_url)
- resp = HttpRequests.session_without_env().put(consul_url, data=data, timeout=5)
- HttpRequests.checkStatusCode(resp.status_code, CONSUL_NAME) \ No newline at end of file
diff --git a/tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot b/tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot
index b943935d..fa7248a9 100644
--- a/tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot
+++ b/tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot
@@ -23,6 +23,8 @@ Library VesHvContainersUtilsLibrary
Library KafkaLibrary
Library Collections
+Library OperatingSystem
+
*** Keywords ***
Configure Single xNF Simulator
${XNF_PORTS_LIST}= Create List 7000
@@ -70,8 +72,13 @@ VES-HV Collector Suite Teardown
Log Kafka Status
Stop And Remove All Xnf Simulators ${SUITE NAME}
+Set New Mounted Configuration
+ [Arguments] ${NEW_CONFIGURATION_FILE_PATH}
+ Copy File ${NEW_CONFIGURATION_FILE_PATH} ${HV_VES_MOUNTED_CONFIGURATION_FILE_PATH}
+
*** Variables ***
${HTTP_METHOD_URL} http://
${XNF_SIM_API_PATH} /simulator/async
+${HV_VES_MOUNTED_CONFIGURATION_FILE_PATH} %{WORKSPACE}/plans/dcaegen2-collectors-hv-ves/testsuites/collector/configuration/hv-ves-configuration.yaml
diff --git a/tests/dcaegen2-collectors-hv-ves/testcases/resources/hv-ves-configuration-with-different-topic.json b/tests/dcaegen2-collectors-hv-ves/testcases/resources/hv-ves-configuration-with-different-topic.json
deleted file mode 100644
index 7cd830d6..00000000
--- a/tests/dcaegen2-collectors-hv-ves/testcases/resources/hv-ves-configuration-with-different-topic.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "streams_publishes": {
- "perf3gpp": {
- "type": "kafka",
- "aaf_credentials": {
- "username": "admin",
- "password": "admin_secret"
- },
- "kafka_info": {
- "bootstrap_servers": "kafka:9092",
- "topic_name": "TEST_HV_VES_PERF3GPP_BUT_WITH_EXTRA_WORDS"
- }
- }
- }
-}
-
diff --git a/tests/dcaegen2-collectors-hv-ves/testcases/resources/hv-ves-configuration-with-different-topic.yaml b/tests/dcaegen2-collectors-hv-ves/testcases/resources/hv-ves-configuration-with-different-topic.yaml
new file mode 100644
index 00000000..1b507c9b
--- /dev/null
+++ b/tests/dcaegen2-collectors-hv-ves/testcases/resources/hv-ves-configuration-with-different-topic.yaml
@@ -0,0 +1,9 @@
+streams_publishes:
+ perf3gpp:
+ aaf_credentials:
+ password: admin_secret
+ username: admin
+ kafka_info:
+ bootstrap_servers: kafka:9092
+ topic_name: TEST_HV_VES_PERF3GPP_BUT_WITH_EXTRA_WORDS
+ type: kafka
diff --git a/tests/dcaegen2-collectors-hv-ves/testcases/resources/hv-ves-configuration.json b/tests/dcaegen2-collectors-hv-ves/testcases/resources/hv-ves-configuration.json
deleted file mode 100644
index 019e4680..00000000
--- a/tests/dcaegen2-collectors-hv-ves/testcases/resources/hv-ves-configuration.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "streams_publishes": {
- "perf3gpp": {
- "type": "kafka",
- "aaf_credentials": {
- "username": "admin",
- "password": "admin_secret"
- },
- "kafka_info": {
- "bootstrap_servers": "kafka:9092",
- "topic_name": "TEST_HV_VES_PERF3GPP"
- }
- },
- "ves-3gpp-heartbeat": {
- "type": "kafka",
- "aaf_credentials": {
- "username": "admin",
- "password": "admin_secret"
- },
- "kafka_info": {
- "bootstrap_servers": "kafka:9092",
- "topic_name": "TEST_SEC_3GPP_HEARTBEAT_OUTPUT"
- }
- }
- }
-}
-
diff --git a/tests/dcaegen2-collectors-hv-ves/testcases/resources/hv-ves-configuration.yaml b/tests/dcaegen2-collectors-hv-ves/testcases/resources/hv-ves-configuration.yaml
new file mode 100644
index 00000000..0eb41f15
--- /dev/null
+++ b/tests/dcaegen2-collectors-hv-ves/testcases/resources/hv-ves-configuration.yaml
@@ -0,0 +1,17 @@
+streams_publishes:
+ perf3gpp:
+ aaf_credentials:
+ password: admin_secret
+ username: admin
+ kafka_info:
+ bootstrap_servers: kafka:9092
+ topic_name: TEST_HV_VES_PERF3GPP
+ type: kafka
+ ves-3gpp-heartbeat:
+ aaf_credentials:
+ password: admin_secret
+ username: admin
+ kafka_info:
+ bootstrap_servers: kafka:9092
+ topic_name: TEST_SEC_3GPP_HEARTBEAT_OUTPUT
+ type: kafka