Skip to content

Instantly share code, notes, and snippets.

@goneri
Last active Feb 18, 2020
Embed
What would you like to do?
Ansible VMware module test coverage
#!/bin/bash
echo "module,status"
for module in $(find lib -type f -name 'vmware*.py' -or -name 'vca*.py' -or -name 'vcenter*.py'|xargs -n1 basename -s .py|sort -u); do
aliases_file="test/integration/targets/${module}/aliases"
current_status="no_test"
if [ -f "${aliases_file}" ]; then
if [ -n "$(egrep '(disabled)' ${aliases_file})" ]; then
current_status="disabled"
elif [ -n "$(grep zuul ${aliases_file})" ]; then
current_status="$(grep 'zuul/vmware' "test/integration/targets/${module}/aliases"|sed 's,zuul/vmware/,,')"
fi
fi
echo "\"${module}\",\"${current_status}\""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment