Add csit tests for stndDefined validation in VES
[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     Override Collector Properties  ${VES_CERT_BASIC_AUTH_COLLECTOR_PROPERTIES}
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 over HTTPS with wrong JSON
57     [Tags]    DCAE-VESC-R1
58     [Documentation]   Post single event with invalid data and valid username/password to /eventListener/v7 endpoint over HTTPS and expect 400 Response Status Code
59     Send Request And Validate Response  Publish Event To VES Collector  ${https_basic_auth_session}  ${VES_EVENTLISTENER_V7}  ${VES_INVALID_JSON_V7}  400
60
61 Publish Single VES VNF Measurement Event With Wrong Auth
62     [Tags]  DCAE-VESC-R1
63     [Documentation]  Post single event with valid data and invalid username/password to /eventListener/v7 endpoint over HTTPS and expect 401 Response Status Code
64     Send Request And Validate Response  Publish Event To VES Collector  ${https_wrong_auth_session}  ${VES_EVENTLISTENER_V7}  ${VES_VALID_JSON_V7}  401
65
66 Publish Single VES VNF Measurement Event With Cert
67     [Tags]  DCAE-VESC-R1
68     [Documentation]  Post single event with valid data and valid certificate to /eventListener/v7 endpoint over HTTPS and expect 202 Response Status Code
69     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
70
71 Publish Single VES VNF Measurement Event With Wrong Cert
72     [Tags]  DCAE-VESC-R1
73     [Documentation]  Post single event with valid data and invalid certificate to /eventListener/v7 endpoint over HTTPS and expect SSLError with certificate unknown
74     @{err_content}  Create List  certificate unknown
75     Send Request And Expect Error  Publish Event To VES Collector  ${https_invalid_cert_session}  ${VES_EVENTLISTENER_V7}  ${VES_VALID_JSON_V7}  SSLError:*  @{err_content}
76
77 Publish Single VES VNF Measurement Event With Outdated Cert
78     [Tags]  DCAE-VESC-R1
79     [Documentation]  Post single event with valid data and outdated certificate to /eventListener/v7 endpoint over HTTPS and expect SSLError with certificate unknown
80     @{err_content}  Create List  certificate unknown
81     Send Request And Expect Error  Publish Event To VES Collector  ${https_outdated_cert_session}  ${VES_EVENTLISTENER_V7}  ${VES_VALID_JSON_V7}  SSLError:*  @{err_content}
82
83 Publish Single VES VNF Measurement Event Without Auth And Cert
84     [Tags]  DCAE-VESC-R1
85     [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
86     Send Request And Validate Response  Publish Event To VES Collector  ${https_no_cert_no_auth_session}   ${VES_EVENTLISTENER_V7}  ${VES_VALID_JSON_V7}  401
87
88 Publish V7 Batch Event with certBasicAuth over HTTPS
89     [Tags]    DCAE-VESC-R1
90     [Documentation]   Post single event with valid data and valid username/password to /eventListener/v7/eventBatch endpoint over HTTPS and expect 202 Response Status Code
91     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
92
93 Publish V7 Batch Event With Wrong Auth
94     [Tags]  DCAE-VESC-R1
95     [Documentation]  Post single event with valid data and invalid username/password to /eventListener/v7/eventBatch endpoint over HTTPS and expect 401 Response Status Code
96     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
97
98 Publish V7 Batch Event With Cert
99     [Tags]  DCAE-VESC-R1
100     [Documentation]  Post single event with valid data and valid certificate to /eventListener/v7/eventBatch endpoint over HTTPS and expect 202 Response
101     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
102
103 Publish V7 Batch With Wrong Cert
104     [Tags]  DCAE-VESC-R1
105     [Documentation]  Post single event with valid data and invalid certificate to /eventListener/v7/eventBatch endpoint over HTTPS and expect SSLError with certificate unknown
106     @{err_content}  Create List  certificate unknown
107     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}
108
109 Publish V7 Batch Event With Outdated Cert
110     [Tags]  DCAE-VESC-R1
111     [Documentation]  Post single event with valid data and outdated certificate to /eventListener/v7/eventBatch endpoint over HTTPS and expect SSLError with certificate unknown
112     @{err_content}  Create List  certificate unknown
113     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}
114
115 Publish V7 Batch Event Without Auth And Cert
116     [Tags]  DCAE-VESC-R1
117     [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
118     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