chg: [tests] Better handling and enabled mailing.

pull/16/head
Steve Clement 2019-05-01 23:59:09 +09:00
parent 166041442e
commit 69521a943f
1 changed files with 6 additions and 5 deletions

View File

@ -5,22 +5,23 @@ mv /tmp/crontab /etc/cron.d/misp
# package # package
echo "--- autoremove for apt ---" echo "--- autoremove for apt ---"
apt-get -y autoremove > /dev/null 2>&1 apt-get autoremove -qq > /dev/null 2>&1
echo "--- Cleaning packages" echo "--- Cleaning packages"
apt-get -y clean > /dev/null 2>&1 apt-get clean -qq > /dev/null 2>&1
apt-get install mailutils -qq > /dev/null 2>&1
echo "--- Testing Instance ---" echo "--- Testing Instance ---"
cd /var/www/MISP/PyMISP cd /var/www/MISP/PyMISP
/var/www/MISP/venv/bin/python tests/testlive_comprehensive.py 2> /tmp/tests-output.txt /var/www/MISP/venv/bin/python tests/testlive_comprehensive.py 2> /tmp/tests-output.txt
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
## set smtp=smtp://149.13.33.5 ; cat /tmp/output.txt |mail -s "tests/testlive_comprehensive.py failed on autogen-VM" steve.clement@circl.lu echo "Damage, terrible terrible damage!!!!" >> /tmp/tests-output.txt
echo "Damage, terrible terrible damage!!!!" >> /tmp/tests-output.txt set smtp=smtp://149.13.33.5 ; cat /tmp/tests-output.txt |mail -s "tests/testlive_comprehensive.py failed on autogen-VM" steve.clement@circl.lu
fi fi
rm -rf tests/viper-test-files rm -rf tests/viper-test-files
##rm /tmp/output.txt
# End Cleaning # End Cleaning
echo "VM cleaned and rebooting for automagic reas0ns." echo "VM cleaned and rebooting for automagic reas0ns."