blob: 58e8a7e34e1d0ac64ecd7b923632b69bf7e92de9 [file] [log] [blame]
Aleksandra Maciaga6def5972020-02-20 09:42:03 +01001*** Settings ***
2
Pawelb7a057e2020-08-07 14:53:48 +02003Documentation OOM Cert Service API test case scenarios
Aleksandra Maciaga6def5972020-02-20 09:42:03 +01004Library RequestsLibrary
5Resource ./resources/cert-service-keywords.robot
6
7Suite Setup Create sessions
8
9*** Test Cases ***
10
Aleksandra Maciaga93f9ea42020-03-03 13:38:58 +010011Health Check
Pawelb7a057e2020-08-07 14:53:48 +020012 [Tags] OOM-CERT-SERVICE
Aleksandra Maciaga93f9ea42020-03-03 13:38:58 +010013 [Documentation] Service is up and running
Aleksandra Maciagaf6300682020-03-04 17:11:30 +010014 Run health check
Aleksandra Maciaga6def5972020-02-20 09:42:03 +010015
Aleksandra Maciaga93f9ea42020-03-03 13:38:58 +010016Reload Configuration
Pawelb7a057e2020-08-07 14:53:48 +020017 [Tags] OOM-CERT-SERVICE
Aleksandra Maciaga93f9ea42020-03-03 13:38:58 +010018 [Documentation] Configuration was changed
Aleksandra Maciagaf6300682020-03-04 17:11:30 +010019 Send Get Request And Validate Response /reload 200
Aleksandra Maciaga8d762b12020-02-24 14:24:42 +010020
Michal Banka93cf4f52020-03-09 12:14:45 +010021Check if application is ready
Pawelb7a057e2020-08-07 14:53:48 +020022 [Tags] OOM-CERT-SERVICE
Michal Banka93cf4f52020-03-09 12:14:45 +010023 [Documentation] Send request to /ready endpoint and expect 200
24 Send Get Request And Validate Response /ready 200
25
Aleksandra Maciagaf6300682020-03-04 17:11:30 +010026Generate Certificate In RA Mode For CA Name
Pawelb7a057e2020-08-07 14:53:48 +020027 [Tags] OOM-CERT-SERVICE
kjaniak25fac3a2020-03-18 13:01:36 +010028 [Documentation] Send request to ${CERT_SERVICE_ENDPOINT}${RA_CA_NAME} endpoint and expect 200
29 Send Get Request with Header And Expect Success ${CERT_SERVICE_ENDPOINT}${RA_CA_NAME} ${VALID_RA_CSR_FILE} ${VALID_RA_PK_FILE}
Aleksandra Maciaga8d762b12020-02-24 14:24:42 +010030
Aleksandra Maciagaf6300682020-03-04 17:11:30 +010031Report Not Found Error When Path To Service Is Not Valid
Pawelb7a057e2020-08-07 14:53:48 +020032 [Tags] OOM-CERT-SERVICE
kjaniak25fac3a2020-03-18 13:01:36 +010033 [Documentation] Send request to ${CERT_SERVICE_ENDPOINT} endpoint and expect 404
34 Send Get Request with Header And Expect Error ${CERT_SERVICE_ENDPOINT} ${VALID_CLIENT_CSR_FILE} ${VALID_CLIENT_PK_FILE} 404
Aleksandra Maciaga8d762b12020-02-24 14:24:42 +010035
Aleksandra Maciagaf6300682020-03-04 17:11:30 +010036Report Bad Request Error When Header Is Missing In Request
Pawelb7a057e2020-08-07 14:53:48 +020037 [Tags] OOM-CERT-SERVICE
kjaniak25fac3a2020-03-18 13:01:36 +010038 [Documentation] Send request without header to ${CERT_SERVICE_ENDPOINT}${CLIENT_CA_NAME} endpoint and expect 400
39 Send Get Request And Validate Response ${CERT_SERVICE_ENDPOINT}${CLIENT_CA_NAME} 400
Aleksandra Maciaga6def5972020-02-20 09:42:03 +010040
Aleksandra Maciaga93f9ea42020-03-03 13:38:58 +010041Report Bad Request Error When CSR Is Not Valid
Pawelb7a057e2020-08-07 14:53:48 +020042 [Tags] OOM-CERT-SERVICE
kjaniak25fac3a2020-03-18 13:01:36 +010043 [Documentation] Send request to ${CERT_SERVICE_ENDPOINT}${CLIENT_CA_NAME} endpoint and expect 400
44 Send Get Request with Header And Expect Error ${CERT_SERVICE_ENDPOINT}${CLIENT_CA_NAME} ${INVALID_CSR_FILE} ${VALID_CLIENT_PK_FILE} 400
Aleksandra Maciaga6def5972020-02-20 09:42:03 +010045
Aleksandra Maciaga93f9ea42020-03-03 13:38:58 +010046Report Bad Request Error When PK Is Not Valid
Pawelb7a057e2020-08-07 14:53:48 +020047 [Tags] OOM-CERT-SERVICE
kjaniak25fac3a2020-03-18 13:01:36 +010048 [Documentation] Send request to ${CERT_SERVICE_ENDPOINT}${CLIENT_CA_NAME} endpoint and expect 400
49 Send Get Request with Header And Expect Error ${CERT_SERVICE_ENDPOINT}${CLIENT_CA_NAME} ${VALID_CLIENT_CSR_FILE} ${INVALID_PK_FILE} 400
Tomasz Wrobel75573b02020-03-05 16:43:50 +010050
Joanna Jeremiczc21b0082020-06-15 16:21:55 +020051Cert Service Client successfully creates keystore.p12 and truststore.p12
Pawelb7a057e2020-08-07 14:53:48 +020052 [Tags] OOM-CERT-SERVICE
Tomasz Wrobel75573b02020-03-05 16:43:50 +010053 [Documentation] Run with correct env and expected exit code 0
Joanna Jeremiczc21b0082020-06-15 16:21:55 +020054 Run Cert Service Client And Validate PKCS12 File Creation And Client Exit Code ${VALID_ENV_FILE} 0
Tomasz Wrobel75573b02020-03-05 16:43:50 +010055
Joanna Jeremiczc21b0082020-06-15 16:21:55 +020056Cert Service Client successfully creates keystore.jks and truststore.jks
Pawelb7a057e2020-08-07 14:53:48 +020057 [Tags] OOM-CERT-SERVICE
Joanna Jeremiczc21b0082020-06-15 16:21:55 +020058 [Documentation] Run with correct env and expected exit code 0
59 Run Cert Service Client And Validate JKS File Creation And Client Exit Code ${VALID_ENV_FILE_JKS} 0
60
61Cert Service Client successfully creates keystore and truststore with expected data with no OUTPUT_TYPE
Pawelb7a057e2020-08-07 14:53:48 +020062 [Tags] OOM-CERT-SERVICE
Joanna Jeremiczc21b0082020-06-15 16:21:55 +020063 [Documentation] Run with correct env and PKCS12 files created with correct data
64 Run Cert Service Client And Validate PKCS12 Files Contain Expected Data ${VALID_ENV_FILE} 0
65
66Cert Service Client successfully creates keystore and truststore with expected data with OUTPUT_TYPE=JKS
Pawelb7a057e2020-08-07 14:53:48 +020067 [Tags] OOM-CERT-SERVICE
Joanna Jeremicz9c14f192020-03-19 14:51:51 +010068 [Documentation] Run with correct env and JKS files created with correct data
Joanna Jeremiczc21b0082020-06-15 16:21:55 +020069 Run Cert Service Client And Validate JKS Files Contain Expected Data ${VALID_ENV_FILE_JKS} 0
70
71Cert Service Client successfully creates keystore and truststore with expected data with OUTPUT_TYPE=P12
Pawelb7a057e2020-08-07 14:53:48 +020072 [Tags] OOM-CERT-SERVICE
Joanna Jeremiczc21b0082020-06-15 16:21:55 +020073 [Documentation] Run with correct env and PKCS12 files created with correct data
74 Run Cert Service Client And Validate PKCS12 Files Contain Expected Data ${VALID_ENV_FILE_P12} 0
75
76Cert Service Client successfully creates keystore and truststore with expected data with OUTPUT_TYPE=PEM
Pawelb7a057e2020-08-07 14:53:48 +020077 [Tags] OOM-CERT-SERVICE
Joanna Jeremiczc21b0082020-06-15 16:21:55 +020078 [Documentation] Run with correct env and PEM files created with correct data
79 Run Cert Service Client And Validate PEM Files Contain Expected Data ${VALID_ENV_FILE_PEM} 0
80
81Cert Service Client reports error when OUTPUT_TYPE is invalid
Pawelb7a057e2020-08-07 14:53:48 +020082 [Tags] OOM-CERT-SERVICE
Joanna Jeremiczc21b0082020-06-15 16:21:55 +020083 [Documentation] Run with invalid OUTPUT_TYPE env and expected exit code 1
84 Run Cert Service Client And Validate Client Exit Code ${INVALID_ENV_FILE_OUTPUT_TYPE} 1
Joanna Jeremicz9c14f192020-03-19 14:51:51 +010085
Tomasz Wrobel6ed06d52020-03-11 15:31:10 +010086Run Cert Service Client Container And Validate Exit Code And API Response
Pawelb7a057e2020-08-07 14:53:48 +020087 [Tags] OOM-CERT-SERVICE
Tomasz Wrobel75573b02020-03-05 16:43:50 +010088 [Documentation] Run with invalid CaName env and expected exit code 5
Tomasz Wrobel6ed06d52020-03-11 15:31:10 +010089 Run Cert Service Client And Validate Http Response Code And Client Exit Code ${INVALID_ENV_FILE} 404 5
Tomasz Wrobel75573b02020-03-05 16:43:50 +010090