|
| 1 | +Feature: admin/certificate_engine_switch |
| 2 | + Background: |
| 3 | + Given as user "admin" |
| 4 | + |
| 5 | + Scenario: Set engine to OpenSSL, configure it, then switch engine and verify |
| 6 | + # Define engine as OpenSSL |
| 7 | + When sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/certificate_engine" |
| 8 | + | value | openssl | |
| 9 | + Then the response should have a status code 200 |
| 10 | + # Configure OpenSSL |
| 11 | + When sending "post" to ocs "/apps/libresign/api/v1/admin/certificate/openssl" |
| 12 | + | rootCert | {"commonName":"OpenSSL Root CA"} | |
| 13 | + Then the response should have a status code 200 |
| 14 | + # Verify OpenSSL is configured correctly |
| 15 | + And sending "get" to ocs "/apps/libresign/api/v1/admin/configure-check" |
| 16 | + Then the response should have a status code 200 |
| 17 | + And the response should be a JSON array with the following mandatory values |
| 18 | + | key | value | |
| 19 | + | (jq).ocs.data\|map(select(.resource=="openssl-configure"))[0].status | success | |
| 20 | + # Switch to CFSSL engine without configuring it |
| 21 | + When sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/certificate_engine" |
| 22 | + | value | cfssl | |
| 23 | + Then the response should have a status code 200 |
| 24 | + # Verify CFSSL shows error because it's not configured |
| 25 | + And sending "get" to ocs "/apps/libresign/api/v1/admin/configure-check" |
| 26 | + Then the response should have a status code 200 |
| 27 | + And the response should be a JSON array with the following mandatory values |
| 28 | + | key | value | |
| 29 | + | (jq).ocs.data\|map(select(.resource=="cfssl-configure"))[0].status | error | |
| 30 | + | (jq).ocs.data\|map(select(.resource=="cfssl-configure"))[0].tip | Run occ libresign:configure:cfssl --help | |
| 31 | + |
| 32 | + Scenario: Set engine to none and verify error state |
| 33 | + # Delete engine configuration (set to none) |
| 34 | + When sending "delete" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/certificate_engine" |
| 35 | + Then the response should have a status code 200 |
| 36 | + # Verify configure-check shows error for default engine (OpenSSL) |
| 37 | + And sending "get" to ocs "/apps/libresign/api/v1/admin/configure-check" |
| 38 | + Then the response should have a status code 200 |
| 39 | + And the response should be a JSON array with the following mandatory values |
| 40 | + | key | value | |
| 41 | + | (jq).ocs.data\|map(select(.resource=="openssl-configure"))[0].status | error | |
| 42 | + # Verify has-root-cert returns false |
| 43 | + And sending "get" to ocs "/apps/libresign/api/v1/setting/has-root-cert" |
| 44 | + Then the response should have a status code 200 |
| 45 | + And the response should be a JSON array with the following mandatory values |
| 46 | + | key | value | |
| 47 | + | (jq).ocs.data.hasRootCert | false | |
0 commit comments