aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJan Malkiewicz <jan.malkiewicz@nokia.com>2020-09-18 14:50:26 +0200
committerJan Malkiewicz <jan.malkiewicz@nokia.com>2020-09-21 12:05:16 +0200
commitd49ea4a64c5b89468cbd13568399534ceaec4788 (patch)
tree06548639e7f38a3eeffbedc427a05ca711b5f61e /tests
parente3e5332876dfcc0e9bd85996459b194ce1d6f249 (diff)
[OOM-CMPv2] Refactor merger/copier CSIT
Issue-ID: DCAEGEN2-2253 Signed-off-by: Jan Malkiewicz <jan.malkiewicz@nokia.com> Change-Id: I3016c2f147862b92e9446392552879af20dddf3e
Diffstat (limited to 'tests')
-rw-r--r--tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-properties.robot48
-rw-r--r--tests/oom-platform-cert-service/truststoremerger/trust-merger-test.robot32
2 files changed, 49 insertions, 31 deletions
diff --git a/tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-properties.robot b/tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-properties.robot
index a2e62f81..c773735c 100644
--- a/tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-properties.robot
+++ b/tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-properties.robot
@@ -18,21 +18,21 @@ ${PEM_TRUSTSTORE_EXPECTED_PATH} %{WORKSPACE}/tests/oom-pla
${JKSBAK_KEYSTORE_EXPECTED_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/expected_keystores/keystore.jks.bak
${JKS_KEYSTORE_EXPECTED_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/expected_keystores/keystore.jks
-${INVALID_ENV_FILE_EMPTY} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_file.env
-${INVALID_ENV_FILE_LIST_SIZE} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_different_lists_size.env
-${INVALID_ENV_FILE_EMPTY_PASSWORDS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_passwords.env
-${INVALID_ENV_FILE_PASSWORD_PATHS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_password_path.env
-${INVALID_ENV_FILE_TRUSTSTORE_PATHS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_truststore_paths.env
-${INVALID_ENV_FILE_PASSWORD} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_file_password_pair.env
-${INVALID_ENV_FILE_EXTENSION} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_extension.env
-${INVALID_ENV_FILE_DUPLICATED_ALIASES} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_duplicated_aliases.env
-${INVALID_ENV_FILE_EMPTY_CERTS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_certs.env
-${VALID_ENV_FILE_JKS_PEM_P12} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/valid_jks_pem_p12.env
-${VALID_ENV_FILE_PEM_P12} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/valid_pem_p12.env
-${VALID_ENV_FILE_SINGLE_TRUSTSTORE} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/valid_single_truststore.env
-${INVALID_KEYSTORE_SOURCE_PATHS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_keystore_source_paths.env
-${INVALID_EMPTY_KEYSTORE_DESTINATION_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_keystore_destination_path.env
-${VALID_ENVS_AND_EXTRA_OPTIONAL_ENVS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/valid_envs_and_extra_optional.env
+${ENV_FILE_EMPTY} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_file.env
+${ENV_FILE_INVALID_FILE_LIST_SIZE} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_different_lists_size.env
+${ENV_FILE_EMPTY_PASSWORDS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_passwords.env
+${ENV_FILE_INVALID_PASSWORD_PATHS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_password_path.env
+${ENV_FILE_INVALID_TRUSTSTORE_PATHS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_truststore_paths.env
+${ENV_FILE_INVALID_PASSWORD} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_file_password_pair.env
+${ENV_FILE_INVALID_FILE_EXTENSION} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_extension.env
+${ENV_FILE_DUPLICATED_ALIASES} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_duplicated_aliases.env
+${ENV_FILE_EMPTY_CERTS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_certs.env
+${ENV_FILE_JKS_PEM_P12} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/valid_jks_pem_p12.env
+${ENV_FILE_PEM_P12} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/valid_pem_p12.env
+${ENV_FILE_SINGLE_TRUSTSTORE} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/valid_single_truststore.env
+${ENV_FILE_INVALID_KEYSTORE_SOURCE_PATHS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_keystore_source_paths.env
+${ENV_FILE_EMPTY_KEYSTORE_DESTINATION_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_keystore_destination_path.env
+${ENV_FILE_EXTRA_OPTIONAL_ENVS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/valid_envs_and_extra_optional.env
${KEYSTORE_JKS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores/external/keystore.jks
${KEYSTORE_JKS_PASS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores/external/keystore.pass
@@ -41,3 +41,21 @@ ${TRUSTSTORE_JKS_PASS} %{WORKSPACE}/tests/oom-pla
${TRUSTSTORE_P12} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.p12
${TRUSTSTORE_P12_PASS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.pass
${TRUSTSTORE_PEM} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.pem
+
+${EXITCODE_SUCCESS} 0
+${EXITCODE_CERTIFICATES_PATHS_VALIDATION_EXCEPTION} 1
+${EXITCODE_CONFIGURATION_EXCEPTION} 2
+${EXITCODE_TRUSTSTORE_FILE_FACTORY_EXCEPTION} 3
+${EXITCODE_PASSWORD_READER_EXCEPTION} 4
+${EXITCODE_CREATE_BACKUP_EXCEPTION} 5
+${EXITCODE_KEYSTORE_INSTANCE_EXCEPTION} 6
+${EXITCODE_TRUSTSTORE_LOAD_FILE_EXCEPTION} 7
+${EXITCODE_TRUSTSTORE_DATA_OPERATION_EXCEPTION} 8
+${EXITCODE_MISSING_TRUSTSTORE_EXCEPTIONSUCCESS} 9
+${EXITCODE_ALIAS_CONFLICT_EXCEPTION} 10
+${EXITCODE_WRITE_TRUSTSTORE_FILE_EXCEPTION} 11
+${EXITCODE_KEYSTORE_FILE_COPY_EXCEPTION} 12
+${EXITCODE_KEYSTORE_NOT_EXIST_EXCEPTION} 13
+${EXITCODE_UNEXPECTED_EXCEPTION} 99
+
+
diff --git a/tests/oom-platform-cert-service/truststoremerger/trust-merger-test.robot b/tests/oom-platform-cert-service/truststoremerger/trust-merger-test.robot
index 2b84d2ab..f954c3ac 100644
--- a/tests/oom-platform-cert-service/truststoremerger/trust-merger-test.robot
+++ b/tests/oom-platform-cert-service/truststoremerger/trust-merger-test.robot
@@ -9,80 +9,80 @@ Resource ./resources/trust-merger-keywords.robot
Trust Merger fails when file extension is invalid
[Tags] OOM-TRUST-STORE-MERGER
[Documentation] Run with invalid truststore extension env and expect error code
- Run Trust Merger And Expect Error ${INVALID_ENV_FILE_EXTENSION} 1
+ Run Trust Merger And Expect Error ${ENV_FILE_INVALID_FILE_EXTENSION} ${EXITCODE_CERTIFICATES_PATHS_VALIDATION_EXCEPTION}
Trust Merger fails when a variable is empty
[Tags] OOM-TRUST-STORE-MERGER
[Documentation] Run with empty truststore password path env and expect error code
- Run Trust Merger And Expect Error ${INVALID_ENV_FILE_EMPTY_PASSWORDS} 1
+ Run Trust Merger And Expect Error ${ENV_FILE_EMPTY_PASSWORDS} ${EXITCODE_CERTIFICATES_PATHS_VALIDATION_EXCEPTION}
Trust Merger fails when truststore and passwords envs not provided
[Tags] OOM-TRUST-STORE-MERGER
[Documentation] Run with invalid empty envs and expect error code
- Run Trust Merger And Expect Error ${INVALID_ENV_FILE_EMPTY} 2
+ Run Trust Merger And Expect Error ${ENV_FILE_EMPTY} ${EXITCODE_CONFIGURATION_EXCEPTION}
Trust Merger fails when list sizes are different
[Tags] OOM-TRUST-STORE-MERGER
[Documentation] Run with different truststore and password envs size and expect error code
- Run Trust Merger And Expect Error ${INVALID_ENV_FILE_LIST_SIZE} 2
+ Run Trust Merger And Expect Error ${ENV_FILE_INVALID_FILE_LIST_SIZE} ${EXITCODE_CONFIGURATION_EXCEPTION}
Trust Merger fails when truststore paths are invalid
[Tags] OOM-TRUST-STORE-MERGER
[Documentation] Run with invalid truststore path and expect error code
- Run Trust Merger And Expect Error ${INVALID_ENV_FILE_TRUSTSTORE_PATHS} 3
+ Run Trust Merger And Expect Error ${ENV_FILE_INVALID_TRUSTSTORE_PATHS} ${EXITCODE_TRUSTSTORE_FILE_FACTORY_EXCEPTION}
Trust Merger fails when password path is invalid
[Tags] OOM-TRUST-STORE-MERGER
[Documentation] Run with invalid password path and expect error code
- Run Trust Merger And Expect Error ${INVALID_ENV_FILE_PASSWORD_PATHS} 4
+ Run Trust Merger And Expect Error ${ENV_FILE_INVALID_PASSWORD_PATHS} ${EXITCODE_PASSWORD_READER_EXCEPTION}
Trust Merger fails when password file pair is invalid
[Tags] OOM-TRUST-STORE-MERGER
[Documentation] Run with incorrect password env and expect error code
- Run Trust Merger And Expect Error ${INVALID_ENV_FILE_PASSWORD} 7
+ Run Trust Merger And Expect Error ${ENV_FILE_INVALID_PASSWORD} ${EXITCODE_TRUSTSTORE_LOAD_FILE_EXCEPTION}
Trust Merger fails when pem does not contain cert
[Tags] OOM-TRUST-STORE-MERGER
[Documentation] Run with empty pem truststore and expect error code
- Run Trust Merger And Expect Error ${INVALID_ENV_FILE_EMPTY_CERTS} 9
+ Run Trust Merger And Expect Error ${ENV_FILE_EMPTY_CERTS} ${EXITCODE_MISSING_TRUSTSTORE_EXCEPTIONSUCCESS}
Trust Merger fails when aliases are duplicated
[Tags] OOM-TRUST-STORE-MERGER
[Documentation] Run with duplicated aliases in truststores and expect error code
- Run Trust Merger And Expect Error ${INVALID_ENV_FILE_DUPLICATED_ALIASES} 10
+ Run Trust Merger And Expect Error ${ENV_FILE_DUPLICATED_ALIASES} ${EXITCODE_ALIAS_CONFLICT_EXCEPTION}
Trust Merger merges successfully jks pem p12
[Tags] OOM-TRUST-STORE-MERGER
[Documentation] Run with valid env file and expect merged certs from jks, pem and p12
- Run Trust Merger And Merge Truststore Files To Jks ${VALID_ENV_FILE_JKS_PEM_P12} 0 ${JKS_TRUSTSTORE_MOUNT_PATH} ${TRUSTSTORE_JKS_PASS} ${JKS_TRUSTSTORE_EXPECTED_PATH}
+ Run Trust Merger And Merge Truststore Files To Jks ${ENV_FILE_JKS_PEM_P12} ${EXITCODE_SUCCESS} ${JKS_TRUSTSTORE_MOUNT_PATH} ${TRUSTSTORE_JKS_PASS} ${JKS_TRUSTSTORE_EXPECTED_PATH}
Trust Merger merges successfully pem p12
[Tags] OOM-TRUST-STORE-MERGER
[Documentation] Run with valid env file and expect merged certs from pem and p12
- Run Trust Merger And Merge Truststore Files To Pem ${VALID_ENV_FILE_PEM_P12} 0 ${PEM_TRUSTSTORE_MOUNT_PATH} ${PEM_TRUSTSTORE_EXPECTED_PATH}
+ Run Trust Merger And Merge Truststore Files To Pem ${ENV_FILE_PEM_P12} ${EXITCODE_SUCCESS} ${PEM_TRUSTSTORE_MOUNT_PATH} ${PEM_TRUSTSTORE_EXPECTED_PATH}
Trust Merger ends successfully with single truststore
[Tags] OOM-TRUST-STORE-MERGER
[Documentation] Run with one truststore in env file and expect code 0
- Run Trust Merger And Merge Truststore Files To Jks ${VALID_ENV_FILE_SINGLE_TRUSTSTORE} 0 ${JKS_TRUSTSTORE_MOUNT_PATH} ${TRUSTSTORE_JKS_PASS} ${TRUSTSTORE_JKS}
+ Run Trust Merger And Merge Truststore Files To Jks ${ENV_FILE_SINGLE_TRUSTSTORE} ${EXITCODE_SUCCESS} ${JKS_TRUSTSTORE_MOUNT_PATH} ${TRUSTSTORE_JKS_PASS} ${TRUSTSTORE_JKS}
Trust Merger fails when file to copy does not exist
[Tags] OOM-TRUST-STORE-MERGER
[Documentation] Run with invalid extra optional env as a path to file and expect error code
- Run Trust Merger And Expect Error ${INVALID_KEYSTORE_SOURCE_PATHS} 13
+ Run Trust Merger And Expect Error ${ENV_FILE_INVALID_KEYSTORE_SOURCE_PATHS} ${EXITCODE_KEYSTORE_NOT_EXIST_EXCEPTION}
Trust Merger fails when only one extra optional env is set
[Tags] OOM-TRUST-STORE-MERGER
[Documentation] Run with empty extra optional env and expect code
- Run Trust Merger And Expect Error ${INVALID_EMPTY_KEYSTORE_DESTINATION_PATH} 2
+ Run Trust Merger And Expect Error ${ENV_FILE_EMPTY_KEYSTORE_DESTINATION_PATH} ${EXITCODE_CONFIGURATION_EXCEPTION}
Trust Merger's Copier successfully backs up files
[Tags] OOM-TRUST-STORE-MERGER
[Documentation] Run with valid env file and expect successfully backed up file
- Run Trust Merger And Merge Truststore Files To Jks ${VALID_ENVS_AND_EXTRA_OPTIONAL_ENVS} 0 ${JKS_KEYSTORE_MOUNT_PATH} ${KEYSTORE_JKS_PASS} ${JKSBAK_KEYSTORE_EXPECTED_PATH}
+ Run Trust Merger And Merge Truststore Files To Jks ${ENV_FILE_EXTRA_OPTIONAL_ENVS} ${EXITCODE_SUCCESS} ${JKS_KEYSTORE_MOUNT_PATH} ${KEYSTORE_JKS_PASS} ${JKSBAK_KEYSTORE_EXPECTED_PATH}
Trust Merger's Copier successfully copies file
[Tags] OOM-TRUST-STORE-MERGER
[Documentation] Run with valid env file and expect successfully copied file
- Run Trust Merger And Merge Truststore Files To Jks ${VALID_ENVS_AND_EXTRA_OPTIONAL_ENVS} 0 ${JKS_KEYSTORE_MOUNT_PATH} ${KEYSTORE_JKS_PASS} ${JKS_KEYSTORE_EXPECTED_PATH}
+ Run Trust Merger And Merge Truststore Files To Jks ${ENV_FILE_EXTRA_OPTIONAL_ENVS} ${EXITCODE_SUCCESS} ${JKS_KEYSTORE_MOUNT_PATH} ${KEYSTORE_JKS_PASS} ${JKS_KEYSTORE_EXPECTED_PATH}