[DRE-commits] [ruby-passenger] 03/03: Add autopkgtests for running simple rack, wsgi and nodejs applications.

Felix Geyer fgeyer at moszumanska.debian.org
Sun Aug 31 13:12:31 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 2b9b7dde151e803c06b9fb2a24795f70d407331a
Author: Felix Geyer <fgeyer at debian.org>
Date:   Sun Aug 31 15:12:06 2014 +0200

    Add autopkgtests for running simple rack, wsgi and nodejs applications.
---
 debian/changelog     |  1 +
 debian/tests/control |  3 +++
 debian/tests/nodejs  | 30 ++++++++++++++++++++++++++++++
 debian/tests/rack    | 28 ++++++++++++++++++++++++++++
 debian/tests/wsgi    | 27 +++++++++++++++++++++++++++
 5 files changed, 89 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6e4855c..99e5940 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ ruby-passenger (4.0.49-2) UNRELEASED; urgency=medium
 
   * Change default node.js binary name to "nodejs" instead of "node".
   * Add nodejs to Suggests.
+  * Add autopkgtests for running simple rack, wsgi and nodejs applications.
 
  -- Felix Geyer <fgeyer at debian.org>  Sat, 30 Aug 2014 19:51:09 +0200
 
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..b4c16a8
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: rack wsgi nodejs
+Restrictions: needs-root
+Depends: libapache2-mod-passenger, wget, apache2, nodejs
diff --git a/debian/tests/nodejs b/debian/tests/nodejs
new file mode 100755
index 0000000..3fec433
--- /dev/null
+++ b/debian/tests/nodejs
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+set -e
+
+cat > /etc/apache2/conf-enabled/passenger-nodejs.conf <<EOT
+Alias /testnodejs /var/www/testnodejs/public
+<Location /testnodejs>
+  PassengerBaseURI /testnodejs
+  PassengerAppRoot /var/www/testnodejs
+</Location>
+EOT
+
+mkdir /var/www/testnodejs
+mkdir /var/www/testnodejs/public
+mkdir /var/www/testnodejs/tmp
+cat > /var/www/testnodejs/app.js <<EOT
+var http = require('http');
+var server = http.createServer(function(req, res) {
+    res.writeHead(200, { 'Content-Type': 'text/plain' });
+    res.end("hello world\n");
+});
+server.listen(3000);
+EOT
+chown -R www-data:www-data /var/www/testnodejs
+
+a2enmod passenger
+service apache2 reload
+
+output=`wget -O- http://localhost/testnodejs/ 2>/dev/null`
+test "$output" = "hello world"
diff --git a/debian/tests/rack b/debian/tests/rack
new file mode 100755
index 0000000..2d9d781
--- /dev/null
+++ b/debian/tests/rack
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+set -e
+
+cat > /etc/apache2/conf-enabled/passenger-rack.conf <<EOT
+Alias /testrack /var/www/testrack/public
+<Location /testrack>
+  PassengerBaseURI /testrack
+  PassengerAppRoot /var/www/testrack
+</Location>
+EOT
+
+mkdir /var/www/testrack
+mkdir /var/www/testrack/public
+mkdir /var/www/testrack/tmp
+cat > /var/www/testrack/config.ru <<EOT
+app = proc do |env|
+    [200, { "Content-Type" => "text/html" }, ["hello world"]]
+end
+run app
+EOT
+chown -R www-data:www-data /var/www/testrack
+
+a2enmod passenger
+service apache2 reload
+
+output=`wget -O- http://localhost/testrack/ 2>/dev/null`
+test "$output" = "hello world"
diff --git a/debian/tests/wsgi b/debian/tests/wsgi
new file mode 100755
index 0000000..fa4a75e
--- /dev/null
+++ b/debian/tests/wsgi
@@ -0,0 +1,27 @@
+#!/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
+
+output=`wget -O- http://localhost/testwsgi/ 2>/dev/null`
+test "$output" = "hello world"

-- 
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