aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot
blob: b943935d95c6e64a1b2184dcbda7e7cd28517e51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# ============LICENSE_START=======================================================
# csit-dcaegen2-collectors-hv-ves
# ================================================================================
# Copyright (C) 2018-2021 NOKIA
# Modification copyright (C) 2021 Samsung Electronics Co., Ltd.
# ================================================================================
# 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=========================================================

*** Settings ***
Library       XnfSimulatorLibrary
Library       VesHvContainersUtilsLibrary
Library       KafkaLibrary
Library       Collections

*** Keywords ***
Configure Single xNF Simulator
    ${XNF_PORTS_LIST}=    Create List    7000
    ${XNF_SIMULATORS_ADDRESSES}=   Configure xNF Simulators   ${XNF_PORTS_LIST}
    ${XNF_SIMULATOR}=   Get Slice From List   ${XNF_SIMULATORS_ADDRESSES}   0   1
    Set Suite Variable   ${XNF_SIMULATOR}

Configure xNF Simulators Using Valid Certificates On Ports
    [Arguments]    ${XNF_PORTS_LIST}
    ${VALID_XNF_SIMULATORS_ADDRESSES}=   Configure xNF Simulators   ${XNF_PORTS_LIST}
    Set Suite Variable    ${VALID_XNF_SIMULATORS_ADDRESSES}

Configure xNF Simulators
    [Arguments]    ${XNF_PORTS_LIST}
    ...            ${should_use_valid_certs}=${true}
    ...            ${should_disable_ssl}=${false}
    ...            ${should_connect_to_unencrypted_hv_ves}=${false}
    ${XNF_SIMULATORS_ADDRESSES}=   Start Xnf Simulators   ${XNF_PORTS_LIST}
    ...                                                           ${should_use_valid_certs}
    ...                                                           ${should_disable_ssl}
    ...                                                           ${should_connect_to_unencrypted_hv_ves}
    [Return]   ${XNF_SIMULATORS_ADDRESSES}

Get xNF Simulators Using Valid Certificates
    [Arguments]  ${AMOUNT}=1
    ${SIMULATORS}=   Get Slice From List   ${VALID_XNF_SIMULATORS_ADDRESSES}   0   ${AMOUNT}
    [Return]   ${SIMULATORS}


Send Messages From xNF Simulators
    [Arguments]    ${XNF_HOSTS_LIST}   ${MESSAGE_FILEPATH}
    FOR   ${HOST}   IN    @{XNF_HOSTS_LIST}
        ${XNF_SIM_API_ACCESS}=   Get xNF Sim Api Access Url   ${HTTP_METHOD_URL}   ${HOST}
        ${XNF_SIM_API_URL}=  Catenate   SEPARATOR=   ${XNF_SIM_API_ACCESS}   ${XNF_SIM_API_PATH}
        Send messages   ${XNF_SIM_API_URL}   ${MESSAGE_FILEPATH}
    END

VES-HV Collector Test Shutdown
    Reset DCAE App Simulator  ${DEFAULT_PERF3GPP_TOPIC}
    Reset DCAE App Simulator  ${SECOND_PERF3GPP_TOPIC}
    Reset DCAE App Simulator  ${DEFAULT_STNDDEFINED_3GPP_HEARTBEAT_TOPIC}


VES-HV Collector Suite Teardown
    Log Kafka Status
    Stop And Remove All Xnf Simulators   ${SUITE NAME}

*** Variables ***
${HTTP_METHOD_URL}                             http://

${XNF_SIM_API_PATH}                            /simulator/async