]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Install more python versions in the linux VM so we can test epoll.c too.
authorBen Darnell <ben@bendarnell.com>
Fri, 30 Dec 2011 08:49:19 +0000 (00:49 -0800)
committerBen Darnell <ben@bendarnell.com>
Fri, 30 Dec 2011 08:49:19 +0000 (00:49 -0800)
Also fix a bug in the test for python 2.5 on systems where ipv6 is not
configured (socket.gaierror didn't have an `errno` attribute until 2.6)

maint/vm/shared-setup.sh
maint/vm/ubuntu10.04/setup.sh
maint/vm/ubuntu10.04/tox.ini
tornado/test/simple_httpclient_test.py

index 32ef120d6a12c9bd4ded1771e2cc0d9fc5ddfe69..4493ad1f76888f29760e3dc665ab3307307245d6 100755 (executable)
@@ -1,6 +1,8 @@
 #!/bin/sh
 # Run at the end of each vm's provisioning script
 
+set -e
+
 # Link tox.ini into the home directory so you can run tox immediately
 # after ssh'ing in without cd'ing to /vagrant (since cd'ing to /tornado
 # gets the wrong config)
index f2381d76aa8bcb9f104f7f7d2d8ee92e6e530119..d5db904f19144de169b23a3d43184e53709ba15d 100644 (file)
@@ -1,25 +1,50 @@
 #!/bin/sh
 
+set -e
+
+apt-get update
+
 # libcurl4-gnutls-dev is the default if you ask for libcurl4-dev, but it
 # has bugs that make our tests deadlock (the relevant tests detect this and
 # disable themselves, but it means that to get full coverage we have to use
-# the openssl version)
+# the openssl version).
+# The oddly-named python-software-properties includes add-apt-repository.
 APT_PACKAGES="
 python-pip
-python-virtualenv
 python-dev
 libmysqlclient-dev
 libcurl4-openssl-dev
+python-software-properties
+"
+
+apt-get -y install $APT_PACKAGES
+
+
+# Ubuntu 10.04 has python 2.6 as default; install more from here.
+# The most important thing is to have both 2.5 and a later version so we
+# test with both tornado.epoll and 2.6+ stdlib's select.epoll.
+add-apt-repository ppa:fkrull/deadsnakes
+apt-get update
+
+DEADSNAKES_PACKAGES="
+python2.5
+python2.5-dev
+python2.7
+python2.7-dev
+python3.2
+python3.2-dev
 "
+apt-get -y install $DEADSNAKES_PACKAGES
+
 
 PIP_PACKAGES="
+virtualenv
 tox
 MySQL-python
 pycurl
 twisted
 "
 
-apt-get -y install $APT_PACKAGES
 pip install $PIP_PACKAGES
 
 /tornado/maint/vm/shared-setup.sh
index a797f253ffa91d384a013b2b217ec803a50c3f7f..87841ac8811dd64606b098cc67890b5df24881a6 100644 (file)
@@ -1,13 +1,32 @@
 [tox]
-envlist=py26-full, py26
+envlist = py27-full, py25-full, py32, py25, py26, py26-full, py27
 setupdir=/tornado
 toxworkdir=/home/vagrant/tox-tornado
 
 [testenv]
 commands = python -m tornado.test.runtests {posargs:}
 
+[testenv:py25]
+basepython = python2.5
+deps = simplejson
+
+[testenv:py25-full]
+basepython = python2.5
+deps =
+     MySQL-python
+     pycurl
+     simplejson
+     twisted==11.0.0
+
 [testenv:py26-full]
 deps =
      MySQL-python
      pycurl
-     twisted
+     twisted==11.0.0
+
+[testenv:py27-full]
+basepython = python2.7
+deps =
+     MySQL-python
+     pycurl
+     twisted==11.0.0
index b8c8b3fe163effbc9ad4da3124f70268be98a957..7b7eb19e72f441e991e4259a00c78d5fd00e2273 100644 (file)
@@ -159,7 +159,7 @@ class SimpleHTTPClientTestCase(AsyncHTTPTestCase, LogTrapTestCase):
         try:
             self.http_server.listen(self.get_http_port(), address='::1')
         except socket.gaierror, e:
-            if e.errno == socket.EAI_ADDRFAMILY:
+            if e.args[0] == socket.EAI_ADDRFAMILY:
                 # python supports ipv6, but it's not configured on the network
                 # interface, so skip this test.
                 return