#!/bin/bash
#    squid: wrapper for squid quality assurance test
#    Copyright (C) 2013-2017 Canonical Ltd.
#    Author: Yolanda <yolanda.robla@canonical.com>
#    Author: Christian Ehrhardt <christian.ehrhardt@canonical.com>
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.


#--------------
# Testing squid
#--------------
set -e

# configure vsftpd
sed -i "s/anonymous_enable[[:blank:]]*=[[:blank:]]*.*/anonymous_enable=YES/g" /etc/vsftpd.conf
echo "seccomp_sandbox=NO" >> /etc/vsftpd.conf
service vsftpd restart 2>&1 > /dev/null
# configure basic http&https apache2
a2enmod ssl
a2ensite default-ssl
systemctl restart apache2
python3 `dirname $0`/test-squid.py 2>&1
