vino/tools/deployment/test-cr.sh
Kostiantyn Kalynovskyi eda3300093 Add BMH credentials support
With this change there will be only one supported credential per
VINO CR. Since the CR is mounted inside the sushy tools container,
sushy startup script can access these credentials and set up
authentication. This approach allows to get basic functionality
working, in the future, we would probably want to hide these
credentials in a secret so they can't be seen in plain text from
VINO CR.

Change-Id: I4aa2fb1ee1f5633b889acfa901283f5fa51ad2c1
2021-03-01 16:30:21 +00:00

55 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
set -xe
# TODO (kkalynovskyi) remove this function when zuul is able to gather debug info by itself
function vinoDebugInfo () {
kubectl get po -A
kubectl get ds -A
local pod_name
pod_name="$(kubectl get pod -n vino-system -l control-plane=controller-manager -o name)"
kubectl logs -c manager ${pod_name} -n vino-system
exit 1
}
kubectl apply -f config/samples/vino_cr.yaml
kubectl apply -f config/samples/ippool.yaml
kubectl apply -f config/samples/network-template-secret.yaml
# Remove logs collection from here, when we will have zuul collect logs job
until [[ $(kubectl get vino vino-test-cr 2>/dev/null) ]]; do
count=$((count + 1))
if [[ ${count} -eq "30" ]]; then
echo ' Timed out waiting for vino test cr to exist'
vinoDebugInfo
return 1
fi
sleep 2
done
if ! kubectl wait --for=condition=Ready vino vino-test-cr --timeout=180s; then
vinoDebugInfo
fi
# no need to collect logs on fail, since they are already collected before
until [[ $(kubectl -n vino-system get ds default-vino-test-cr 2>/dev/null) ]]; do
count=$((count + 1))
if [[ ${count} -eq "30" ]]; then
echo ' Timed out waiting for vino builder daemonset to exist'
vinoDebugInfo
return 1
fi
sleep 2
done
if ! kubectl -n vino-system rollout status ds default-vino-test-cr --timeout=10s; then
vinoDebugInfo
fi
bmhCount=$(kubectl get baremetalhosts -n vino-system -o name | wc -l)
# with this setup set up, exactly 3 BMHs must have been created by VINO controller
[[ "$bmhCount" -eq "3" ]]
kubectl get secret -o yaml -n vino-system default-vino-test-cr-worker
kubectl get secret -o yaml -n vino-system default-vino-test-cr-credentials