1 # ============LICENSE_START=======================================================
2 # csit-dcaegen2-collectors-hv-ves
3 # ================================================================================
4 # Copyright (C) 2018 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
10 # http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
20 Library DcaeAppSimulatorLibrary
22 Resource resources/common-keywords.robot
24 Suite Setup Client Authorization Suite Setup
25 Suite Teardown VES-HV Collector Suite Teardown
26 Test Teardown VES-HV Collector Test Shutdown
29 Client Authorization Suite Setup
30 Log Started Suite: VES-HV Client Authorization
31 ${XNF_PORTS_LIST}= Create List 7000
32 ${XNF_WITH_INVALID_CERTIFICATES}= Configure xNF Simulators ${XNF_PORTS_LIST}
33 ... should_use_valid_certs=${false}
34 Set Suite Variable ${XNF_WITH_INVALID_CERTIFICATES}
35 ${XNF_PORTS_LIST}= Create List 7001
36 ${XNF_WITHOUT_SSL}= Configure xNF Simulators ${XNF_PORTS_LIST}
37 ... should_disable_ssl=${true}
38 Set Suite Variable ${XNF_WITHOUT_SSL}
39 ${XNF_PORTS_LIST}= Create List 7002
40 ${XNF_WITHOUT_SSL_CONNECTING_TO_UNENCRYPTED_HV_VES}= Configure xNF Simulators ${XNF_PORTS_LIST}
41 ... should_disable_ssl=${true}
42 ... should_connect_to_unencrypted_hv_ves=${true}
43 Set Suite Variable ${XNF_WITHOUT_SSL_CONNECTING_TO_UNENCRYPTED_HV_VES}
44 Log Suite setup finished
48 [Documentation] VES-HV Collector should not authorize XNF with invalid certificate and not route any message
51 Send Messages From xNF Simulators ${XNF_WITH_INVALID_CERTIFICATES} ${XNF_VALID_MESSAGES_REQUEST}
53 Wait until keyword succeeds 60 sec 5 sec
54 ... Assert Dcae App Consumed ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_0}
56 Unencrypted connection from client
57 [Documentation] VES-HV Collector should not authorize XNF trying to connect through unencrypted connection
59 Send Messages From xNF Simulators ${XNF_WITHOUT_SSL} ${XNF_VALID_MESSAGES_REQUEST}
61 Wait until keyword succeeds 60 sec 5 sec
62 ... Assert Dcae App Consumed ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_0}
64 Unencrypted connection on both ends
65 [Documentation] When run without SSL turned on, VES-HV Collector should route all valid messages
66 ... from xNF trying to connect through unencrypted connection
68 Send Messages From xNF Simulators ${XNF_WITHOUT_SSL_CONNECTING_TO_UNENCRYPTED_HV_VES} ${XNF_VALID_MESSAGES_REQUEST}
70 Wait until keyword succeeds 60 sec 5 sec
71 ... Assert Dcae App Consumed ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_5000}
75 ${HV_VES_SCENARIOS} %{WORKSPACE}/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios
77 ${XNF_VALID_MESSAGES_REQUEST} ${HV_VES_SCENARIOS}/authorization/xnf-valid-messages-request.json