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
Steve Barnes 464547
t_ServiceControl httpd reload
Steve Barnes bf9e19
curl -s http://test/ | grep 'Virtual Host Test Page' > /dev/null 2>&1
Karanbir Singh 2dd0be
Karanbir Singh 2dd0be
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
Karanbir Singh 2dd0be
rm /etc/httpd/conf.d/vhost-test.conf
Athmane Madjoudj 412646
t_ServiceControl httpd stop
Steve Barnes 724d58