StndDefined event routing
[integration/csit.git] / tests / dcaegen2 / testcases / 02__cert_basic_auth_tests.robot
1 *** Settings ***
2 Resource          ./resources/dcae_keywords.robot
3 *** Test Cases ***
4 Enable VESC HTTPS with certBasicAuth
5     [Tags]    DCAE-VESC-R1  DCAE-VESC-HC
6     [Documentation]  Enable VESC Https and Authentication and Run Health Check
7     Enable VESC with certBasicAuth
8     Run Healthcheck  ${https_basic_auth_session}
9
10 VES Collector HTTP Health Check with certBasicAuth
11     [Tags]    DCAE-VESC-R1  DCAE-VESC-HC
12     [Documentation]   Run healthcheck over HTTP with certBasicAuth
13     Run Healthcheck  ${http_session}
14
15 Healthcheck with Outdated Cert
16     [Tags]    DCAE-VESC-R1  DCAE-VESC-HC
17     [Documentation]  Run healthcheck with outdated cert
18     ${uuid}=    Generate UUID
19     ${headers}=  Create Dictionary     Accept=*/*     X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid}    X-FromAppId=${GLOBAL_APPLICATION_ID}
20     ${err_msg}=  Run Keyword And Expect Error  SSLError:*  Get Request  ${https_outdated_cert_session}  /healthcheck  headers=${headers}
21     Should Contain  ${err_msg}  certificate unknown
22     Log  Recieved error message ${err_msg}
23
24 Publish Single VES Fault Event Over HTTPS
25     [Tags]    DCAE-VESC-R1
26     [Documentation]   Post single event with valid data to /eventListener/v5 endpoint over HTTPS and expect 202 Response Status Code
27     Log  Login User=${VESC_HTTPS_USER}, Pd=${VESC_HTTPS_PD}
28     Send Request And Validate Response  Publish Event To VES Collector  ${https_basic_auth_session}  ${VES_ANY_EVENT_PATH}  ${EVENT_DATA_FILE}  202  ab305d54-85b4-a31b-7db2-fb6b9e546015
29
30 Publish Single VES Measurement Event Over HTTPS
31     [Tags]    DCAE-VESC-R1
32     [Documentation]   Post single measurement event with valid data to /eventListener/v5 endpoint over HTTPS and expect 202 Response Status Code
33     Send Request And Validate Response  Publish Event To VES Collector  ${https_basic_auth_session}  ${VES_ANY_EVENT_PATH}  ${EVENT_MEASURE_FILE}  202  0b2b5790-3673-480a-a4bd-5a00b88e5af6
34
35 Publish VES Fault Batch Events Over HTTPS
36     [Tags]    DCAE-VESC-R1
37     [Documentation]   Post single event with valid data to /eventListener/v5/eventBatch endpoint over HTTPS and expect 202 Response Status Code
38     Send Request And Validate Response  Publish Event To VES Collector  ${https_basic_auth_session}  ${VES_BATCH_EVENT_PATH}  ${EVENT_BATCH_DATA_FILE}  202  ab305d54-85b4-a31b-7db2-fb6b9e546025
39
40 Publish VES Event With Invalid URL Path HTTPS
41     [Tags]    DCAE-VESC-R1
42     [Documentation]    Post single event to invalid url path over HTTPS and expect 404 response Status Code
43     Log   Send HTTP Request with invalid /eventlistener/v5/ instead of /eventListener/v5 path
44     Send Request And Validate Response  Publish Event To VES Collector  ${https_basic_auth_session}  /eventlistener/v5  ${EVENT_DATA_FILE}  404
45
46 Publish Single VES VNF Measurement Event over HTTP
47     [Tags]    DCAE-VESC-R1
48     [Documentation]   Post single event over HTTP with authentication enabled and expect 400 Response Status Code
49     Send Request And Validate Response  Publish Event To VES Collector  ${http_session}  ${VES_EVENTLISTENER_V7}  ${VES_VALID_JSON_V7}  400
50
51 Publish Single VES VNF Measurement Event with certBasicAuth over HTTPS
52     [Tags]    DCAE-VESC-R1
53     [Documentation]   Post single event with valid data and valid username/password to /eventListener/v7 endpoint over HTTPS and expect 202 Response Status Code
54     Send Request And Validate Response  Publish Event To VES Collector  ${https_basic_auth_session}  ${VES_EVENTLISTENER_V7}  ${VES_VALID_JSON_V7}  202  ab305d54-85b4-a31b-7db2-fb6b9e546015
55
56 Publish Single VES VNF Measurement Event with Standard Defined Fields with certBasicAuth over HTTPS
57     [Tags]    DCAE-VESC-R1
58     [Documentation]   Post single event with valid data with Standard Defined Fields and valid username/password to /eventListener/v7 endpoint over HTTPS and expect 202 Response Status Code
59     Send Request And Validate Response  Publish Event To VES Collector  ${https_basic_auth_session}  ${VES_EVENTLISTENER_V7}  ${VES_VALID_JSON_V7_STND_DEF_FIELDS}  202  stndDefined-gNB-Nokia-PowerLost
60
61 Publish Single VES VNF Measurement Event over HTTPS with wrong JSON
62     [Tags]    DCAE-VESC-R1
63     [Documentation]   Post single event with invalid data and valid username/password to /eventListener/v7 endpoint over HTTPS and expect 400 Response Status Code
64     Send Request And Validate Response  Publish Event To VES Collector  ${https_basic_auth_session}  ${VES_EVENTLISTENER_V7}  ${VES_INVALID_JSON_V7}  400
65
66 Publish Single VES VNF Measurement Event With Wrong Auth
67     [Tags]  DCAE-VESC-R1
68     [Documentation]  Post single event with valid data and invalid username/password to /eventListener/v7 endpoint over HTTPS and expect 401 Response Status Code
69     Send Request And Validate Response  Publish Event To VES Collector  ${https_wrong_auth_session}  ${VES_EVENTLISTENER_V7}  ${VES_VALID_JSON_V7}  401
70
71 Publish Single VES VNF Measurement Event With Cert
72     [Tags]  DCAE-VESC-R1
73     [Documentation]  Post single event with valid data and valid certificate to /eventListener/v7 endpoint over HTTPS and expect 202 Response Status Code
74     Send Request And Validate Response  Publish Event To VES Collector  ${https_valid_cert_session}  ${VES_EVENTLISTENER_V7}  ${VES_VALID_JSON_V7}  202  ab305d54-85b4-a31b-7db2-fb6b9e546015
75
76 Publish Single VES VNF Measurement Event With Wrong Cert
77     [Tags]  DCAE-VESC-R1
78     [Documentation]  Post single event with valid data and invalid certificate to /eventListener/v7 endpoint over HTTPS and expect SSLError with certificate unknown
79     @{err_content}  Create List  certificate unknown
80     Send Request And Expect Error  Publish Event To VES Collector  ${https_invalid_cert_session}  ${VES_EVENTLISTENER_V7}  ${VES_VALID_JSON_V7}  SSLError:*  @{err_content}
81
82 Publish Single VES VNF Measurement Event With Outdated Cert
83     [Tags]  DCAE-VESC-R1
84     [Documentation]  Post single event with valid data and outdated certificate to /eventListener/v7 endpoint over HTTPS and expect SSLError with certificate unknown
85     @{err_content}  Create List  certificate unknown
86     Send Request And Expect Error  Publish Event To VES Collector  ${https_outdated_cert_session}  ${VES_EVENTLISTENER_V7}  ${VES_VALID_JSON_V7}  SSLError:*  @{err_content}
87
88 Publish Single VES VNF Measurement Event Without Auth And Cert
89     [Tags]  DCAE-VESC-R1
90     [Documentation]  Post single event with valid data and without certificate or username/password to /eventListener/v7 endpoint over HTTPS and expect 401 Response Status Code
91     Send Request And Validate Response  Publish Event To VES Collector  ${https_no_cert_no_auth_session}   ${VES_EVENTLISTENER_V7}  ${VES_VALID_JSON_V7}  401
92
93 Publish V7 Batch Event with certBasicAuth over HTTPS
94     [Tags]    DCAE-VESC-R1
95     [Documentation]   Post single event with valid data and valid username/password to /eventListener/v7/eventBatch endpoint over HTTPS and expect 202 Response Status Code
96     Send Request And Validate Response  Publish Event To VES Collector  ${https_basic_auth_session}  ${VES_BATCH_EVENT_ENDPOINT_V7}  ${VES_VALID_BATCH_JSON_V7}  202  Fault_Vscf:Acs-Ericcson_PilotNumberPoolExhaustion
97
98 Publish V7 Batch Event With Wrong Auth
99     [Tags]  DCAE-VESC-R1
100     [Documentation]  Post single event with valid data and invalid username/password to /eventListener/v7/eventBatch endpoint over HTTPS and expect 401 Response Status Code
101     Send Request And Validate Response  Publish Event To VES Collector   ${https_wrong_auth_session}  ${VES_BATCH_EVENT_ENDPOINT_V7}  ${VES_VALID_BATCH_JSON_V7}  401
102
103 Publish V7 Batch Event With Cert
104     [Tags]  DCAE-VESC-R1
105     [Documentation]  Post single event with valid data and valid certificate to /eventListener/v7/eventBatch endpoint over HTTPS and expect 202 Response
106     Send Request And Validate Response  Publish Event To VES Collector  ${https_valid_cert_session}  ${VES_BATCH_EVENT_ENDPOINT_V7}  ${VES_VALID_BATCH_JSON_V7}  202  Fault_Vscf:Acs-Ericcson_PilotNumberPoolExhaustion
107
108 Publish V7 Batch With Wrong Cert
109     [Tags]  DCAE-VESC-R1
110     [Documentation]  Post single event with valid data and invalid certificate to /eventListener/v7/eventBatch endpoint over HTTPS and expect SSLError with certificate unknown
111     @{err_content}  Create List  certificate unknown
112     Send Request And Expect Error  Publish Event To VES Collector   ${https_invalid_cert_session}  ${VES_BATCH_EVENT_ENDPOINT_V7}  ${VES_VALID_BATCH_JSON_V7}  SSLError:*  @{err_content}
113
114 Publish V7 Batch Event With Outdated Cert
115     [Tags]  DCAE-VESC-R1
116     [Documentation]  Post single event with valid data and outdated certificate to /eventListener/v7/eventBatch endpoint over HTTPS and expect SSLError with certificate unknown
117     @{err_content}  Create List  certificate unknown
118     Send Request And Expect Error  Publish Event To VES Collector   ${https_outdated_cert_session}  ${VES_BATCH_EVENT_ENDPOINT_V7}  ${VES_VALID_BATCH_JSON_V7}  SSLError:*  @{err_content}
119
120 Publish V7 Batch Event Without Auth And Cert
121     [Tags]  DCAE-VESC-R1
122     [Documentation]  Post single event with valid data and without certificate or username/password to /eventListener/v7/eventBatch endpoint over HTTPS and expect 401 Response Status Code
123     Send Request And Validate Response  Publish Event To VES Collector  ${https_no_cert_no_auth_session}   ${VES_BATCH_EVENT_ENDPOINT_V7}  ${VES_VALID_BATCH_JSON_V7}  401
124
125 Publish VES Event With Empty Stnd Domain Namespace Parameter
126     [Tags]    DCAE-VESC-R1 DCAE-VESC-STNDDEFINED
127     [Documentation]   Post single event with invalid data (empty stnd namespace parameter) to /eventListener/v7 endpoint, expect 400 Response Status Code and "Mandatory input %1 %2 is empty in request" message
128     Send Request And Validate Response And Error Message  Publish Event To VES Collector  ${https_basic_auth_session}  ${VES_EVENTLISTENER_V7}  ${VES_STDN_DEFINED_EMMPTY_NAMESPACE}   400   Mandatory input %1 %2 is empty in request
129
130 Publish VES Event With Missing Stnd Domain Namespace Parameter
131     [Tags]    DCAE-VESC-R1 DCAE-VESC-STNDDEFINED
132     [Documentation]   Post single event with invalid data (missing stnd namespace parameter) to /eventListener/v7 endpoint, expect 400 Response Status Code and "Mandatory input %1 %2 is missing from request" message
133     Send Request And Validate Response And Error Message  Publish Event To VES Collector  ${https_basic_auth_session}  ${VES_EVENTLISTENER_V7}  ${VES_STDN_DEFINED_MISSING_NAMESPACE}    400   Mandatory input %1 %2 is missing from request
134
135 Publish Single VES Event With Empty JSON
136     [Tags]    DCAE-VESC-R1 DCAE-VESC-STNDDEFINED
137     [Documentation]   Post single event with empty json and expect 400 Response Status Code
138     Send Request And Validate Response  Publish Event To VES Collector  ${https_basic_auth_session}  ${VES_EVENTLISTENER_V7}  ${VES_EMPTY_JSON}  400
139
140 Publish Single VES Event With Missing SourceName Parameter
141     [Tags]    DCAE-VESC-R1 DCAE-VESC-STNDDEFINED
142     [Documentation]   Post single event with empty json and expect 400 Response Status Code
143     Send Request And Validate Response  Publish Event To VES Collector  ${https_basic_auth_session}  ${VES_EVENTLISTENER_V7}  ${VES_NAMESPACE_3GPP_PROVISIONING_MISSING_SOURCENAME}  400
144
145 Publish Single VES Event With stndDefinedNamespace = 3GPP-Provisioning
146     [Tags]    DCAE-VESC-R1 DCAE-VESC-STNDDEFINED
147     [Documentation]   Post single event with stndDefinedNamespace = 3GPP-Provisioning and event should routed to topic unauthenticated.SEC_3GPP_PROVISIONING_OUTPUT
148     Send Request And Validate Response  Publish Event To VES Collector  ${https_basic_auth_session}  ${VES_EVENTLISTENER_V7}  ${VES_STDN_DEFINED_3GPP_PROVISIONING}  202  unauthenticated.SEC_3GPP_PROVISIONING_OUTPUT
149
150 Publish Single VES Event With stndDefinedNamespace = 3GPP-Heartbeat
151     [Tags]    DCAE-VESC-R1 DCAE-VESC-STNDDEFINED
152     [Documentation]   Post single event with stndDefinedNamespace = 3GPP-Heartbeat and event should routed to topic unauthenticated.SEC_3GPP_HEARTBEAT_OUTPUT
153     Send Request And Validate Response  Publish Event To VES Collector  ${https_basic_auth_session}  ${VES_EVENTLISTENER_V7}  ${VES_STDN_DEFINED_3GPP_HEARTBEAT}  202  unauthenticated.SEC_3GPP_HEARTBEAT_OUTPUT
154
155 Publish Single VES Event With stndDefinedNamespace = 3GPP-PerformanceAssurance
156     [Tags]    DCAE-VESC-R1 DCAE-VESC-STNDDEFINED
157     [Documentation]   Post single event with stndDefinedNamespace = 3GPP-PerformanceAssurance and event should routed to topic unauthenticated.SEC_3GPP_PERFORMANCEASSURANCE_OUTPUT
158     Send Request And Validate Response  Publish Event To VES Collector  ${https_basic_auth_session}  ${VES_EVENTLISTENER_V7}  ${VES_STDN_DEFINED_3GPP_PERFORMANCE_ASSURANCE}  202  unauthenticated.SEC_3GPP_PERFORMANCEASSURANCE_OUTPUT
159
160 Publish Single VES Event With stndDefinedNamespace = 3GPP-FaultSupervision
161     [Tags]    DCAE-VESC-R1 DCAE-VESC-STNDDEFINED
162     [Documentation]   Post single event with stndDefinedNamespace = 3GPP-FaultSupervision and event should routed to topic unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT
163     Send Request And Validate Response  Publish Event To VES Collector  ${https_basic_auth_session}  ${VES_EVENTLISTENER_V7}  ${VES_STDN_DEFINED_3GPP_FAULTSUPERVISION}  202  unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT