Blame tests/p_mod_wsgi/mod_wsgi_test.sh

Athmane Madjoudj 6c1e07
#!/bin/sh
Athmane Madjoudj 6c1e07
Athmane Madjoudj 6c1e07
t_Log "Running $0 - Apache httpd mod_wsgi is functional"
Masami Ichikawa 957a2d
if [ $centos_ver -ge 6 ]
Masami Ichikawa 957a2d
then
Karanbir Singh 90a10d
	while [ `ps fax | grep 'sbin/httpd' | grep -v grep  | wc -l` -gt 0 ]; do
Athmane Madjoudj 23f484
      #t_ServiceControl httpd stop
Athmane Madjoudj 23f484
      killall -s KILL httpd
Karanbir Singh 90a10d
	  sleep 1
Karanbir Singh 90a10d
	done
Athmane Madjoudj 6c1e07
Karanbir Singh 90a10d
	cat > /etc/httpd/conf.d/tf_app.conf <
Athmane Madjoudj 6c1e07
WSGIScriptAlias /tfapp /var/www/html/tf_app.wsgi
Athmane Madjoudj 6c1e07
EOF
Athmane Madjoudj 6c1e07
Athmane Madjoudj 6c1e07
cat > /var/www/html/tf_app.wsgi <
Athmane Madjoudj 6c1e07
Athmane Madjoudj 6c1e07
def application(environ, start_response):
Athmane Madjoudj 6c1e07
    status = '200 OK'
Athmane Madjoudj 6c1e07
    output = 't_functional_mod_wsgi_test'
Athmane Madjoudj 6c1e07
Athmane Madjoudj 6c1e07
    response_headers = [('Content-type', 'text/plain'),
Athmane Madjoudj 6c1e07
                        ('Content-Length', str(len(output)))]
Athmane Madjoudj 6c1e07
    start_response(status, response_headers)
Athmane Madjoudj 6c1e07
Athmane Madjoudj 6c1e07
    return [output]
Athmane Madjoudj 6c1e07
EOF
Athmane Madjoudj 6c1e07
Karanbir Singh 90a10d
	t_ServiceControl httpd start
Karanbir Singh 90a10d
	curl -s http://localhost/tfapp | grep -q 't_functional_mod_wsgi_test'
Karanbir Singh 90a10d
	t_CheckExitStatus $?
Karanbir Singh 90a10d
	t_ServiceControl  httpd stop
Athmane Madjoudj 6c1e07
Athmane Madjoudj 6c1e07
else 
Athmane Madjoudj 6c1e07
    echo "Skipped on CentOS 5"
Athmane Madjoudj 23f484
fi