Enhacement AAF-CerService CSIT
[integration/csit.git] / tests / aaf / certservice / cert-service-test.robot
1 *** Settings ***
2
3 Documentation     AAF Cert Service API test case scenarios
4 Library               RequestsLibrary
5 Resource          ./resources/cert-service-keywords.robot
6
7 Suite Setup       Create sessions
8
9 *** Test Cases ***
10
11 Health Check
12     [Tags]      AAF-CERT-SERVICE
13     [Documentation]   Service is up and running
14     Run health check
15
16 Reload Configuration
17     [Tags]      AAF-CERT-SERVICE
18     [Documentation]   Configuration was changed
19     Send Get Request And Validate Response  /reload  200
20
21 Generate Certificate In RA Mode For CA Name
22     [Tags]      AAF-CERT-SERVICE
23     [Documentation]  Send request to ${CERT_SERVICE_ENDPOINT}/${RA_CA_NAME} endpoint and expect 200
24     Send Get Request with Header And Expect Success  ${CERT_SERVICE_ENDPOINT}/${RA_CA_NAME}  ${VALID_RA_CSR_FILE}  ${VALID_RA_PK_FILE}
25
26 Report Not Found Error When Path To Service Is Not Valid
27     [Tags]      AAF-CERT-SERVICE
28     [Documentation]  Send request to ${CERT_SERVICE_ENDPOINT}/ endpoint and expect 404
29     Send Get Request with Header And Expect Error  ${CERT_SERVICE_ENDPOINT}/  ${VALID_CLIENT_CSR_FILE}  ${VALID_CLIENT_PK_FILE}  404
30
31 Report Bad Request Error When Header Is Missing In Request
32     [Tags]      AAF-CERT-SERVICE
33     [Documentation]  Send request without header to ${CERT_SERVICE_ENDPOINT}/${CLIENT_CA_NAME} endpoint and expect 400
34     Send Get Request And Validate Response  ${CERT_SERVICE_ENDPOINT}/${CLIENT_CA_NAME}  400
35
36 Report Bad Request Error When CSR Is Not Valid
37     [Tags]      AAF-CERT-SERVICE
38     [Documentation]  Send request to ${CERT_SERVICE_ENDPOINT}/${CLIENT_CA_NAME} endpoint and expect 400
39     Send Get Request with Header And Expect Error  ${CERT_SERVICE_ENDPOINT}/${CLIENT_CA_NAME}  ${INVALID_CSR_FILE}  ${VALID_CLIENT_PK_FILE}  400
40
41 Report Bad Request Error When PK Is Not Valid
42     [Tags]      AAF-CERT-SERVICE
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}  ${VALID_CLIENT_CSR_FILE}  ${INVALID_PK_FILE}  400
45
46 Cert Service Client successfully creates keystore and truststore
47     [Tags]      AAF-CERT-SERVICE
48     [Documentation]  Run with correct env and expected exit code 0
49     Run Cert Service Client And Validate JKS File Creation And Client Exit Code  ${VALID_ENV_FILE}  0
50
51 Run Cert Service Client Container And Validate Exit Code And API Response
52     [Tags]      AAF-CERT-SERVICE
53     [Documentation]  Run with invalid CaName env and expected exit code 5
54     Run Cert Service Client And Validate Http Response Code And Client Exit Code  ${INVALID_ENV_FILE}  404  5
55