This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: set up and use VM for net access in the test suite
Type: enhancement Stage:
Components: Tests Versions:
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, ammar2, benjamin.peterson, berker.peksag, christian.heimes, dstufft, ezio.melotti, georg.brandl, pitrou, python-dev, r.david.murray
Priority: normal Keywords:

Created on 2014-10-15 22:27 by georg.brandl, last changed 2022-04-11 14:58 by admin.

Messages (14)
msg229505 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2014-10-15 22:27
Our test suite currently contacts a range of hosts for different "online" tests, including hosts.  This has led to sudden breakages in the past, e.g. when changed URLs or switched to https by default.

It would probably a good idea to consolidate as much as possible into accessing a new VM called something like "", where the necessary services can be kept running regardless of the necessities of actual services.

First step to do this is to compile a list of tests that could use the VM, and a list of services that need to be running.
msg229978 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-10-25 02:56
There are two disabled tests in Lib/test/

* OtherNetworkTests.test_cnri:

    # XXX Following test depends on machine configurations that are internal
    # to CNRI.  Need to set up a public server with the right authentication
    # configuration for test purposes.

* AuthTests.test_basic_auth:

    ## Disabled at the moment since there is no page under which
    ## could be used to HTTP authentication.
msg230024 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2014-10-26 08:57
OK, a hopefully complete overview of the network-using tests and the services
they use, checked by tracing connect() calls during a test run:

* test_codecencodings_*, test_normalization, test_ucn: some Unicode-related data files from

  Most of these files are not expected to change; they could be copied to our
  new host.  Some are dependent on the unidata version, new versions would have
  to be copied each time after updating the unicodedata database.

* test_httplib: checks HTTPS with

  This would require a basic HTTPS setup on the host.

* test_imaplib: checks IMAP protocol with

  Requires an IMAP server on the host that allows unencrypted and encrypted
  connections (both with STARTTLS and with IMAPS port) and speaks very basic
  IMAP (login then quit).

* test_nntplib: checks NNTP protocol with

  Requires an NNTP server on the host that allows unencrypted and encrypted
  connections (both with STARTTLS and on the NNTPS port) and has at least one
  group with some messages.

* test_smtpnet: checks SMTP protocol encryption with

  Requires an SMTP server that allows encrypted connections (both with STARTTLS
  and on the SMTPS port) and speaks very basic SMTP (just EHLO and then QUIT).

* test_ssl: checks encrypted connections to

  The is probably a basic HTTPS setup.  The second host is
  apparently used for especially checking SHA256.

* test_socket: makes some connection to

  while resolving the IDNA name испытание (which is an alias).

* test_timeout: checks TCP timeout with

  The first two are testing timeout with a connection that silently drops
  packets.  It is set up using some packet filtering rules for the two ports.

* test_urllibnet and test_urllib2net: various checks of HTTP, FTP protocols on

  Most of them are probably fine with a basic readonly FTP server that servers a
  few files and a basic HTTP server.  Some check special cases with broken
  servers (like that might be a little harder to reproduce.

  The two disabled tests mentioned by Berker need HTTP Basic Auth enabled
  on some URL.

* test_xmlrpc_net: checks XML-RPC protocol with

  With the current test, serving a static XML page at a certain URL is
  sufficient: it makes only one request.  Another possibility is setting up a
  small XML-RPC server on a dedicated port.
msg230513 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2014-11-02 18:14
Note we now have set up.
msg230532 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2014-11-03 10:21
Nice! How do you plan to organize its setup?
msg230535 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-11-03 13:34
Why a separate domain rather than a subdomain?  I'm not objecting, but I am curious.
msg230538 - (view) Author: Donald Stufft (dstufft) * (Python committer) Date: 2014-11-03 14:58
It is configured using salt, see

A separate domain just makes it easier to do whatever we need with it without needing to worry about getting confused between live sites and test sites.
msg230569 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-11-03 23:59
Not to mention possible cookie tests, I suppose.
(I would personally have preferred something like "", but I guess is ok too :-))
msg230704 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2014-11-05 18:50
I created a repository, which is cloned on the server.
msg230714 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2014-11-05 21:18
4985375db40f takes care of test_httplib.
msg230739 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-11-06 13:38
New changeset 39536b377241 by Georg Brandl in branch '3.4':
#22650: test suite: load Unicode test data files from
msg230743 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-11-06 13:57
New changeset 0af36ea1d010 by Georg Brandl in branch '2.7':
#22650: test suite: load Unicode test data files from
msg298626 - (view) Author: Ammar Askar (ammar2) * (Python committer) Date: 2017-07-19 01:47
Opened up in order to address

This changes the ftp servers from to
msg301263 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2017-09-04 21:11
FYI, is no longer used in tests.
Date User Action Args
2022-04-11 14:58:09adminsetgithub: 66840
2017-09-04 21:11:37christian.heimessetnosy: + christian.heimes
messages: + msg301263
2017-07-19 01:47:00ammar2setnosy: + ammar2
messages: + msg298626
2014-11-06 13:57:05python-devsetmessages: + msg230743
2014-11-06 13:38:53python-devsetnosy: + python-dev
messages: + msg230739
2014-11-05 21:18:53georg.brandlsetmessages: + msg230714
2014-11-05 18:50:34benjamin.petersonsetmessages: + msg230704
2014-11-03 23:59:07pitrousetnosy: + pitrou
messages: + msg230569
2014-11-03 14:58:49dstufftsetmessages: + msg230538
2014-11-03 13:34:53r.david.murraysetmessages: + msg230535
2014-11-03 10:21:35georg.brandlsetmessages: + msg230532
2014-11-02 18:14:32benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg230513
2014-10-26 08:57:03georg.brandlsetmessages: + msg230024
2014-10-25 02:56:22berker.peksagsetmessages: + msg229978
2014-10-16 12:21:51Arfreversetnosy: + Arfrever
2014-10-16 10:37:39berker.peksagsetnosy: + berker.peksag
2014-10-16 03:12:07r.david.murraysetnosy: + r.david.murray
2014-10-15 22:27:08georg.brandlcreate