Aleksandra Maciaga | 6def597 | 2020-02-20 09:42:03 +0100 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 3 | Documentation OOM Cert Service API test case scenarios |
Aleksandra Maciaga | 6def597 | 2020-02-20 09:42:03 +0100 | [diff] [blame] | 4 | Library RequestsLibrary |
| 5 | Resource ./resources/cert-service-keywords.robot |
| 6 | |
| 7 | Suite Setup Create sessions |
| 8 | |
| 9 | *** Test Cases *** |
| 10 | |
Aleksandra Maciaga | 93f9ea4 | 2020-03-03 13:38:58 +0100 | [diff] [blame] | 11 | Health Check |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 12 | [Tags] OOM-CERT-SERVICE |
Aleksandra Maciaga | 93f9ea4 | 2020-03-03 13:38:58 +0100 | [diff] [blame] | 13 | [Documentation] Service is up and running |
Aleksandra Maciaga | f630068 | 2020-03-04 17:11:30 +0100 | [diff] [blame] | 14 | Run health check |
Aleksandra Maciaga | 6def597 | 2020-02-20 09:42:03 +0100 | [diff] [blame] | 15 | |
Aleksandra Maciaga | 93f9ea4 | 2020-03-03 13:38:58 +0100 | [diff] [blame] | 16 | Reload Configuration |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 17 | [Tags] OOM-CERT-SERVICE |
Aleksandra Maciaga | 93f9ea4 | 2020-03-03 13:38:58 +0100 | [diff] [blame] | 18 | [Documentation] Configuration was changed |
Aleksandra Maciaga | f630068 | 2020-03-04 17:11:30 +0100 | [diff] [blame] | 19 | Send Get Request And Validate Response /reload 200 |
Aleksandra Maciaga | 8d762b1 | 2020-02-24 14:24:42 +0100 | [diff] [blame] | 20 | |
Michal Banka | 93cf4f5 | 2020-03-09 12:14:45 +0100 | [diff] [blame] | 21 | Check if application is ready |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 22 | [Tags] OOM-CERT-SERVICE |
Michal Banka | 93cf4f5 | 2020-03-09 12:14:45 +0100 | [diff] [blame] | 23 | [Documentation] Send request to /ready endpoint and expect 200 |
| 24 | Send Get Request And Validate Response /ready 200 |
| 25 | |
Aleksandra Maciaga | f630068 | 2020-03-04 17:11:30 +0100 | [diff] [blame] | 26 | Generate Certificate In RA Mode For CA Name |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 27 | [Tags] OOM-CERT-SERVICE |
kjaniak | 25fac3a | 2020-03-18 13:01:36 +0100 | [diff] [blame] | 28 | [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 Maciaga | 8d762b1 | 2020-02-24 14:24:42 +0100 | [diff] [blame] | 30 | |
Aleksandra Maciaga | f630068 | 2020-03-04 17:11:30 +0100 | [diff] [blame] | 31 | Report Not Found Error When Path To Service Is Not Valid |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 32 | [Tags] OOM-CERT-SERVICE |
kjaniak | 25fac3a | 2020-03-18 13:01:36 +0100 | [diff] [blame] | 33 | [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 Maciaga | 8d762b1 | 2020-02-24 14:24:42 +0100 | [diff] [blame] | 35 | |
Aleksandra Maciaga | f630068 | 2020-03-04 17:11:30 +0100 | [diff] [blame] | 36 | Report Bad Request Error When Header Is Missing In Request |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 37 | [Tags] OOM-CERT-SERVICE |
kjaniak | 25fac3a | 2020-03-18 13:01:36 +0100 | [diff] [blame] | 38 | [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 Maciaga | 6def597 | 2020-02-20 09:42:03 +0100 | [diff] [blame] | 40 | |
Aleksandra Maciaga | 93f9ea4 | 2020-03-03 13:38:58 +0100 | [diff] [blame] | 41 | Report Bad Request Error When CSR Is Not Valid |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 42 | [Tags] OOM-CERT-SERVICE |
kjaniak | 25fac3a | 2020-03-18 13:01:36 +0100 | [diff] [blame] | 43 | [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 Maciaga | 6def597 | 2020-02-20 09:42:03 +0100 | [diff] [blame] | 45 | |
Aleksandra Maciaga | 93f9ea4 | 2020-03-03 13:38:58 +0100 | [diff] [blame] | 46 | Report Bad Request Error When PK Is Not Valid |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 47 | [Tags] OOM-CERT-SERVICE |
kjaniak | 25fac3a | 2020-03-18 13:01:36 +0100 | [diff] [blame] | 48 | [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 Wrobel | 75573b0 | 2020-03-05 16:43:50 +0100 | [diff] [blame] | 50 | |
Joanna Jeremicz | c21b008 | 2020-06-15 16:21:55 +0200 | [diff] [blame] | 51 | Cert Service Client successfully creates keystore.p12 and truststore.p12 |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 52 | [Tags] OOM-CERT-SERVICE |
Tomasz Wrobel | 75573b0 | 2020-03-05 16:43:50 +0100 | [diff] [blame] | 53 | [Documentation] Run with correct env and expected exit code 0 |
Joanna Jeremicz | c21b008 | 2020-06-15 16:21:55 +0200 | [diff] [blame] | 54 | Run Cert Service Client And Validate PKCS12 File Creation And Client Exit Code ${VALID_ENV_FILE} 0 |
Tomasz Wrobel | 75573b0 | 2020-03-05 16:43:50 +0100 | [diff] [blame] | 55 | |
Joanna Jeremicz | c21b008 | 2020-06-15 16:21:55 +0200 | [diff] [blame] | 56 | Cert Service Client successfully creates keystore.jks and truststore.jks |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 57 | [Tags] OOM-CERT-SERVICE |
Joanna Jeremicz | c21b008 | 2020-06-15 16:21:55 +0200 | [diff] [blame] | 58 | [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 | |
| 61 | Cert Service Client successfully creates keystore and truststore with expected data with no OUTPUT_TYPE |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 62 | [Tags] OOM-CERT-SERVICE |
Joanna Jeremicz | c21b008 | 2020-06-15 16:21:55 +0200 | [diff] [blame] | 63 | [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 | |
| 66 | Cert Service Client successfully creates keystore and truststore with expected data with OUTPUT_TYPE=JKS |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 67 | [Tags] OOM-CERT-SERVICE |
Joanna Jeremicz | 9c14f19 | 2020-03-19 14:51:51 +0100 | [diff] [blame] | 68 | [Documentation] Run with correct env and JKS files created with correct data |
Joanna Jeremicz | c21b008 | 2020-06-15 16:21:55 +0200 | [diff] [blame] | 69 | Run Cert Service Client And Validate JKS Files Contain Expected Data ${VALID_ENV_FILE_JKS} 0 |
| 70 | |
| 71 | Cert Service Client successfully creates keystore and truststore with expected data with OUTPUT_TYPE=P12 |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 72 | [Tags] OOM-CERT-SERVICE |
Joanna Jeremicz | c21b008 | 2020-06-15 16:21:55 +0200 | [diff] [blame] | 73 | [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 | |
| 76 | Cert Service Client successfully creates keystore and truststore with expected data with OUTPUT_TYPE=PEM |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 77 | [Tags] OOM-CERT-SERVICE |
Joanna Jeremicz | c21b008 | 2020-06-15 16:21:55 +0200 | [diff] [blame] | 78 | [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 | |
| 81 | Cert Service Client reports error when OUTPUT_TYPE is invalid |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 82 | [Tags] OOM-CERT-SERVICE |
Joanna Jeremicz | c21b008 | 2020-06-15 16:21:55 +0200 | [diff] [blame] | 83 | [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 Jeremicz | 9c14f19 | 2020-03-19 14:51:51 +0100 | [diff] [blame] | 85 | |
Tomasz Wrobel | 6ed06d5 | 2020-03-11 15:31:10 +0100 | [diff] [blame] | 86 | Run Cert Service Client Container And Validate Exit Code And API Response |
Pawel | b7a057e | 2020-08-07 14:53:48 +0200 | [diff] [blame] | 87 | [Tags] OOM-CERT-SERVICE |
Tomasz Wrobel | 75573b0 | 2020-03-05 16:43:50 +0100 | [diff] [blame] | 88 | [Documentation] Run with invalid CaName env and expected exit code 5 |
Tomasz Wrobel | 6ed06d5 | 2020-03-11 15:31:10 +0100 | [diff] [blame] | 89 | Run Cert Service Client And Validate Http Response Code And Client Exit Code ${INVALID_ENV_FILE} 404 5 |
Tomasz Wrobel | 75573b0 | 2020-03-05 16:43:50 +0100 | [diff] [blame] | 90 | |