Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 3 | if [[ "$debug" == "True" ]]; then |
| 4 | set -o xtrace |
| 5 | fi |
| 6 | |
Victor Morales | e746700 | 2017-08-30 14:50:43 -0500 | [diff] [blame] | 7 | source /var/onap_tests/asserts |
Victor Morales | 332d7d8 | 2017-11-06 11:51:37 -0800 | [diff] [blame] | 8 | source /var/onap/commons |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 9 | |
| 10 | # main() - Starting point for Unit Tests |
| 11 | function main { |
| 12 | local covered_functions=("$@") |
| 13 | |
Victor Morales | 332d7d8 | 2017-11-06 11:51:37 -0800 | [diff] [blame] | 14 | update_repos |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 15 | len=${#covered_functions[@]} |
| 16 | echo "1..$len" |
| 17 | for i in ${!covered_functions[@]}; do |
| 18 | dpkg --get-selections > installed-software |
| 19 | sort -o installed-software installed-software |
| 20 | test_${covered_functions[$i]} |
| 21 | echo "ok $((i+1)) - test_${covered_functions[$i]}" |
| 22 | |
| 23 | # Teardown process |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 24 | if is_package_installed docker-ce; then |
Victor Morales | cf26999 | 2017-10-18 09:29:55 -0700 | [diff] [blame] | 25 | docker images -q | xargs docker rmi -f |
| 26 | fi |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 27 | dpkg --get-selections > installed-software_new |
| 28 | sort -o installed-software_new installed-software_new |
| 29 | apt-get purge -y -qq $(comm -3 installed-software installed-software_new | awk '{print $1}') |
| 30 | #rm -rf $git_src_folder |
| 31 | #rm -rf ~/.m2/ |
| 32 | done |
| 33 | } |