Align HV-VES tests to use mounted config file instead of Consul
[integration/csit.git] / tests / dcaegen2-collectors-hv-ves / testcases / configuration.robot
1 # ============LICENSE_START=======================================================
2 # csit-dcaegen2-collectors-hv-ves
3 # ================================================================================
4 # Copyright (C) 2019 NOKIA
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=========================================================
18
19 *** Settings ***
20 Library       DcaeAppSimulatorLibrary
21 Library       BuiltIn
22
23 Resource      resources/common-keywords.robot
24
25 Suite Setup       Configuration Changes Suite Setup
26 Suite Teardown    VES-HV Collector Suite Teardown
27 Test Teardown     VES-HV Collector Test Shutdown
28
29 *** Keywords ***
30 Configuration Changes Suite Setup
31     Log   Started Suite: VES-HV Client Configuration Changes
32     Configure Single xNF Simulator
33     Log   Suite setup finished
34
35 Change Configuration
36     [Arguments]   ${CONFIGURATION_JSON_FILEPATH}   ${MESSAGES_TOPIC}
37     Set New Mounted Configuration    ${CONFIGURATION_JSON_FILEPATH}
38     # Assure configuration fetch in hv-ves
39     Sleep  10
40
41 *** Test Cases ***
42 Configuration change
43     [Tags]   non-critical
44     [Documentation]   VES-HV Collector should adapt to changing configuration
45     # Given
46     Change Configuration   ${DIFFERENT_TOPIC_CONFIGURATION_JSON_FILEPATH}   ${SECOND_PERF3GPP_TOPIC}
47
48     # When
49     Send Messages From xNF Simulators   ${XNF_SIMULATOR}   ${XNF_VALID_MESSAGES_REQUEST}
50
51     # Then they are published to this topic
52     Wait until keyword succeeds   30 sec   3 sec
53     ...     Assert Dcae App Consumed   ${SECOND_PERF3GPP_TOPIC}   ${AMOUNT_1000}
54     Assert Dcae App Consumed   ${DEFAULT_PERF3GPP_TOPIC}   ${AMOUNT_0}
55
56     Log   First configuration change assertion passed
57     Reset DCAE App Simulator  ${DEFAULT_PERF3GPP_TOPIC}
58     Reset DCAE App Simulator  ${SECOND_PERF3GPP_TOPIC}
59
60     # Given configuration change
61     Change Configuration   ${HV_VES_CONFIGURATION_JSON_FILEPATH}   ${DEFAULT_PERF3GPP_TOPIC}
62
63     # When
64     Send Messages From xNF Simulators   ${XNF_SIMULATOR}   ${XNF_VALID_MESSAGES_REQUEST}
65
66     # Then they are published to this topic
67     Wait until keyword succeeds   30 sec   3 sec
68     ...     Assert Dcae App Consumed   ${DEFAULT_PERF3GPP_TOPIC}   ${AMOUNT_1000}
69     Assert Dcae App Consumed   ${SECOND_PERF3GPP_TOPIC}   ${AMOUNT_0}
70
71
72
73 *** Variables ***
74 ${AMOUNT_0}                                         0
75 ${AMOUNT_1000}                                      1000
76
77 ${HV_VES_SCENARIOS}                                 %{WORKSPACE}/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios
78 ${XNF_VALID_MESSAGES_REQUEST}                       ${HV_VES_SCENARIOS}/configuration-change/xnf-valid-messages-request.json
79
80 ${HV_VES_RESOURCES}                                 %{WORKSPACE}/tests/dcaegen2-collectors-hv-ves/testcases/resources
81 ${HV_VES_CONFIGURATION_JSON_FILEPATH}               ${HV_VES_RESOURCES}/hv-ves-configuration.yaml
82 ${DIFFERENT_TOPIC_CONFIGURATION_JSON_FILEPATH}      ${HV_VES_RESOURCES}/hv-ves-configuration-with-different-topic.yaml