vino/tools/deployment/test-cr.sh
Kostiantyn Kalynovskyi 1df9ba7978 Add basic integration test for vino CR
This commit introduces a script to instal k8s with minukube, with
basic test environment for VINO.

And runs basic test that makes sure that if daemonset is succefully
deployed vino CR is marked as ready.

Ensure docker role is left intentionally because it also adds current
user to docker group which allows other scripts to invoke docker
commands without sudo. It will be removed in next patchsets.

Change-Id: Iff7c956aa88ffbcf0d85956da4057fce526b67fc
2021-01-12 13:48:52 -06:00

26 lines
852 B
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/daemonset_template.yaml -f config/samples/vino_cr_daemonset_template.yaml
# Remove logs collection from here, when we will have zuul collect logs job
if ! kubectl wait --for=condition=Ready vino vino-with-template --timeout=180s; then
vinoDebugInfo
fi
# no need to collect logs on fail, since they are already collected before
if ! kubectl wait --for=condition=Ready pods -l 'vino-test=cr-with-ds-template' --timeout=5s; then
vinoDebugInfo
fi