Skip to content
Snippets Groups Projects
Verified Commit 64096380 authored by David Hoese's avatar David Hoese
Browse files

Refactor run_basic_grb_test.sh to be more easily maintained

parent 5e52db65
No related branches found
No related tags found
No related merge requests found
......@@ -9,32 +9,44 @@ error() {
exit 1
}
install_charts() {
pushd geosphere-grb/chart
helm upgrade -v 2 --install --namespace $ns -f ../../ci_tests/values-grb-g16.yaml ${GRB_RELEASE_NAME} cspp-geo-grb/
popd
}
get_pod_name() {
release_name="$1"
kubectl -n $ns get pods --selector=app.kubernetes.io/instance=${release_name} -o name
}
run_grb_checks() {
count=0
while true; do
num_files=$(kubectl exec -n $ns ${GRB_POD_NAME} -c cspp-geo-grb-notifier -- ls -1 /dst | wc -l || echo 0)
let count=count+1
if [[ $num_files -gt 16 ]]; then
debug "Got at least 16 files"
break
fi
if [[ $count -gt 10 ]]; then
error "Took too long for GRB to produce files"
fi
sleep 10
done
}
set -e
ns=$(./helpers/get_namespace.sh)
source ci_tests/get_release_names.sh
pushd geosphere-grb/chart
helm upgrade -v 2 --install --namespace $ns -f ../../ci_tests/values-grb-g16.yaml ${GRB_RELEASE_NAME} cspp-geo-grb/
popd
install_charts
# give kubernetes a bit to create the pod
sleep 30
debug "Getting pod name"
GRB_POD_NAME=$(kubectl -n $ns get pods --selector=app.kubernetes.io/instance=${GRB_RELEASE_NAME} -o name)
debug "Getting GRB pod name"
GRB_POD_NAME=$(get_pod_name "${GRB_RELEASE_NAME}")
debug "GRB pod name: ${GRB_POD_NAME}"
count=0
while true; do
num_files=$(kubectl exec -n $ns ${GRB_POD_NAME} -c cspp-geo-grb-notifier -- ls -1 /dst | wc -l || echo 0)
let count=count+1
if [[ $num_files -gt 16 ]]; then
debug "Got at least 16 files"
break
fi
if [[ $count -gt 10 ]]; then
error "Took too long for GRB to produce files"
fi
sleep 10
done
run_grb_checks || error "GRB checks failed"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment