blob: 78c7f8bb4d580a9729e6094c6bc7c18f70a1fc57 [file] [log] [blame]
Victor Moralesdd074802017-07-26 16:06:35 -05001#!/bin/bash
2
Victor Moralese7467002017-08-30 14:50:43 -05003source /var/onap_tests/asserts
Victor Morales332d7d82017-11-06 11:51:37 -08004source /var/onap/commons
Victor Moralesdd074802017-07-26 16:06:35 -05005
6# main() - Starting point for Unit Tests
7function main {
8 local covered_functions=("$@")
9
Victor Morales332d7d82017-11-06 11:51:37 -080010 update_repos
Victor Moralesdd074802017-07-26 16:06:35 -050011 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 Moralescf269992017-10-18 09:29:55 -070020 if ! is_package_installed docker-ce; then
21 docker images -q | xargs docker rmi -f
22 fi
Victor Moralesdd074802017-07-26 16:06:35 -050023 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}