diff --git a/INSTALL b/INSTALL index 0a7ef7c5ce1a41d8aca3f477f59fc3e4e1e669c9..87638643152d72251708adee7f312e0da47be300 100644 --- a/INSTALL +++ b/INSTALL @@ -1,3 +1,16 @@ +To setup a production environment: + + $ sudo python setup.py install + $ sudo bash extras/post-install.sh + $ MUTALYZER_ENV=test nosetests + +To setup a development environment: + + $ sudo python setup.py develop + $ sudo bash extras/post-install.sh + $ MUTALYZER_ENV=test nosetests + + This program depends on the following packages: - mysql-server >= 5.0.0 - python >= 2.5.2 diff --git a/bin/mutalyzer-batchd b/bin/mutalyzer-batchd index d02c323829b033d3a72844b80a16e18ce3f13699..993c96d420111b832a2d0c6fcc0f86cdc26c1174 100755 --- a/bin/mutalyzer-batchd +++ b/bin/mutalyzer-batchd @@ -9,8 +9,10 @@ should be run with the mutalyzer directory as working directory. @todo: Check if PID dir is writable. @todo: Get rid of ugly exception logging. @todo: Reload configuration without restarting (for example, on SIGHUP). +@todo: Use [2] to set process name (and use that in init script). [1] http://pypi.python.org/pypi/python-daemon/ +[2] http://code.google.com/p/py-setproctitle/ """ diff --git a/extras/init.d/mutalyzer-batchd b/extras/init.d/mutalyzer-batchd index c94763440847e1172d77c14247a0ea694dd85817..1da6a02a38458b0223f97bec9e6aa806a987d8d0 100644 --- a/extras/init.d/mutalyzer-batchd +++ b/extras/init.d/mutalyzer-batchd @@ -64,7 +64,8 @@ do_stop() # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE - [ "$?" = 2 ] && return 2 + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 # Many daemons don't delete their pidfiles when they exit. rm -f $PIDFILE return "$RETVAL" diff --git a/tests/test_wsgi.py b/tests/test_wsgi.py index 4b79b600558f3e1ea5c01206dce944d2a4f2a843..19ac1848d5d0a85a13ff3545931026c02d8b8723 100644 --- a/tests/test_wsgi.py +++ b/tests/test_wsgi.py @@ -33,6 +33,20 @@ class TestWSGI(): """ self.app = TestApp(application) + def test_root(self): + """ + Expect the index HTML page. + """ + r = self.app.get('') + assert_equal(r.status, '301 Moved Permanently') + assert r.location.endswith('/') + r = r.follow() + assert_equal(r.status, '200 OK') + # We check for <html> to make sure the menu template is included + r.mustcontain('<html>', + 'Welcome to the Mutalyzer web site', + '</html>') + def test_index(self): """ Expect the index HTML page. @@ -44,6 +58,25 @@ class TestWSGI(): 'Welcome to the Mutalyzer web site', '</html>') + def test_index_explicit(self): + """ + Expect the index HTML page. + """ + r = self.app.get('/index') + assert_equal(r.status, '200 OK') + # We check for <html> to make sure the menu template is included + r.mustcontain('<html>', + 'Welcome to the Mutalyzer web site', + '</html>') + + def test_about(self): + """ + See if my name is on the About page ;) + """ + r = self.app.get('/about') + assert_equal(r.status, '200 OK') + r.mustcontain('Martijn Vermaat') + def test_non_existing(self): """ Expect a 404 response. @@ -378,7 +411,6 @@ class TestWSGI(): """ Submit the batch syntax checker with a too big input file. """ - return # Todo: temporarily switched of batch tests. seed = """ Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi