Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.5] Bug 1874352: Fixed 4.4->4.5 upgrade test #474

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 16 additions & 6 deletions hack/testing-olm-upgrade/test-020-olm-upgrade-4.4-4.5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ get_es_indices() {
| xargs -I '{}' oc -n openshift-operators-redhat exec '{}' -c elasticsearch -- es_util --query=_cat/indices
}

get_es_indices_names() {
oc -n openshift-operators-redhat get pods -l component=elasticsearch --no-headers=true --ignore-not-found \
| awk 'NR==1{print $1}' \
| xargs -I '{}' oc -n openshift-operators-redhat exec '{}' -c elasticsearch -- es_util --query=_cat/indices \
| awk '{print $3}'
}

read_es_indices() {
local -n map=$1
while IFS= read -r line; do
Expand Down Expand Up @@ -141,8 +148,7 @@ try_func_until_text_alt get_es_cluster_status "\"green\"" "\"yellow\"" ${ES_POD_
# read OLD 4.4 indices into and map them by their names
log::info "Reading old ES indices"
try_func_until_result_is_not_empty get_es_indices ${ES_POD_TIMEOUT}
declare -A old_indices
read_es_indices old_indices
old_indices=$(get_es_indices_names)

#### INSTALLING 4.5
log::info "Deploying the ES operator from the catalog..."
Expand Down Expand Up @@ -187,8 +193,12 @@ try_func_until_text_alt get_es_cluster_status "\"green\"" "\"yellow\"" ${ES_POD_

# read new 4.5 indices and map them by their names
log::info "Reading new ES indices"
try_func_until_result_is_not_empty get_es_indices ${ES_POD_TIMEOUT}
declare -A new_indices
read_es_indices new_indices
try_func_until_result_is_not_empty get_es_indices_names ${ES_POD_TIMEOUT}
new_indices=$(get_es_indices_names)

if [ "$old_indices" != "$new_indices" ]; then
log:info "Test failed"
exit 1
fi

compare_indices_names old_indices new_indices
log:info "Test passed"