Skip to content
This repository
Browse code

Install more python versions in the linux VM so we can test epoll.c too.

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)
  • Loading branch information...
commit 877aa9d86167ad0f7df9d7a32d6918fd6792bb2f 1 parent f27b49a
Ben Darnell authored December 30, 2011
2  maint/vm/shared-setup.sh
... ...
@@ -1,6 +1,8 @@
1 1
 #!/bin/sh
2 2
 # Run at the end of each vm's provisioning script
3 3
 
  4
+set -e
  5
+
4 6
 # Link tox.ini into the home directory so you can run tox immediately
5 7
 # after ssh'ing in without cd'ing to /vagrant (since cd'ing to /tornado
6 8
 # gets the wrong config)
31  maint/vm/ubuntu10.04/setup.sh
... ...
@@ -1,25 +1,50 @@
1 1
 #!/bin/sh
2 2
 
  3
+set -e
  4
+
  5
+apt-get update
  6
+
3 7
 # libcurl4-gnutls-dev is the default if you ask for libcurl4-dev, but it
4 8
 # has bugs that make our tests deadlock (the relevant tests detect this and
5 9
 # disable themselves, but it means that to get full coverage we have to use
6  
-# the openssl version)
  10
+# the openssl version).
  11
+# The oddly-named python-software-properties includes add-apt-repository.
7 12
 APT_PACKAGES="
8 13
 python-pip
9  
-python-virtualenv
10 14
 python-dev
11 15
 libmysqlclient-dev
12 16
 libcurl4-openssl-dev
  17
+python-software-properties
  18
+"
  19
+
  20
+apt-get -y install $APT_PACKAGES
  21
+
  22
+
  23
+# Ubuntu 10.04 has python 2.6 as default; install more from here.
  24
+# The most important thing is to have both 2.5 and a later version so we
  25
+# test with both tornado.epoll and 2.6+ stdlib's select.epoll.
  26
+add-apt-repository ppa:fkrull/deadsnakes
  27
+apt-get update
  28
+
  29
+DEADSNAKES_PACKAGES="
  30
+python2.5
  31
+python2.5-dev
  32
+python2.7
  33
+python2.7-dev
  34
+python3.2
  35
+python3.2-dev
13 36
 "
  37
+apt-get -y install $DEADSNAKES_PACKAGES
  38
+
14 39
 
15 40
 PIP_PACKAGES="
  41
+virtualenv
16 42
 tox
17 43
 MySQL-python
18 44
 pycurl
19 45
 twisted
20 46
 "
21 47
 
22  
-apt-get -y install $APT_PACKAGES
23 48
 pip install $PIP_PACKAGES
24 49
 
25 50
 /tornado/maint/vm/shared-setup.sh
23  maint/vm/ubuntu10.04/tox.ini
... ...
@@ -1,13 +1,32 @@
1 1
 [tox]
2  
-envlist=py26-full, py26
  2
+envlist = py27-full, py25-full, py32, py25, py26, py26-full, py27
3 3
 setupdir=/tornado
4 4
 toxworkdir=/home/vagrant/tox-tornado
5 5
 
6 6
 [testenv]
7 7
 commands = python -m tornado.test.runtests {posargs:}
8 8
 
  9
+[testenv:py25]
  10
+basepython = python2.5
  11
+deps = simplejson
  12
+
  13
+[testenv:py25-full]
  14
+basepython = python2.5
  15
+deps =
  16
+     MySQL-python
  17
+     pycurl
  18
+     simplejson
  19
+     twisted==11.0.0
  20
+
9 21
 [testenv:py26-full]
10 22
 deps =
11 23
      MySQL-python
12 24
      pycurl
13  
-     twisted
  25
+     twisted==11.0.0
  26
+
  27
+[testenv:py27-full]
  28
+basepython = python2.7
  29
+deps =
  30
+     MySQL-python
  31
+     pycurl
  32
+     twisted==11.0.0
2  tornado/test/simple_httpclient_test.py
@@ -159,7 +159,7 @@ def test_ipv6(self):
159 159
         try:
160 160
             self.http_server.listen(self.get_http_port(), address='::1')
161 161
         except socket.gaierror, e:
162  
-            if e.errno == socket.EAI_ADDRFAMILY:
  162
+            if e.args[0] == socket.EAI_ADDRFAMILY:
163 163
                 # python supports ipv6, but it's not configured on the network
164 164
                 # interface, so skip this test.
165 165
                 return

0 notes on commit 877aa9d

Please sign in to comment.
Something went wrong with that request. Please try again.