Blame tests/p_httpd/httpd_vhost.sh

Karanbir Singh 0b5bb2
#!/bin/sh
Karanbir Singh 0b5bb2
# Author: Athmane Madjoudj <athmanem@gmail.com>
Karanbir Singh 0b5bb2
Karanbir Singh 106bcf
t_Log "Running $0 - httpd: NameVirtualHost is functional"
Karanbir Singh 2dd0be
Karanbir Singh 0b5bb2
echo "127.0.0.1   test" >>  /etc/hosts
Karanbir Singh 0b5bb2
cat > /etc/httpd/conf.d/vhost-test.conf <
Karanbir Singh 0b5bb2
NameVirtualHost *:80
Karanbir Singh 0b5bb2
Karanbir Singh 0b5bb2
<VirtualHost *:80>
Karanbir Singh 0b5bb2
 ServerAdmin webmaster@test
Karanbir Singh 0b5bb2
 DocumentRoot /var/www/vhosts/test/
Karanbir Singh 0b5bb2
 ServerName test
Karanbir Singh 0b5bb2
</VirtualHost>
Karanbir Singh 0b5bb2
EOF
Karanbir Singh 0b5bb2
Karanbir Singh 0b5bb2
mkdir -p /var/www/vhosts/test/
Karanbir Singh 0b5bb2
echo "Virtual Host Test Page" > /var/www/vhosts/test/index.html
Christoph Galuschka 89cd74
t_ServiceControl httpd stop
Christoph Galuschka a8bfc7
sleep 3
Christoph Galuschka 89cd74
killall httpd
Christoph Galuschka a8bfc7
sleep 3
Christoph Galuschka 89cd74
t_ServiceControl httpd start
Christoph Galuschka 89cd74
Steve Barnes bf9e19
curl -s http://test/ | grep 'Virtual Host Test Page' > /dev/null 2>&1
Karanbir Singh 2dd0be
Christoph Galuschka 89cd74
t_CheckExitStatus $?
Karanbir Singh 2dd0be
Karanbir Singh 2dd0be
# SteveCB: remove vhost-test.conf to prevent later tests 
Karanbir Singh 2dd0be
# that assume DocumentRoot is /var/www/html from failing
Christoph Galuschka a8bfc7
/bin/rm /etc/httpd/conf.d/vhost-test.conf
Athmane Madjoudj 412646
t_ServiceControl httpd stop
Steve Barnes 724d58