Blame tests/p_mod_wsgi/mod_wsgi_test.sh

Athmane Madjoudj 6c1e07
#!/bin/sh
Athmane Madjoudj 6c1e07
# Author: Athmane Madjoudj <athmanem@gmail.com>
Athmane Madjoudj 6c1e07
Athmane Madjoudj 6c1e07
t_Log "Running $0 - Apache httpd mod_wsgi is functional"
Athmane Madjoudj 6c1e07
if (t_GetPkgRel basesystem | grep -q el6)
Athmane Madjoudj 6c1e07
then
Athmane Madjoudj 6c1e07
Athmane Madjoudj 6c1e07
Athmane Madjoudj 6c1e07
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 0a44b1
while [ `ps fax | grep 'sbin/httpd' | grep -v grep  | wc -l` -gt 0 ]; do
Karanbir Singh bed10e
  t_ServiceControl httpd stop
Karanbir Singh 0a44b1
  sleep 1
Karanbir Singh 0a44b1
done
Christoph Galuschka 3d904e
t_ServiceControl httpd start
Athmane Madjoudj 6c1e07
Athmane Madjoudj 6c1e07
curl -s http://localhost/tfapp | grep -q 't_functional_mod_wsgi_test'
Athmane Madjoudj 6c1e07
Athmane Madjoudj 6c1e07
t_CheckExitStatus $?
Athmane Madjoudj 6c1e07
Athmane Madjoudj 6c1e07
else 
Athmane Madjoudj 6c1e07
    echo "Skipped on CentOS 5"
Athmane Madjoudj 6c1e07
fi