diff options
Diffstat (limited to 'tests/_test_base')
-rwxr-xr-x | tests/_test_base | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/_test_base b/tests/_test_base new file mode 100755 index 0000000..b30632d --- /dev/null +++ b/tests/_test_base @@ -0,0 +1,33 @@ +#!/bin/bash + +if [[ "$debug" == "True" ]]; then + set -o xtrace +fi + +source /var/onap_tests/asserts +source /var/onap/commons + +# main() - Starting point for Unit Tests +function main { + local covered_functions=("$@") + + update_repos + len=${#covered_functions[@]} + echo "1..$len" + for i in ${!covered_functions[@]}; do + dpkg --get-selections > installed-software + sort -o installed-software installed-software + test_${covered_functions[$i]} + echo "ok $((i+1)) - test_${covered_functions[$i]}" + + # Teardown process + if is_package_installed docker-ce; then + docker images -q | xargs docker rmi -f + fi + dpkg --get-selections > installed-software_new + sort -o installed-software_new installed-software_new + apt-get purge -y -qq $(comm -3 installed-software installed-software_new | awk '{print $1}') + #rm -rf $git_src_folder + #rm -rf ~/.m2/ + done +} |