blob: 90ee1a373bde6e3981a34e370f48df126fd2215b [file] [log] [blame]
Aleksandra Maciaga6def5972020-02-20 09:42:03 +01001*** Settings ***
2
Aleksandra Maciaga93f9ea42020-03-03 13:38:58 +01003Documentation AAF 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
Aleksandra Maciaga6def5972020-02-20 09:42:03 +010012 [Tags] AAF-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
Aleksandra Maciaga8d762b12020-02-24 14:24:42 +010017 [Tags] AAF-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
22 [Tags] AAF-CERT-SERVICE
23 [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
Aleksandra Maciaga6def5972020-02-20 09:42:03 +010027 [Tags] AAF-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
Aleksandra Maciaga8d762b12020-02-24 14:24:42 +010032 [Tags] AAF-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
Aleksandra Maciaga8d762b12020-02-24 14:24:42 +010037 [Tags] AAF-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
Aleksandra Maciaga6def5972020-02-20 09:42:03 +010042 [Tags] AAF-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
Aleksandra Maciaga6def5972020-02-20 09:42:03 +010047 [Tags] AAF-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
Tomasz Wrobel6ed06d52020-03-11 15:31:10 +010051Cert Service Client successfully creates keystore and truststore
Tomasz Wrobel75573b02020-03-05 16:43:50 +010052 [Tags] AAF-CERT-SERVICE
53 [Documentation] Run with correct env and expected exit code 0
Tomasz Wrobel6ed06d52020-03-11 15:31:10 +010054 Run Cert Service Client And Validate JKS File Creation And Client Exit Code ${VALID_ENV_FILE} 0
Tomasz Wrobel75573b02020-03-05 16:43:50 +010055
Joanna Jeremicz9c14f192020-03-19 14:51:51 +010056Cert Service Client successfully creates keystore and truststore with expected data
57 [Tags] AAF-CERT-SERVICE
58 [Documentation] Run with correct env and JKS files created with correct data
59 Run Cert Service Client And Validate JKS Files Contain Expected Data ${VALID_ENV_FILE} 0
60
Tomasz Wrobel6ed06d52020-03-11 15:31:10 +010061Run Cert Service Client Container And Validate Exit Code And API Response
Tomasz Wrobel75573b02020-03-05 16:43:50 +010062 [Tags] AAF-CERT-SERVICE
63 [Documentation] Run with invalid CaName env and expected exit code 5
Tomasz Wrobel6ed06d52020-03-11 15:31:10 +010064 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 +010065