Add testcase for PMMapper (Support 28.532 file naming convention)
[integration/csit.git] / tests / oom-platform-cert-service / certservice / cert-service-test.robot
1 *** Settings ***
2
3 Documentation     OOM 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]      OOM-CERT-SERVICE
13     [Documentation]   Service is up and running
14     Run health check
15
16 Reload Configuration
17     [Tags]      OOM-CERT-SERVICE
18     [Documentation]   Configuration was changed
19     Send Get Request And Validate Response  /reload  200
20
21 Check if application is ready
22     [Tags]      OOM-CERT-SERVICE
23     [Documentation]   Send request to /ready endpoint and expect 200
24     Send Get Request And Validate Response  /ready  200
25
26 Generate Certificate In RA Mode For CA Name
27     [Tags]      OOM-CERT-SERVICE
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}
30
31 Report Not Found Error When Path To Service Is Not Valid
32     [Tags]      OOM-CERT-SERVICE
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
35
36 Report Bad Request Error When Header Is Missing In Request
37     [Tags]      OOM-CERT-SERVICE
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
40
41 Report Bad Request Error When CSR Is Not Valid
42     [Tags]      OOM-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}  ${INVALID_CSR_FILE}  ${VALID_CLIENT_PK_FILE}  400
45
46 Report Bad Request Error When PK Is Not Valid
47     [Tags]      OOM-CERT-SERVICE
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
50
51 Cert Service Client successfully creates keystore.p12 and truststore.p12
52     [Tags]      OOM-CERT-SERVICE
53     [Documentation]  Run with correct env and expected exit code 0
54     Run Cert Service Client And Validate PKCS12 File Creation And Client Exit Code  ${VALID_ENV_FILE}  0
55
56 Cert Service Client successfully creates keystore.jks and truststore.jks
57     [Tags]      OOM-CERT-SERVICE
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
62     [Tags]      OOM-CERT-SERVICE
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
67     [Tags]      OOM-CERT-SERVICE
68     [Documentation]  Run with correct env and JKS files created with correct data
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
72     [Tags]      OOM-CERT-SERVICE
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
77     [Tags]      OOM-CERT-SERVICE
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
82     [Tags]      OOM-CERT-SERVICE
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
85
86 Run Cert Service Client Container And Validate Exit Code And API Response
87     [Tags]      OOM-CERT-SERVICE
88     [Documentation]  Run with invalid CaName env and expected exit code 5
89     Run Cert Service Client And Validate Http Response Code And Client Exit Code  ${INVALID_ENV_FILE}  404  5
90