-
-Set Test Config
- [Documentation] Changes HV-VES config.
- [Arguments] ${kafka_server}
- ${SED}= Set Variable sed -i 's/placeholder/${kafka_server}/g' ${TEST_CONFIG_YAML_PATH}
- Run ${SED}
- ${TEST_CONFIG}= Get File ${TEST_CONFIG_YAML_PATH} encoding=UTF-8
- Save Configuration From Config Map
- Set Environment Variable TEST_CONFIG ${TEST_CONFIG}
- ${cm_name} = Get Config Map Name
- ${rc} = Run and Return RC kubectl -n onap patch cm ${cm_name} --type strategic -p "%{TEST_CONFIG}"
- Should Be Equal As Integers ${rc} 0
-
- Wait Until Keyword Succeeds 2 min 5 sec Check If Config Is Applied ${TEST_TRUSTSTORE_PASS_PATH}
- Sleep 5s
-
-Check If Config Is Applied
- [Documentation] Checks if the config is applied.
- [Arguments] ${truststore_pass_path}
- ${rc} = Run and Return RC ${COPY_CURRENT_CONFIG}
- Should Be Equal As Integers ${rc} 0
- ${rc} ${current_trust_pass_path} = Run and Return RC and Output ${GET_TRUSTSTORE_PASS_PATH}
- Should Be Equal As Integers ${rc} 0
- Should Be Equal As Strings ${truststore_pass_path} ${current_trust_pass_path}
-
-Save Configuration From Config Map
- [Documentation] Saves current configuration from hv-ves config map in OLD_CONFIG_YAML env
-
- ${cm_name} = Get Config Map Name
- ${rc} ${prev_conf} = Run and Return RC and Output kubectl -n onap get cm ${cm_name} -o json
- Should Be Equal As Integers ${rc} 0
- Create File ${PREV_CM_FILE} ${prev_conf}
- ${rc} ${prev_conf_yaml} = Run and Return RC and Output kubectl -n onap get cm ${cm_name} -o jsonpath="{.data.application_config\\.yaml}"
- Should Be Equal As Integers ${rc} 0
- Set Environment Variable OLD_CONFIG_YAML ${prev_conf_yaml}
-
-Get Config Map Name
- [Documentation] Retrieves HV-VES Config Map name
-
- ${rc} ${cm_name} = Run and Return RC and Output ${GET_CM_NAME}
- Should Be Equal As Integers ${rc} 0
- [Return] ${cm_name}
-
-Set Old Config
- [Documentation] Changes HV-VES config back to normal mode.
-
- ${rc} = Run and Return RC kubectl -n onap replace --force -f ${PREV_CM_FILE}
- Should Be Equal As Integers ${rc} 0
-
- ${rc} ${old_trust_pass_path} = Run and Return RC and Output echo "%{OLD_CONFIG_YAML}" | grep security.keys.trustStorePasswordFile
- Should Be Equal As Integers ${rc} 0
-
- Remove File ${PREV_CM_FILE}
- Remove File ${CURRENT_CONFIG_FILE}
-
- Wait Until Keyword Succeeds 2 min 5 sec Check If Config Is Applied ${old_trust_pass_path}
-
- Sleep 10s