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