Use a specific script to run the bootstrap tests.

Additionally test git installs using a specific tag and sha commit.
This commit is contained in:
Pedro Algarvio 2013-01-23 19:16:44 +00:00
parent 68726344a9
commit 421fe1b843
2 changed files with 79 additions and 7 deletions

78
.run-boostrap-tests.sh Executable file
View file

@ -0,0 +1,78 @@
#!/bin/bash -
#===============================================================================
#
# FILE: .travis-ci-test.sh
#
# USAGE: ./.travis-ci-test.sh
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Pedro Algarvio (s0undt3ch), pedro@algarvio.me
# ORGANIZATION: UfSoft.org
# CREATED: 01/23/2013 06:01:27 PM WET
# REVISION: ---
#===============================================================================
set -o nounset # Treat unset variables as an error
COLUMNS=$(tput cols) || 80
title_echo() {
title="$1"
line="$(printf "%${COLUMNS}s" "")"
printf "\033[1;34m%s\033[0m\n" "${line// /*}"
printf "\033[1;34m%*s\033[0m\n" $(((${#title}+$COLUMNS)/2)) "$title"
# printf "\033[1;34m%s\033[0m\n" "${line// /*}"
}
failed_echo() {
title="FAILED"
line="$(printf "%${COLUMNS}s" "")"
# printf "\031[1;34m%s\033[0m\n" "${line// /*}"
printf "\031[1;34m%*s\033[0m\n" $(((${#title}+$COLUMNS)/2)) "$title"
printf "\031[1;34m%s\033[0m\n" "${line// /*}"
exit 1
}
passed_echo() {
title="OK"
line="$(printf "%${COLUMNS}s" "")"
# printf "\033[1;32m%s\033[0m\n" "${line// /*}"
printf "\033[1;32m%*s\033[0m\n" $(((${#title}+$COLUMNS)/2)) "$title"
printf "\033[1;32m%s\033[0m\n" "${line// /*}"
}
title_echo "Running checkbashisms"
/usr/bin/checkbashisms -pxfn bootstrap-salt-minion.sh && passed_echo || failed_echo
title_echo "Installing using bash"
(sudo /bin/bash bootstrap-salt-minion.sh && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) && passed_echo || failed_echo
title_echo "Installing using sh"
(sudo ./bootstrap-salt-minion.sh && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) && passed_echo || failed_echo
title_echo "Installing stable with sh"
(sudo ./bootstrap-salt-minion.sh stable && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) && passed_echo || failed_echo
title_echo "Installing ubuntu daily packages using sh"
(sudo ./bootstrap-salt-minion.sh daily && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) && passed_echo || failed_echo
title_echo "Using an unknown installation type fails"
sudo ./bootstrap-salt-minion.sh foobar && failed_echo || passed_echo
title_echo "Installing stable piped through sh"
(cat ./bootstrap-salt-minion.sh | sudo sh && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) && passed_echo || failed_echo
title_echo "Installing latest develop branch from git"
(sudo ./bootstrap-salt-minion.sh git develop && salt --versions-report && sudo rm -rf /tmp/git ) && passed_echo || failed_echo
title_echo "Installing from a specific git tag"
(sudo ./bootstrap-salt-minion.sh git v0.12.1 && salt --versions-report && sudo rm -rf /tmp/git ) && passed_echo || failed_echo
title_echo "Installing from a specific git sha commit"
(sudo ./bootstrap-salt-minion.sh git bf1d7dfb733a6133d6a750e0ab63a27e72cf7e81 && salt --versions-report && sudo rm -rf /tmp/git ) && passed_echo || failed_echo

View file

@ -2,13 +2,7 @@ before_install:
- sudo apt-get update && sudo apt-get install devscripts
script:
- /usr/bin/checkbashisms -pxfn bootstrap-salt-minion.sh || exit 1
- (/bin/echo -e '\nInstalling stable with bash' && sudo /bin/bash bootstrap-salt-minion.sh && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) || exit 1
- (/bin/echo -e '\nInstalling stable with sh' && sudo ./bootstrap-salt-minion.sh && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) || exit 1
- (/bin/echo -e '\nInstalling explicit stable with sh' && sudo ./bootstrap-salt-minion.sh stable && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) || exit 1
- (/bin/echo -e '\nInstalling ubuntu daily with sh' && sudo ./bootstrap-salt-minion.sh daily && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) || exit 1
- (/bin/echo -e '\nInstalling stable piped trough sh' && cat ./bootstrap-salt-minion.sh | sudo sh && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) || exit 1
- (/bin/echo -e '\nInstalling from GIT' && sudo ./bootstrap-salt-minion.sh git develop && salt --versions-report) || exit 1
- ./.run-boostrap-tests.sh
notifications:
irc: