blob: b30632d263133cea46c36ff7237add6ca16345a5 [file] [log] [blame]
Victor Moralesdd074802017-07-26 16:06:35 -05001#!/bin/bash
2
Victor Moralesf1f1ba52017-11-20 16:38:28 -08003if [[ "$debug" == "True" ]]; then
4 set -o xtrace
5fi
6
Victor Moralese7467002017-08-30 14:50:43 -05007source /var/onap_tests/asserts
Victor Morales332d7d82017-11-06 11:51:37 -08008source /var/onap/commons
Victor Moralesdd074802017-07-26 16:06:35 -05009
10# main() - Starting point for Unit Tests
11function main {
12 local covered_functions=("$@")
13
Victor Morales332d7d82017-11-06 11:51:37 -080014 update_repos
Victor Moralesdd074802017-07-26 16:06:35 -050015 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 Moralesf1f1ba52017-11-20 16:38:28 -080024 if is_package_installed docker-ce; then
Victor Moralescf269992017-10-18 09:29:55 -070025 docker images -q | xargs docker rmi -f
26 fi
Victor Moralesdd074802017-07-26 16:06:35 -050027 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}