testCampaignAll 1.05 KB
Newer Older
johan's avatar
johan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#! /bin/sh
# This script check if we have the tests patterns and download them if needed
# then run all available tests

# Do we have a patterns directory
if [ ! -d "patterns" ]; then
   # no pattern directory: download it from 
   # http://www.belledonne-communications.com/downloads/bcg729-patterns.zip
   wget http://www.belledonne-communications.com/downloads/bcg729-patterns.zip
   if [ -e bcg729-patterns.zip ]; then
	# check file
	if [[ `md5sum bcg729-patterns.zip | grep -c 75b4fb8b286485c375c9c326f8b9eb66` -ne 0 ]]; then
		# file ok, unzip it
		unzip bcg729-patterns.zip
	   	if [[ $? -ne 0 ]]; then
			echo "Error: unable to unzip correctly bcg729-patterns.zip, try to do it manually"
		else	
			rm bcg729-patterns.zip
		fi
	else
		echo "Error: bad checksum on bcg729-patterns.zip downloaded from http://www.belledonne-communications.com/downloads/.\nTry again"
		exit 1
	fi
   else
	echo "Error: Unable to download bcg729-patterns.zip pattern archive from http://www.belledonne-communications.com/downloads/"
	exit 1
   fi
fi

# run all the tests
./testCampaign all