[DRE-commits] [ruby-passenger] 02/03: Improve autopkgtests: Test wsgi application with python 2 and 3.

Felix Geyer fgeyer at moszumanska.debian.org
Wed Sep 10 09:15:39 UTC 2014


This is an automated email from the git hooks/post-receive script.

fgeyer pushed a commit to branch master
in repository ruby-passenger.

commit 2139ab07490674900daf04cec3414713abfac37c
Author: Felix Geyer <fgeyer at debian.org>
Date:   Wed Sep 10 11:05:25 2014 +0200

    Improve autopkgtests: Test wsgi application with python 2 and 3.
---
 debian/changelog      |  1 +
 debian/tests/control  |  2 +-
 debian/tests/wsgi     | 40 ----------------------------------------
 debian/tests/wsgi-py2 | 40 ++++++++++++++++++++++++++++++++++++++++
 debian/tests/wsgi-py3 | 41 +++++++++++++++++++++++++++++++++++++++++
 5 files changed, 83 insertions(+), 41 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 2b629ff..a8efd93 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ ruby-passenger (4.0.50-2) UNRELEASED; urgency=medium
 
   * Improve autopkgtests:
     - Be more verbose in case of errors.
+    - Test wsgi application with python 2 and 3.
 
  -- Felix Geyer <fgeyer at debian.org>  Wed, 10 Sep 2014 10:51:19 +0200
 
diff --git a/debian/tests/control b/debian/tests/control
index b4c16a8..e7c9d00 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,3 +1,3 @@
-Tests: rack wsgi nodejs
+Tests: rack wsgi-py2 wsgi-py3 nodejs
 Restrictions: needs-root
 Depends: libapache2-mod-passenger, wget, apache2, nodejs
diff --git a/debian/tests/wsgi b/debian/tests/wsgi
deleted file mode 100755
index ee223a8..0000000
--- a/debian/tests/wsgi
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cat > /etc/apache2/conf-enabled/passenger-wsgi.conf <<EOT
-Alias /testwsgi /var/www/testwsgi/public
-<Location /testwsgi>
-  PassengerBaseURI /testwsgi
-  PassengerAppRoot /var/www/testwsgi
-</Location>
-EOT
-
-mkdir /var/www/testwsgi
-mkdir /var/www/testwsgi/public
-mkdir /var/www/testwsgi/tmp
-cat > /var/www/testwsgi/passenger_wsgi.py <<EOT
-def application(environ, start_response):
-    start_response('200 OK', [('Content-Type', 'text/plain')])
-    return [b"hello world\n"]
-EOT
-chown -R www-data:www-data /var/www/testwsgi
-
-a2enmod passenger
-service apache2 reload
-
-if ! output=`wget -O- http://localhost/testwsgi/ 2>/dev/null`; then
-  echo "wget failed, output was:"
-  echo "$output"
-  echo
-  echo "Retest:"
-  wget -O- http://localhost/testwsgi/
-  exit 1
-else
-  if [ "$output" != "hello world" ]; then
-    echo "output is wrong"
-    echo "got:      | $output |"
-    echo "expected: | hello world |"
-    exit 1
-  fi
-fi
diff --git a/debian/tests/wsgi-py2 b/debian/tests/wsgi-py2
new file mode 100755
index 0000000..3e2acd7
--- /dev/null
+++ b/debian/tests/wsgi-py2
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+set -e
+
+cat > /etc/apache2/conf-enabled/passenger-wsgi-py2.conf <<EOT
+Alias /testwsgi /var/www/testwsgi-py2/public
+<Location /testwsgi-py2>
+  PassengerBaseURI /testwsgi-py2
+  PassengerAppRoot /var/www/testwsgi-py2
+</Location>
+EOT
+
+mkdir /var/www/testwsgi-py2
+mkdir /var/www/testwsgi-py2/public
+mkdir /var/www/testwsgi-py2/tmp
+cat > /var/www/testwsgi-py2/passenger_wsgi.py <<EOT
+def application(environ, start_response):
+    start_response('200 OK', [('Content-Type', 'text/plain')])
+    return [b"hello world\n"]
+EOT
+chown -R www-data:www-data /var/www/testwsgi-py2
+
+a2enmod passenger
+service apache2 reload
+
+if ! output=`wget -O- http://localhost/testwsgi-py2/ 2>/dev/null`; then
+  echo "wget failed, output was:"
+  echo "$output"
+  echo
+  echo "Retest:"
+  wget -O- http://localhost/testwsgi-py2/
+  exit 1
+else
+  if [ "$output" != "hello world" ]; then
+    echo "output is wrong"
+    echo "got:      | $output |"
+    echo "expected: | hello world |"
+    exit 1
+  fi
+fi
diff --git a/debian/tests/wsgi-py3 b/debian/tests/wsgi-py3
new file mode 100755
index 0000000..140cc2d
--- /dev/null
+++ b/debian/tests/wsgi-py3
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -e
+
+cat > /etc/apache2/conf-enabled/passenger-wsgi-py3.conf <<EOT
+Alias /testwsgi /var/www/testwsgi-py3/public
+<Location /testwsgi-py3>
+  PassengerPython /usr/bin/python3
+  PassengerBaseURI /testwsgi-py3
+  PassengerAppRoot /var/www/testwsgi-py3
+</Location>
+EOT
+
+mkdir /var/www/testwsgi-py3
+mkdir /var/www/testwsgi-py3/public
+mkdir /var/www/testwsgi-py3/tmp
+cat > /var/www/testwsgi-py3/passenger_wsgi.py <<EOT
+def application(environ, start_response):
+    start_response('200 OK', [('Content-Type', 'text/plain')])
+    return [b"hello world\n"]
+EOT
+chown -R www-data:www-data /var/www/testwsgi-py3
+
+a2enmod passenger
+service apache2 reload
+
+if ! output=`wget -O- http://localhost/testwsgi-py3/ 2>/dev/null`; then
+  echo "wget failed, output was:"
+  echo "$output"
+  echo
+  echo "Retest:"
+  wget -O- http://localhost/testwsgi-py3/
+  exit 1
+else
+  if [ "$output" != "hello world" ]; then
+    echo "output is wrong"
+    echo "got:      | $output |"
+    echo "expected: | hello world |"
+    exit 1
+  fi
+fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-passenger.git



More information about the Pkg-ruby-extras-commits mailing list