manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation VMI certificate exchange tests. |
| 4 | |
shrsuman123 | 5fc20cb | 2021-02-02 04:55:47 -0600 | [diff] [blame] | 5 | Library ../../lib/jobs_processing.py |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 6 | Resource ../../lib/resource.robot |
| 7 | Resource ../../lib/bmc_redfish_resource.robot |
| 8 | Resource ../../lib/openbmc_ffdc.robot |
| 9 | Resource ../../lib/bmc_redfish_utils.robot |
| 10 | Resource ../../lib/utils.robot |
| 11 | |
| 12 | Suite Setup Suite Setup Execution |
| 13 | Test Teardown FFDC On Test Case Fail |
George Keishing | 4e0978d | 2022-07-27 10:21:18 -0500 | [diff] [blame] | 14 | Suite Teardown Run Keyword And Ignore Error Suite Teardown Execution |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 15 | |
George Keishing | 725e066 | 2022-07-20 22:18:14 -0500 | [diff] [blame] | 16 | Force Tags vmi_certificate_test |
| 17 | |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 18 | |
| 19 | *** Variables *** |
| 20 | |
| 21 | # users User Name password |
| 22 | @{ADMIN} admin_user TestPwd123 |
| 23 | @{OPERATOR} operator_user TestPwd123 |
Prashanth Katti | 7ee2825 | 2020-09-17 01:55:17 -0500 | [diff] [blame] | 24 | @{ReadOnly} readonly_user TestPwd123 |
| 25 | @{NoAccess} noaccess_user TestPwd123 |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 26 | # Removing Operator, need to add it back once support is given. |
| 27 | &{USERS} Administrator=${ADMIN} ReadOnly=${ReadOnly} |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 28 | ${VMI_BASE_URI} /ibm/v1/ |
shrsuman123 | 5fc20cb | 2021-02-02 04:55:47 -0600 | [diff] [blame] | 29 | |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 30 | |
| 31 | *** Test Cases *** |
| 32 | |
| 33 | Get CSR Request Signed By VMI And Verify |
| 34 | [Documentation] Get CSR request signed by VMI using different user roles and verify. |
| 35 | [Tags] Get_CSR_Request_Signed_By_VMI_And_Verify |
| 36 | [Template] Get Certificate Signed By VMI |
| 37 | |
| 38 | # username password force_create valid_csr valid_status_code |
| 39 | ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
Prashanth Katti | 7ee2825 | 2020-09-17 01:55:17 -0500 | [diff] [blame] | 40 | |
| 41 | # Send CSR request from operator user. |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 42 | # operator_user TestPwd123 ${False} ${True} ${HTTP_FORBIDDEN} |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 43 | |
Prashanth Katti | 7ee2825 | 2020-09-17 01:55:17 -0500 | [diff] [blame] | 44 | # Send CSR request from ReadOnly user. |
| 45 | readonly_user TestPwd123 ${False} ${True} ${HTTP_FORBIDDEN} |
| 46 | |
| 47 | # Send CSR request from NoAccess user. |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 48 | # noaccess_user TestPwd123 ${False} ${True} ${HTTP_FORBIDDEN} |
Prashanth Katti | 7ee2825 | 2020-09-17 01:55:17 -0500 | [diff] [blame] | 49 | |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 50 | |
George Keishing | 4203fad | 2022-01-31 12:22:33 -0600 | [diff] [blame] | 51 | Get Root Certificate Using Different Privilege Users Role |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 52 | [Documentation] Get root certificate using different users. |
George Keishing | 4203fad | 2022-01-31 12:22:33 -0600 | [diff] [blame] | 53 | [Tags] Get_Root_Certificate_Using_Different_Privilege_Users_Role |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 54 | [Template] Get Root Certificate |
| 55 | |
| 56 | # username password force_create valid_csr valid_status_code |
Prashanth Katti | 7ee2825 | 2020-09-17 01:55:17 -0500 | [diff] [blame] | 57 | # Request root certificate from admin user. |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 58 | admin_user TestPwd123 ${True} ${True} ${HTTP_OK} |
Prashanth Katti | 7ee2825 | 2020-09-17 01:55:17 -0500 | [diff] [blame] | 59 | |
| 60 | # Request root certificate from operator user. |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 61 | # operator_user TestPwd123 ${False} ${True} ${HTTP_FORBIDDEN} |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 62 | |
Prashanth Katti | 7ee2825 | 2020-09-17 01:55:17 -0500 | [diff] [blame] | 63 | # Request root certificate from ReadOnly user. |
| 64 | readonly_user TestPwd123 ${False} ${True} ${HTTP_FORBIDDEN} |
| 65 | |
| 66 | # Request root certificate from NoAccess user. |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 67 | # noaccess_user TestPwd123 ${False} ${True} ${HTTP_FORBIDDEN} |
Prashanth Katti | 7ee2825 | 2020-09-17 01:55:17 -0500 | [diff] [blame] | 68 | |
| 69 | |
| 70 | Send CSR Request When VMI Is Off And Verify |
| 71 | [Documentation] Send CSR signing request to VMI when it is off and expect an error. |
George Keishing | 4203fad | 2022-01-31 12:22:33 -0600 | [diff] [blame] | 72 | [Tags] Send_CSR_Request_When_VMI_Is_Off_And_Verify |
Prashanth Katti | 7ee2825 | 2020-09-17 01:55:17 -0500 | [diff] [blame] | 73 | [Setup] Redfish Power Off |
shrsuman123 | 7463d42 | 2021-06-17 02:53:25 -0500 | [diff] [blame] | 74 | [Teardown] Run keywords Redfish Power On stack_mode=skip AND FFDC On Test Case Fail |
Prashanth Katti | 7ee2825 | 2020-09-17 01:55:17 -0500 | [diff] [blame] | 75 | [Template] Get Certificate Signed By VMI |
| 76 | |
shrsuman123 | 932759b | 2021-10-19 07:23:22 -0500 | [diff] [blame] | 77 | # username password force_create valid_csr valid_status_code read_timeout |
| 78 | ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_SERVICE_UNAVAILABLE} 60 |
Prashanth Katti | 7ee2825 | 2020-09-17 01:55:17 -0500 | [diff] [blame] | 79 | |
| 80 | # Send CSR request from operator user. |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 81 | # operator_user TestPwd123 ${False} ${True} ${HTTP_FORBIDDEN} |
Prashanth Katti | 7ee2825 | 2020-09-17 01:55:17 -0500 | [diff] [blame] | 82 | |
| 83 | # Send CSR request from ReadOnly user. |
shrsuman123 | 3f70a6a | 2021-04-08 04:48:07 -0500 | [diff] [blame] | 84 | readonly_user TestPwd123 ${False} ${True} ${HTTP_FORBIDDEN} |
Prashanth Katti | 7ee2825 | 2020-09-17 01:55:17 -0500 | [diff] [blame] | 85 | |
| 86 | # Send CSR request from NoAccess user. |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 87 | # noaccess_user TestPwd123 ${False} ${True} ${HTTP_FORBIDDEN} |
| 88 | |
Prashanth Katti | 7ee2825 | 2020-09-17 01:55:17 -0500 | [diff] [blame] | 89 | |
shrsuman123 | 1b1c2a4 | 2020-11-02 23:02:30 -0600 | [diff] [blame] | 90 | Get Corrupted CSR Request Signed By VMI And Verify |
| 91 | [Documentation] Send corrupted CSR for signing and expect an error. |
| 92 | [Tags] Get_Corrupted_CSR_Request_Signed_By_VMI_And_Verify |
shrsuman123 | 1b1c2a4 | 2020-11-02 23:02:30 -0600 | [diff] [blame] | 93 | [Template] Get Certificate Signed By VMI |
| 94 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 95 | # username password force_create valid_csr valid_status_code read_timeout |
| 96 | ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} 60 |
shrsuman123 | 1b1c2a4 | 2020-11-02 23:02:30 -0600 | [diff] [blame] | 97 | |
| 98 | # Send CSR request from operator user. |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 99 | # operator_user TestPwd123 ${False} ${False} ${HTTP_FORBIDDEN} |
shrsuman123 | 1b1c2a4 | 2020-11-02 23:02:30 -0600 | [diff] [blame] | 100 | |
| 101 | # Send CSR request from ReadOnly user. |
| 102 | readonly_user TestPwd123 ${False} ${False} ${HTTP_FORBIDDEN} |
| 103 | |
| 104 | # Send CSR request from NoAccess user. |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 105 | # noaccess_user TestPwd123 ${False} ${False} ${HTTP_FORBIDDEN} |
| 106 | |
shrsuman123 | 1b1c2a4 | 2020-11-02 23:02:30 -0600 | [diff] [blame] | 107 | |
shrsuman123 | 68bdcae | 2021-01-18 00:38:25 -0600 | [diff] [blame] | 108 | Get Root Certificate When VMI Is Off And Verify |
| 109 | [Documentation] Get root certificate when vmi is off and verify. |
| 110 | [Tags] Get_Root_Certificate_When_VMI_Is_Off_And_Verify |
| 111 | [Setup] Redfish Power Off |
shrsuman123 | 7463d42 | 2021-06-17 02:53:25 -0500 | [diff] [blame] | 112 | [Teardown] Run keywords Redfish Power On stack_mode=skip AND FFDC On Test Case Fail |
shrsuman123 | 68bdcae | 2021-01-18 00:38:25 -0600 | [diff] [blame] | 113 | [Template] Get Root Certificate |
shrsuman123 | 1b1c2a4 | 2020-11-02 23:02:30 -0600 | [diff] [blame] | 114 | |
shrsuman123 | 68bdcae | 2021-01-18 00:38:25 -0600 | [diff] [blame] | 115 | # username password force_create valid_csr valid_status_code |
| 116 | ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 117 | |
| 118 | # Request root certificate from operator user. |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 119 | # operator_user TestPwd123 ${False} ${True} ${HTTP_FORBIDDEN} |
shrsuman123 | 68bdcae | 2021-01-18 00:38:25 -0600 | [diff] [blame] | 120 | |
| 121 | # Request root certificate from ReadOnly user. |
| 122 | readonly_user TestPwd123 ${False} ${True} ${HTTP_FORBIDDEN} |
| 123 | |
| 124 | # Request root certificate from NoAccess user. |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 125 | # noaccess_user TestPwd123 ${False} ${True} ${HTTP_FORBIDDEN} |
shrsuman123 | 68bdcae | 2021-01-18 00:38:25 -0600 | [diff] [blame] | 126 | |
| 127 | |
| 128 | Get Root Certificate After BMC Reboot And Verify |
| 129 | [Documentation] Get root certificate after bmc reboot and verify. |
| 130 | [Tags] Get_Root_Certificate_After_BMC_Reboot_And_Verify |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 131 | [Setup] Run Keywords OBMC Reboot (off) stack_mode=skip AND Redfish Power On |
shrsuman123 | 68bdcae | 2021-01-18 00:38:25 -0600 | [diff] [blame] | 132 | [Template] Get Root Certificate |
| 133 | |
| 134 | # username password force_create valid_csr valid_status_code |
| 135 | ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 136 | |
| 137 | # Request root certificate from operator user. |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 138 | # operator_user TestPwd123 ${False} ${True} ${HTTP_FORBIDDEN} |
shrsuman123 | 68bdcae | 2021-01-18 00:38:25 -0600 | [diff] [blame] | 139 | |
| 140 | # Request root certificate from ReadOnly user. |
| 141 | readonly_user TestPwd123 ${False} ${True} ${HTTP_FORBIDDEN} |
| 142 | |
| 143 | # Request root certificate from NoAccess user. |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 144 | # noaccess_user TestPwd123 ${False} ${True} ${HTTP_FORBIDDEN} |
| 145 | |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 146 | |
shrsuman123 | 5fc20cb | 2021-02-02 04:55:47 -0600 | [diff] [blame] | 147 | Get Concurrent Root Certificate Requests From Multiple Admin Users |
| 148 | [Documentation] Get multiple concurrent root certificate requests from multiple admins |
| 149 | ... and verify no errors. |
| 150 | [Tags] Get_Concurrent_Root_Certificate_Requests_From_Multiple_Admin_Users |
| 151 | |
| 152 | FOR ${i} IN RANGE ${5} |
| 153 | ${dict}= Execute Process Multi Keyword ${5} |
| 154 | ... Get Root Certificate ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 155 | ... Get Root Certificate ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 156 | ... Get Root Certificate ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 157 | Dictionary Should Not Contain Value ${dict} False |
| 158 | ... msg=One or more operations has failed. |
| 159 | END |
| 160 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 161 | |
shrsuman123 | 5fc20cb | 2021-02-02 04:55:47 -0600 | [diff] [blame] | 162 | Get Concurrent CSR Requests From Multiple Admin Users |
| 163 | [Documentation] Get multiple concurrent csr requests from multiple admins and verify no errors. |
| 164 | [Tags] Get_Concurrent_CSR_Requests_From_Multiple_Admin_Users |
| 165 | |
| 166 | FOR ${i} IN RANGE ${5} |
| 167 | ${dict}= Execute Process Multi Keyword ${5} |
| 168 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 169 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 170 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 171 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 172 | Dictionary Should Not Contain Value ${dict} False |
| 173 | ... msg=One or more operations has failed. |
| 174 | END |
| 175 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 176 | |
shrsuman123 | 5fc20cb | 2021-02-02 04:55:47 -0600 | [diff] [blame] | 177 | Get Concurrent Corrupted CSR Requests From Multiple Admin Users |
| 178 | [Documentation] Get multiple concurrent corrupted csr requests from multiple admins and verify no errors. |
| 179 | [Tags] Get_Concurrent_Corrupted_CSR_Requests_From_Multiple_Admin_Users |
| 180 | |
| 181 | FOR ${i} IN RANGE ${5} |
| 182 | ${dict}= Execute Process Multi Keyword ${5} |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 183 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
| 184 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
| 185 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
shrsuman123 | 5fc20cb | 2021-02-02 04:55:47 -0600 | [diff] [blame] | 186 | Dictionary Should Not Contain Value ${dict} False |
| 187 | ... msg=One or more operations has failed. |
| 188 | END |
| 189 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 190 | |
| 191 | *** Comment *** |
| 192 | |
shrsuman123 | 82a9a31 | 2021-03-26 05:34:32 -0500 | [diff] [blame] | 193 | Get Concurrent Root Certificate Request From Operator Users |
| 194 | [Documentation] Get multiple concurrent root certificate from non admin users and verify no errors. |
| 195 | [Tags] Get_Concurrent_Root_Certificate_Request_From_Operator_Users |
| 196 | |
| 197 | FOR ${i} IN RANGE ${5} |
| 198 | ${dict}= Execute Process Multi Keyword ${5} |
| 199 | ... Get Root Certificate operator_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 200 | ... Get Root Certificate operator_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 201 | ... Get Root Certificate operator_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 202 | Dictionary Should Not Contain Value ${dict} False |
| 203 | ... msg=One or more operations has failed. |
| 204 | END |
| 205 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 206 | |
| 207 | *** Test Cases *** |
| 208 | |
shrsuman123 | 82a9a31 | 2021-03-26 05:34:32 -0500 | [diff] [blame] | 209 | Get Concurrent Root Certificate Request From Admin And Non Admin Users |
| 210 | [Documentation] Get multiple concurrent root certificate from admin and non admin users |
| 211 | ... and verify no errors. |
| 212 | [Tags] Get_Concurrent_Root_Certificate_Request_From_Admin_And_Non_Admin_Users |
| 213 | |
| 214 | FOR ${i} IN RANGE ${5} |
| 215 | ${dict}= Execute Process Multi Keyword ${5} |
| 216 | ... Get Root Certificate ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
shrsuman123 | 82a9a31 | 2021-03-26 05:34:32 -0500 | [diff] [blame] | 217 | ... Get Root Certificate readonly_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 218 | Dictionary Should Not Contain Value ${dict} False |
| 219 | ... msg=One or more operations has failed. |
| 220 | END |
| 221 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 222 | |
| 223 | *** Comment *** |
| 224 | |
shrsuman123 | 82a9a31 | 2021-03-26 05:34:32 -0500 | [diff] [blame] | 225 | Get Concurrent Root Certificate Request From Different Non Admin Users |
| 226 | [Documentation] Get multiple concurrent root certificate from different non admin users |
| 227 | ... and verify no errors. |
| 228 | [Tags] Get_Concurrent_Root_Certificate_Request_From_Different_Non_Admin_Users |
| 229 | |
| 230 | FOR ${i} IN RANGE ${5} |
| 231 | ${dict}= Execute Process Multi Keyword ${5} |
| 232 | ... Get Root Certificate operator_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 233 | ... Get Root Certificate readonly_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 234 | ... Get Root Certificate noaccess_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 235 | Dictionary Should Not Contain Value ${dict} False |
| 236 | ... msg=One or more operations has failed. |
| 237 | END |
| 238 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 239 | |
shrsuman123 | 82a9a31 | 2021-03-26 05:34:32 -0500 | [diff] [blame] | 240 | Get Concurrent CSR Request From Operator Users |
| 241 | [Documentation] Get multiple concurrent csr request from non admin users and verify no errors. |
| 242 | [Tags] Get_Concurrent_CSR_Request_From_Operator_Users |
| 243 | |
| 244 | FOR ${i} IN RANGE ${5} |
| 245 | ${dict}= Execute Process Multi Keyword ${5} |
| 246 | ... Get Certificate Signed By VMI operator_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 247 | ... Get Certificate Signed By VMI operator_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 248 | ... Get Certificate Signed By VMI operator_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 249 | Dictionary Should Not Contain Value ${dict} False |
| 250 | ... msg=One or more operations has failed. |
| 251 | END |
| 252 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 253 | |
| 254 | *** Test Cases *** |
| 255 | |
shrsuman123 | 94b3657 | 2021-03-10 03:15:53 -0600 | [diff] [blame] | 256 | Get Root Certificate And Send CSR Request Concurrently And Verify |
| 257 | [Documentation] Get root certificate and send csr request concurrently and |
| 258 | ... verify gets root and signed certificate. |
| 259 | [Tags] Get_Root_Certificate_And_Send_CSR_Request_Concurrently_And_Verify |
| 260 | |
| 261 | FOR ${i} IN RANGE ${5} |
| 262 | ${dict}= Execute Process Multi Keyword ${5} |
| 263 | ... Get Root Certificate ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 264 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 265 | Dictionary Should Not Contain Value ${dict} False |
| 266 | ... msg=One or more operations has failed. |
| 267 | END |
| 268 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 269 | |
shrsuman123 | 94b3657 | 2021-03-10 03:15:53 -0600 | [diff] [blame] | 270 | Get Concurrent Root Certificate And Send CSR Request And Verify |
| 271 | [Documentation] Get concurrent root certificate and send csr request |
| 272 | ... and verify gets root certificate and signed certificate. |
| 273 | [Tags] Get_Concurrent_Root_Certificate_And_Send_CSR_Request_And_Verify |
| 274 | |
| 275 | FOR ${i} IN RANGE ${5} |
| 276 | ${dict}= Execute Process Multi Keyword ${5} |
| 277 | ... Get Root Certificate ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 278 | ... Get Root Certificate ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 279 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 280 | Dictionary Should Not Contain Value ${dict} False |
| 281 | ... msg=One or more operations has failed. |
| 282 | END |
| 283 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 284 | |
shrsuman123 | 94b3657 | 2021-03-10 03:15:53 -0600 | [diff] [blame] | 285 | Get Root Certificate And Send Multiple CSR Requests Concurrently And Verify |
| 286 | [Documentation] Get root certificate and send multiple csr requests concurrently and |
| 287 | ... verify gets root certificate and signed certificates. |
| 288 | [Tags] Get_Root_Certificate_And_Send_Multiple_CSR_Requests_Concurrently_And_Verify |
| 289 | |
| 290 | FOR ${i} IN RANGE ${5} |
| 291 | ${dict}= Execute Process Multi Keyword ${5} |
| 292 | ... Get Root Certificate ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 293 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 294 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 295 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 296 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 297 | Dictionary Should Not Contain Value ${dict} False |
| 298 | ... msg=One or more operations has failed. |
| 299 | END |
| 300 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 301 | |
shrsuman123 | 94b3657 | 2021-03-10 03:15:53 -0600 | [diff] [blame] | 302 | Get Root Certificate And Send Multiple Corrupted CSR Requests Concurrently And Verify |
| 303 | [Documentation] Get root certificate and send multiple corrupted csr requests concurrently and |
| 304 | ... verify gets root certificate and error for corrupted csr requests. |
| 305 | [Tags] Get_Root_Certificate_And_Send_Multiple_Corrupted_CSR_Requests_Concurrently_And_Verify |
| 306 | |
| 307 | FOR ${i} IN RANGE ${5} |
| 308 | ${dict}= Execute Process Multi Keyword ${5} |
| 309 | ... Get Root Certificate ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 310 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
| 311 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
| 312 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
shrsuman123 | 94b3657 | 2021-03-10 03:15:53 -0600 | [diff] [blame] | 313 | Dictionary Should Not Contain Value ${dict} False |
| 314 | ... msg=One or more operations has failed. |
| 315 | END |
| 316 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 317 | |
shrsuman123 | b63aa5e | 2021-04-12 06:20:18 -0500 | [diff] [blame] | 318 | Send Concurrent CSR Request And Corrupted CSR Request And Verify |
| 319 | [Documentation] Send concurrent csr request and corrupted csr request |
| 320 | ... and verify gets certificate for valid csr and error for corrupted csr. |
| 321 | [Tags] Send_Concurrent_CSR_Request_And_Corrupted_CSR_Request_And_Verify |
| 322 | |
| 323 | FOR ${i} IN RANGE ${5} |
| 324 | ${dict}= Execute Process Multi Keyword ${5} |
| 325 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 326 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 327 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
| 328 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
shrsuman123 | b63aa5e | 2021-04-12 06:20:18 -0500 | [diff] [blame] | 329 | Dictionary Should Not Contain Value ${dict} False |
| 330 | ... msg=One or more operations has failed. |
| 331 | END |
| 332 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 333 | |
shrsuman123 | b63aa5e | 2021-04-12 06:20:18 -0500 | [diff] [blame] | 334 | Get Root Certificate Send CSR And Corrupted CSR Request Concurrently And Verify |
| 335 | [Documentation] Get root certificate send csr and corrupted csr requests concurrently and |
| 336 | ... verify gets root certificate and certificate for valid csr and error for corrupted csr. |
| 337 | [Tags] Get_Root_Certificate_Send_CSR_And_Corrupted_CSR_Request_Concurrently_And_Verify |
| 338 | |
| 339 | FOR ${i} IN RANGE ${5} |
| 340 | ${dict}= Execute Process Multi Keyword ${5} |
| 341 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 342 | ... Get Root Certificate ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 343 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
| 344 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
shrsuman123 | b63aa5e | 2021-04-12 06:20:18 -0500 | [diff] [blame] | 345 | Dictionary Should Not Contain Value ${dict} False |
| 346 | ... msg=One or more operations has failed. |
| 347 | END |
| 348 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 349 | |
shrsuman123 | b63aa5e | 2021-04-12 06:20:18 -0500 | [diff] [blame] | 350 | Send Concurrent CSR Request From Admin And Non Admin Users And Verify |
| 351 | [Documentation] Send concurrent csr requests from admin and non-admin users and verify |
| 352 | ... admin gets certificate and non-admin gets error. |
| 353 | [Tags] Send_Concurrent_CSR_Request_From_Admin_And_Non_Admin_Users_And_Verify |
| 354 | |
| 355 | FOR ${i} IN RANGE ${5} |
| 356 | ${dict}= Execute Process Multi Keyword ${5} |
| 357 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
shrsuman123 | b63aa5e | 2021-04-12 06:20:18 -0500 | [diff] [blame] | 358 | ... Get Certificate Signed By VMI readonly_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 359 | Dictionary Should Not Contain Value ${dict} False |
| 360 | ... msg=One or more operations has failed. |
| 361 | END |
| 362 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 363 | |
| 364 | *** Comment *** |
| 365 | |
shrsuman123 | b63aa5e | 2021-04-12 06:20:18 -0500 | [diff] [blame] | 366 | Send Concurrent CSR Request From Non Admin Users And Verify |
| 367 | [Documentation] Send concurrent csr request from non admin users |
| 368 | ... and verify gets error. |
| 369 | [Tags] Send_Concurrent_CSR_Request_From_Non_Admin_Users_And_Verify |
| 370 | |
| 371 | FOR ${i} IN RANGE ${5} |
| 372 | ${dict}= Execute Process Multi Keyword ${5} |
| 373 | ... Get Certificate Signed By VMI operator_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 374 | ... Get Certificate Signed By VMI readonly_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 375 | ... Get Certificate Signed By VMI noaccess_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 376 | Dictionary Should Not Contain Value ${dict} False |
| 377 | ... msg=One or more operations has failed. |
| 378 | END |
| 379 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 380 | |
shrsuman123 | a968ad5 | 2021-06-08 06:30:01 -0500 | [diff] [blame] | 381 | Get Root Certificate And Send Corrupted CSR From Admin CSR Request From Operator Concurrently |
| 382 | [Documentation] Get root certificate and send corrupted csr request from admin and |
George Keishing | 7bc01e9 | 2021-06-15 11:07:14 -0500 | [diff] [blame] | 383 | ... csr from operator concurrently and verify gets root certificate and errors for corrupted |
shrsuman123 | a968ad5 | 2021-06-08 06:30:01 -0500 | [diff] [blame] | 384 | ... and for operator. |
| 385 | [Tags] Get_Root_Certificate_And_Send_Corrupted_CSR_From_Admin_CSR_Request_From_Operator_Concurrently |
| 386 | |
| 387 | FOR ${i} IN RANGE ${5} |
| 388 | ${dict}= Execute Process Multi Keyword ${5} |
| 389 | ... Get Root Certificate ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 390 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
| 391 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
shrsuman123 | a968ad5 | 2021-06-08 06:30:01 -0500 | [diff] [blame] | 392 | ... Get Certificate Signed By VMI operator_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 393 | Dictionary Should Not Contain Value ${dict} False |
| 394 | ... msg=One or more operations has failed. |
| 395 | END |
| 396 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 397 | |
shrsuman123 | a968ad5 | 2021-06-08 06:30:01 -0500 | [diff] [blame] | 398 | Get Root Certificate From Operator And Send Corrupted CSR Request And CSR Request From Admin Concurrently |
| 399 | [Documentation] Get root certificate from operator and send corrupted csr request |
| 400 | ... and csr from admin and verify errors for operator and corrupted csr and signed certificate |
| 401 | ... for valid csr. |
| 402 | [Tags] Get_Root_Certificate_From_Operator_And_Send_Corrupted_CSR_Request_And_CSR_Request_From_Admin_Concurrently |
| 403 | |
| 404 | FOR ${i} IN RANGE ${5} |
| 405 | ${dict}= Execute Process Multi Keyword ${5} |
| 406 | ... Get Root Certificate operator_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 407 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
| 408 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
shrsuman123 | a968ad5 | 2021-06-08 06:30:01 -0500 | [diff] [blame] | 409 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 410 | Dictionary Should Not Contain Value ${dict} False |
| 411 | ... msg=One or more operations has failed. |
| 412 | END |
| 413 | |
| 414 | |
| 415 | Get Root Certificate From Operator And Admin Send CSR Request From Admin Concurrently |
| 416 | [Documentation] Get root certificate from operator and admin and |
| 417 | ... and send csr request from admin concurrently and verify error for operator |
| 418 | ... and admin gets root and signed certificate. |
| 419 | [Tags] Get_Root_Certificate_From_Operator_And_Admin_Send_CSR_Request_From_Admin_Concurrently |
| 420 | |
| 421 | FOR ${i} IN RANGE ${5} |
| 422 | ${dict}= Execute Process Multi Keyword ${5} |
| 423 | ... Get Root Certificate operator_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 424 | ... Get Root Certificate ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 425 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 426 | Dictionary Should Not Contain Value ${dict} False |
| 427 | ... msg=One or more operations has failed. |
| 428 | END |
| 429 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 430 | |
shrsuman123 | 5e80c02 | 2021-05-25 01:28:39 -0500 | [diff] [blame] | 431 | Send CSR Request From Admin And Operator And Corrupted CSR From Admin Concurrently And Verify |
| 432 | [Documentation] Send csr request from admin and operator and corrupted |
| 433 | ... csr request from admin and verify gets signed certificate for valid csr for admin |
| 434 | ... gets error for operator and error for corrupted csr. |
| 435 | [Tags] Send_CSR_Request_From_Admin_And_Operator_And_Corrupted_CSR_From_Admin_Concurrently_And_Verify |
| 436 | |
| 437 | FOR ${i} IN RANGE ${5} |
| 438 | ${dict}= Execute Process Multi Keyword ${5} |
| 439 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 440 | ... Get Certificate Signed By VMI operator_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 441 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
shrsuman123 | 5e80c02 | 2021-05-25 01:28:39 -0500 | [diff] [blame] | 442 | Dictionary Should Not Contain Value ${dict} False |
| 443 | ... msg=One or more operations has failed. |
| 444 | END |
| 445 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 446 | |
shrsuman123 | 5e80c02 | 2021-05-25 01:28:39 -0500 | [diff] [blame] | 447 | Send Corrupted CSR Requests From Admin And Operator And CSR Request From Admin Concurrently And Verify |
| 448 | [Documentation] Send corrupted csr request from admin and operator and csr request |
| 449 | ... from admin concurrently and verify errors for corrupted csr and gets signed certificate |
| 450 | ... for valid csr from admin. |
| 451 | [Tags] Send_Corrupted_CSR_Requests_From_Admin_And_Operator_And_CSR_Request_From_Admin_Concurrently_And_Verify |
| 452 | |
| 453 | FOR ${i} IN RANGE ${5} |
| 454 | ${dict}= Execute Process Multi Keyword ${5} |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 455 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
shrsuman123 | 5e80c02 | 2021-05-25 01:28:39 -0500 | [diff] [blame] | 456 | ... Get Certificate Signed By VMI operator_user TestPwd123 ${True} ${False} ${HTTP_FORBIDDEN} |
| 457 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 458 | Dictionary Should Not Contain Value ${dict} False |
| 459 | ... msg=One or more operations has failed. |
| 460 | END |
| 461 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 462 | |
shrsuman123 | 5e80c02 | 2021-05-25 01:28:39 -0500 | [diff] [blame] | 463 | Send Corrupted CSR Requests From Admin And Operator User Concurrently And Verify |
| 464 | [Documentation] Send corrupted csr requests from admin and operator and |
| 465 | ... verify gets error. |
| 466 | [Tags] Send_Corrupted_CSR_Requests_From_Admin_And_Operator_User_Concurrently_And_Verify |
| 467 | |
| 468 | FOR ${i} IN RANGE ${5} |
| 469 | ${dict}= Execute Process Multi Keyword ${5} |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 470 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
| 471 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
shrsuman123 | 5e80c02 | 2021-05-25 01:28:39 -0500 | [diff] [blame] | 472 | ... Get Certificate Signed By VMI operator_user TestPwd123 ${True} ${False} ${HTTP_FORBIDDEN} |
| 473 | Dictionary Should Not Contain Value ${dict} False |
| 474 | ... msg=One or more operations has failed. |
| 475 | END |
| 476 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 477 | |
| 478 | *** Test Cases *** |
| 479 | |
shrsuman123 | e05f7bc | 2021-04-23 04:42:05 -0500 | [diff] [blame] | 480 | Get Root Certificate From Admin And Send CSR Requests From Non Admin Concurrently And Verify |
| 481 | [Documentation] Get root certificate from admin and csr requests from |
| 482 | ... non admin users concurrently and verify gets root certificate for admin and |
| 483 | ... errors for non-admins. |
| 484 | [Tags] Get_Root_Certificate_From_Admin_And_Send_CSR_Requests_From_Non_Admin_Concurrently_And_Verify |
| 485 | |
| 486 | FOR ${i} IN RANGE ${5} |
| 487 | ${dict}= Execute Process Multi Keyword ${5} |
| 488 | ... Get Root Certificate ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
shrsuman123 | e05f7bc | 2021-04-23 04:42:05 -0500 | [diff] [blame] | 489 | ... Get Certificate Signed By VMI readonly_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 490 | Dictionary Should Not Contain Value ${dict} False |
| 491 | ... msg=One or more operations has failed. |
| 492 | END |
| 493 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 494 | |
shrsuman123 | e05f7bc | 2021-04-23 04:42:05 -0500 | [diff] [blame] | 495 | Get Root Certificate And Send CSR Requests From Non Admin Users Concurrently And Verify |
| 496 | [Documentation] Get root certificate and send csr requests from non admin |
| 497 | ... users and verify gets errors. |
| 498 | [Tags] Get_Root_Certificate_And_Send_CSR_Requests_From_Non_Admin_Users_Concurrently_And_Verify |
| 499 | |
| 500 | FOR ${i} IN RANGE ${5} |
| 501 | ${dict}= Execute Process Multi Keyword ${5} |
shrsuman123 | e05f7bc | 2021-04-23 04:42:05 -0500 | [diff] [blame] | 502 | ... Get Root Certificate readonly_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 503 | ... Get Certificate Signed By VMI readonly_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
shrsuman123 | e05f7bc | 2021-04-23 04:42:05 -0500 | [diff] [blame] | 504 | Dictionary Should Not Contain Value ${dict} False |
| 505 | ... msg=One or more operations has failed. |
| 506 | END |
| 507 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 508 | |
shrsuman123 | e05f7bc | 2021-04-23 04:42:05 -0500 | [diff] [blame] | 509 | Send Corrupted CSR Request From Admin And CSR Requests From Non Admin Concurrently And Verify |
| 510 | [Documentation] Send corrupted csr request from admin and csr request from non admin |
| 511 | ... users concurrently and verify gets errors. |
| 512 | [Tags] Send_Corrupted_CSR_Request_From_Admin_And_CSR_Requests_From_Non_Admin_Concurrently_And_Verify |
| 513 | |
| 514 | FOR ${i} IN RANGE ${5} |
| 515 | ${dict}= Execute Process Multi Keyword ${5} |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 516 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
shrsuman123 | e05f7bc | 2021-04-23 04:42:05 -0500 | [diff] [blame] | 517 | ... Get Certificate Signed By VMI readonly_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 518 | Dictionary Should Not Contain Value ${dict} False |
| 519 | ... msg=One or more operations has failed. |
| 520 | END |
| 521 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 522 | |
shrsuman123 | e05f7bc | 2021-04-23 04:42:05 -0500 | [diff] [blame] | 523 | Send CSR Request And Corrupted CSR Requests From Non Admin Users Concurrently And Verify |
| 524 | [Documentation] Send csr and corrupted csr request from non admin users |
| 525 | ... and verify gets errors. |
| 526 | [Tags] Send_CSR_Request_And_Corrupted_CSR_Requests_From_Non_Admin_Users_Concurrently_And_Verify |
| 527 | |
| 528 | FOR ${i} IN RANGE ${5} |
| 529 | ${dict}= Execute Process Multi Keyword ${5} |
shrsuman123 | e05f7bc | 2021-04-23 04:42:05 -0500 | [diff] [blame] | 530 | ... Get Certificate Signed By VMI readonly_user TestPwd123 ${True} ${False} ${HTTP_FORBIDDEN} |
shrsuman123 | e05f7bc | 2021-04-23 04:42:05 -0500 | [diff] [blame] | 531 | ... Get Certificate Signed By VMI readonly_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 532 | Dictionary Should Not Contain Value ${dict} False |
| 533 | ... msg=One or more operations has failed. |
| 534 | END |
| 535 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 536 | |
| 537 | *** Comment *** |
| 538 | |
shrsuman123 | 421e610 | 2021-06-23 05:25:57 -0500 | [diff] [blame] | 539 | Get Root Certificate And Send CSR Requests From Admin And Operator Concurrently And Verify |
| 540 | [Documentation] Get root certificate from admin and send csr requests |
| 541 | ... from admin and operator concurrently and verify gets root certificate |
| 542 | ... and signed certificate and gets error for operator. |
| 543 | [Tags] Get_Root_Certificate_And_Send_CSR_Requests_From_Admin_And_Operator_Concurrently_And_Verify |
| 544 | |
| 545 | FOR ${i} IN RANGE ${5} |
| 546 | ${dict}= Execute Process Multi Keyword ${5} |
| 547 | ... Get Root Certificate ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 548 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
| 549 | ... Get Certificate Signed By VMI operator_user TestPwd123 ${True} ${True} ${HTTP_FORBIDDEN} |
| 550 | Dictionary Should Not Contain Value ${dict} False |
| 551 | ... msg=One or more operations has failed. |
| 552 | END |
| 553 | |
| 554 | |
| 555 | Get Root Certificate And Send Corrupted CSR Requests From Admin And Operator Concurrently And Verify |
| 556 | [Documentation] Get root certificate from admin and send corrupted csr requests |
| 557 | ... from admin and operator concurrently and verify gets root certificate and errors |
| 558 | ... for corrupted csr. |
| 559 | [Tags] Get_Root_Certificate_And_Send_Corrupted_CSR_Requests_From_Admin_And_Operator_Concurrently_And_Verify |
| 560 | |
| 561 | FOR ${i} IN RANGE ${5} |
| 562 | ${dict}= Execute Process Multi Keyword ${5} |
| 563 | ... Get Root Certificate ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${True} ${HTTP_OK} |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 564 | ... Get Certificate Signed By VMI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} ${True} ${False} ${HTTP_BAD_REQUEST} |
shrsuman123 | 421e610 | 2021-06-23 05:25:57 -0500 | [diff] [blame] | 565 | ... Get Certificate Signed By VMI operator_user TestPwd123 ${True} ${False} ${HTTP_FORBIDDEN} |
| 566 | Dictionary Should Not Contain Value ${dict} False |
| 567 | ... msg=One or more operations has failed. |
| 568 | END |
| 569 | |
Prashanth Katti | 7c0f9d4 | 2022-07-08 05:21:40 -0500 | [diff] [blame] | 570 | |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 571 | *** Keywords *** |
| 572 | |
| 573 | Generate CSR String |
| 574 | [Documentation] Generate a csr string. |
| 575 | |
| 576 | # Note: Generates and returns csr string. |
shrsuman123 | 5fc20cb | 2021-02-02 04:55:47 -0600 | [diff] [blame] | 577 | ${csr_gen_time} = Get Current Date Time |
| 578 | ${CSR_FILE}= Catenate SEPARATOR=_ ${csr_gen_time} csr_server.csr |
| 579 | ${CSR_KEY}= Catenate SEPARATOR=_ ${csr_gen_time} csr_server.key |
| 580 | Set Test Variable ${CSR_FILE} |
| 581 | Set Test Variable ${CSR_KEY} |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 582 | ${ssl_cmd}= Set Variable openssl req -new -newkey rsa:2048 -nodes -keyout ${CSR_KEY} -out ${CSR_FILE} |
| 583 | ${ssl_sub}= Set Variable |
| 584 | ... -subj "/C=XY/ST=Abcd/L=Efgh/O=ABC/OU=Systems/CN=abc.com/emailAddress=xyz@xx.ABC.com" |
| 585 | |
| 586 | # Run openssl command to create a new private key and use that to generate a CSR string |
| 587 | # in server.csr file. |
| 588 | ${output}= Run ${ssl_cmd} ${ssl_sub} |
Prashanth Katti | 7ee2825 | 2020-09-17 01:55:17 -0500 | [diff] [blame] | 589 | ${csr}= OperatingSystem.Get File ${CSR_FILE} |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 590 | |
| 591 | [Return] ${csr} |
| 592 | |
| 593 | |
| 594 | Send CSR To VMI And Get Signed |
George Keishing | f924895 | 2021-05-28 07:52:37 -0500 | [diff] [blame] | 595 | [Documentation] Upload CSR to VMI and get signed. |
shrsuman123 | 932759b | 2021-10-19 07:23:22 -0500 | [diff] [blame] | 596 | [Arguments] ${csr} ${force_create} ${username} ${password} ${read_timeout} |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 597 | |
| 598 | # Description of argument(s): |
| 599 | # csr Certificate request from client to VMI. |
| 600 | # force_create Create a new REST session if True. |
| 601 | # username Username to create a REST session. |
| 602 | # password Password to create a REST session. |
| 603 | |
| 604 | Run Keyword If "${XAUTH_TOKEN}" != "${EMPTY}" or ${force_create} == ${True} |
| 605 | ... Initialize OpenBMC rest_username=${username} rest_password=${password} |
| 606 | |
| 607 | ${data}= Create Dictionary |
| 608 | ${headers}= Create Dictionary X-Auth-Token=${XAUTH_TOKEN} |
| 609 | ... Content-Type=application/json |
| 610 | |
| 611 | ${cert_uri}= Set Variable ${VMI_BASE_URI}Host/Actions/SignCSR |
| 612 | |
| 613 | # For SignCSR request, we need to pass CSR string generated by openssl command. |
| 614 | ${csr_data}= Create Dictionary CsrString ${csr} |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 615 | |
George Keishing | 753169e | 2022-08-18 09:57:48 -0500 | [diff] [blame] | 616 | ${resp}= POST On Session openbmc ${cert_uri} json=${csr_data} headers=${headers} |
George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 617 | ... timeout=${read_timeout} expected_status=any |
shrsuman123 | 5fc20cb | 2021-02-02 04:55:47 -0600 | [diff] [blame] | 618 | Log to console ${resp.content} |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 619 | |
| 620 | [Return] ${resp} |
| 621 | |
| 622 | |
| 623 | Get Root Certificate |
| 624 | [Documentation] Get root certificate from VMI. |
| 625 | [Arguments] ${username}=${OPENBMC_USERNAME} ${password}=${OPENBMC_PASSWORD} |
| 626 | ... ${force_create}=${False} ${valid_csr}=${True} ${valid_status_code}=${HTTP_OK} |
| 627 | |
| 628 | # Description of argument(s): |
| 629 | # cert_type Type of the certificate requesting. eg. root or SignCSR. |
| 630 | # username Username to create a REST session. |
| 631 | # password Password to create a REST session. |
| 632 | # force_create Create a new REST session if True. |
| 633 | # valid_csr Uses valid CSR string in the REST request if True. |
| 634 | # This is not applicable for root certificate. |
| 635 | # valid_status_code Expected status code from REST request. |
| 636 | |
| 637 | Run Keyword If "${XAUTH_TOKEN}" != "${EMPTY}" or ${force_create} == ${True} |
| 638 | ... Initialize OpenBMC rest_username=${username} rest_password=${password} |
| 639 | |
| 640 | ${data}= Create Dictionary |
| 641 | ${headers}= Create Dictionary X-Auth-Token=${XAUTH_TOKEN} |
| 642 | ... Content-Type=application/json |
| 643 | |
| 644 | ${cert_uri}= Set Variable ${VMI_BASE_URI}Host/Certificate/root |
| 645 | |
George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 646 | ${resp}= GET On Session openbmc ${cert_uri} &{data} headers=${headers} |
| 647 | ... expected_status=any |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 648 | |
| 649 | Should Be Equal As Strings ${resp.status_code} ${valid_status_code} |
| 650 | Return From Keyword If ${resp.status_code} != ${HTTP_OK} |
| 651 | |
| 652 | ${cert}= Evaluate json.loads('''${resp.text}''', strict=False) json |
| 653 | Should Contain ${cert["Certificate"]} BEGIN CERTIFICATE |
| 654 | Should Contain ${cert["Certificate"]} END CERTIFICATE |
| 655 | |
| 656 | |
| 657 | Get Subject |
| 658 | [Documentation] Generate a csr string. |
| 659 | [Arguments] ${file_name} ${is_csr_file} |
| 660 | |
| 661 | # Description of argument(s): |
| 662 | # file_name Name of CSR or signed CERT file. |
| 663 | # is_csr_file A True value means a CSR while a False is for signed CERT file. |
| 664 | |
George Keishing | 538f174 | 2022-03-14 05:00:55 -0500 | [diff] [blame] | 665 | ${subject}= Run Keyword If ${is_csr_file} |
| 666 | ... Run openssl req -in ${file_name} -text -noout | grep Subject: |
| 667 | ... ELSE |
| 668 | ... Run openssl x509 -in ${file_name} -text -noout | grep Subject: |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 669 | |
| 670 | [Return] ${subject} |
| 671 | |
| 672 | |
| 673 | Get Public Key |
| 674 | [Documentation] Generate a csr string. |
| 675 | [Arguments] ${file_name} ${is_csr_file} |
| 676 | |
| 677 | # Description of argument(s): |
| 678 | # file_name Name of CSR or CERT file. |
| 679 | # is_csr_file A True value means a CSR while a False is for signed CERT file. |
| 680 | |
| 681 | ${PublicKey}= Run Keyword If ${is_csr_file} Run openssl req -in ${file_name} -noout -pubkey |
| 682 | ... ELSE Run openssl x509 -in ${file_name} -noout -pubkey |
| 683 | |
| 684 | [Return] ${PublicKey} |
| 685 | |
| 686 | |
| 687 | Get Certificate Signed By VMI |
| 688 | [Documentation] Get signed certificate from VMI. |
| 689 | [Arguments] ${username}=${OPENBMC_USERNAME} ${password}=${OPENBMC_PASSWORD} |
| 690 | ... ${force_create}=${False} ${valid_csr}=${True} ${valid_status_code}=${HTTP_OK} |
shrsuman123 | 932759b | 2021-10-19 07:23:22 -0500 | [diff] [blame] | 691 | ... ${read_timeout}=20 |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 692 | |
| 693 | # Description of argument(s): |
| 694 | # cert_type Type of the certificate requesting. eg. root or SignCSR. |
| 695 | # username Username to create a REST session. |
| 696 | # password Password to create a REST session. |
| 697 | # force_create Create a new REST session if True. |
| 698 | # valid_csr Uses valid CSR string in the REST request if True. |
| 699 | # This is not applicable for root certificate. |
| 700 | # valid_status_code Expected status code from REST request. |
| 701 | |
| 702 | Set Test Variable ${CSR} CSR |
| 703 | Set Test Variable ${CORRUPTED_CSR} CORRUPTED_CSR |
| 704 | |
| 705 | ${CSR}= Generate CSR String |
shrsuman123 | 1b1c2a4 | 2020-11-02 23:02:30 -0600 | [diff] [blame] | 706 | ${csr_left} ${csr_right}= Split String From Right ${CSR} == 1 |
| 707 | ${CORRUPTED_CSR}= Catenate SEPARATOR= ${csr_left} \N ${csr_right} |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 708 | |
| 709 | # For SignCSR request, we need to pass CSR string generated by openssl command |
| 710 | ${csr_str}= Set Variable If ${valid_csr} == ${True} ${CSR} ${CORRUPTED_CSR} |
| 711 | |
| 712 | ${resp}= Send CSR To VMI And Get Signed ${csr_str} ${force_create} ${username} ${password} |
shrsuman123 | 932759b | 2021-10-19 07:23:22 -0500 | [diff] [blame] | 713 | ... ${read_timeout} |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 714 | |
| 715 | Should Be Equal As Strings ${resp.status_code} ${valid_status_code} |
| 716 | Return From Keyword If ${resp.status_code} != ${HTTP_OK} |
| 717 | |
| 718 | ${cert}= Evaluate json.loads('''${resp.text}''', strict=False) json |
| 719 | Should Contain ${cert["Certificate"]} BEGIN CERTIFICATE |
| 720 | Should Contain ${cert["Certificate"]} END CERTIFICATE |
| 721 | |
| 722 | # Now do subject and public key verification |
| 723 | ${subject_csr}= Get Subject ${CSR_FILE} True |
| 724 | ${pubKey_csr}= Get Public Key ${CSR_FILE} True |
| 725 | |
| 726 | # create a crt file with certificate string |
| 727 | ${signed_cert}= Set Variable ${cert["Certificate"]} |
shrsuman123 | 5fc20cb | 2021-02-02 04:55:47 -0600 | [diff] [blame] | 728 | ${testcert_gen_time} = Get Current Date Time |
| 729 | ${test_cert_file}= Catenate SEPARATOR=_ ${testcert_gen_time} test_certificate.cert |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 730 | |
shrsuman123 | 5fc20cb | 2021-02-02 04:55:47 -0600 | [diff] [blame] | 731 | Create File ${test_cert_file} ${signed_cert} |
| 732 | ${subject_signed_csr}= Get Subject ${test_cert_file} False |
| 733 | ${pubKey_signed_csr}= Get Public Key ${test_cert_file} False |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 734 | |
| 735 | Should be equal as strings ${subject_signed_csr} ${subject_csr} |
| 736 | Should be equal as strings ${pubKey_signed_csr} ${pubKey_csr} |
| 737 | |
| 738 | |
| 739 | Suite Setup Execution |
| 740 | [Documentation] Suite setup execution. |
| 741 | |
shrsuman123 | 5fc20cb | 2021-02-02 04:55:47 -0600 | [diff] [blame] | 742 | Remove Files *.csr *.key *.cert |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 743 | # Create different user accounts. |
| 744 | Redfish.Login |
shrsuman123 | 5fc20cb | 2021-02-02 04:55:47 -0600 | [diff] [blame] | 745 | Redfish Power On |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 746 | Create Users With Different Roles users=${USERS} force=${True} |
| 747 | |
| 748 | |
| 749 | Suite Teardown Execution |
| 750 | [Documentation] Suite teardown execution. |
| 751 | |
shrsuman123 | 5fc20cb | 2021-02-02 04:55:47 -0600 | [diff] [blame] | 752 | Remove Files *.csr *.key *.cert |
manashsarma | b7af817 | 2020-07-16 05:05:44 -0500 | [diff] [blame] | 753 | Delete BMC Users Via Redfish users=${USERS} |
| 754 | Delete All Sessions |
| 755 | Redfish.Logout |