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