Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
Better logging + test multiple ansible versions (#243)
Browse files Browse the repository at this point in the history
* Run PVC tests first to maybe avoid hitting #240

* Show useful info when finishing tests

* Test both stable and devel ansible
  • Loading branch information
mmazur authored and pkliczewski committed Jun 3, 2019
1 parent 1fa9bc4 commit bfb4913
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
23 changes: 21 additions & 2 deletions automation/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,35 @@ export PATH=$HOME/.local/bin:$PATH
export K8S_AUTH_KUBECONFIG="$KUBE_CFG"

# Make sure that the VM is properly shut down on exit
trap '{ make cluster-down; }' EXIT SIGINT SIGTERM SIGSTOP
trap '{ set +e; ansible --version; _kubectl get pvc -o yaml; _kubectl get vmis -o yaml; _kubectl get vms -o yaml; _kubectl get pods --all-namespaces; make cluster-down; }' EXIT SIGINT SIGTERM SIGSTOP

make cluster-down
make cluster-up
make cluster-sync

# Deps
pip3 install --user pyasn1 pyopenssl openshift
pip3 install --user git+https://github.com/ansible/ansible.git
pip3 install --user -r requirements-dev.txt

# STABLE ansible
pip3 install --user ansible

ansible-playbook --version
ansible-playbook -vvv tests/playbooks/all.yml

sleep 30

# DEV ansible
pip3 uninstall -y ansible
pip3 install --user git+https://github.com/ansible/ansible.git

# First make sure everything has been cleaned up
objcount=$( for kind in vmi pvc vm vmirs; do _kubectl get $kind -o name; done | wc -l )
if [ $objcount != 0 ]; then
echo "Playbooks did not clean up after themselves; aborting"
exit 1
fi

# And another one
ansible-playbook --version
ansible-playbook -vvv tests/playbooks/all.yml
3 changes: 3 additions & 0 deletions cluster/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ fi
# A bit of debugging info
diff -urN ${KUBE_CFG}.orig $KUBE_CFG || :

sleep 30

_kubectl get nodes
_kubectl get pods --all-namespaces
2 changes: 1 addition & 1 deletion tests/playbooks/all.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- import_playbook: kubevirt_pvc.yml
- import_playbook: kubevirt_vm.yml
- import_playbook: kubevirt_dv_vm.yaml
- import_playbook: kubevirt_preset.yml
- import_playbook: kubevirt_vmir.yml
- import_playbook: kubevirt_pvc.yml
- import_playbook: e2e.yaml

0 comments on commit bfb4913

Please sign in to comment.