Opened 10 years ago

Last modified 9 years ago

#3787 defect new

test cases fail when run as root, and test cases fail when run against a system installation, in CentOS 5.2.

Reported by: ablmf Owned by:
Priority: high Milestone:
Component: core Keywords:
Cc: Jean-Paul Calderone, Thijs Triemstra Branch:
Author:

Description

I installed it as root.

wget http://tmrc.mit.edu/mirror/twisted/Twisted/8.2/Twisted-8.2.0.tar.bz2#md5=c85f151999df3ecf04c49a781b4438d2
tar xjvf Twisted-8.2.0.tar.bz2
cd Twisted-8.2.0
python steup.py install

Then I run

trial twisted

But some test cases fail

   1.
      ===============================================================================
   2.
      [FAIL]: twisted.conch.test.test_checkers.SSHPublicKeyDatabaseTests.test_checkKeyAsRoot
   3.
       
   4.
      Traceback (most recent call last):
   5.
        File "/usr/lib/python2.4/site-packages/twisted/conch/test/test_checkers.py", line 106, in test_checkKeyAsRoot
   6.
          self.assertEquals(self.mockos.seteuidCalls, [0, 1, 0, os.getuid()])
   7.
      twisted.trial.unittest.FailTest: not equal:
   8.
      a = []
   9.
      b = [0, 1, 0, 0]
  10.
       
  11.
      ===============================================================================
  12.
      [FAIL]: twisted.conch.test.test_openssh_compat.OpenSSHFactoryTests.test_getPrivateKeysAsRoot
  13.
       
  14.
      Traceback (most recent call last):
  15.
        File "/usr/lib/python2.4/site-packages/twisted/conch/test/test_openssh_compat.py", line 100, in test_getPrivateKeysAsRoot
  16.
          self.assertEquals(self.mockos.seteuidCalls, [0, os.geteuid()])
  17.
      twisted.trial.unittest.FailTest: not equal:
  18.
      a = []
  19.
      b = [0, 0]
  20.
       
  21.
      ===============================================================================
  22.
      [FAIL]: twisted.test.test_plugin.DeveloperSetupTests.test_newPluginsOnReadOnlyPath
  23.
       
  24.
      Traceback (most recent call last):
  25.
        File "/usr/lib/python2.4/site-packages/twisted/test/test_plugin.py", line 541, in test_newPluginsOnReadOnlyPath
  26.
          self.assertEqual(len(self.flushLoggedErrors()), 1)
  27.
      twisted.trial.unittest.FailTest: not equal:
  28.
      a = 0
  29.
      b = 1
  30.
       
  31.
      ===============================================================================
  32.
      [FAIL]: twisted.test.test_plugin.PluginTestCase.test_deployedMode
  33.
       
  34.
      Traceback (most recent call last):
  35.
        File "/usr/lib/python2.4/site-packages/twisted/test/test_plugin.py", line 321, in test_deployedMode
  36.
          self.assertEquals(len(errors), 1)
  37.
      twisted.trial.unittest.FailTest: not equal:
  38.
      a = 0
  39.
      b = 1
  40.
       
  41.
      ===============================================================================
  42.
      [FAIL]: twisted.test.test_udp.OldConnectedUDPTestCase.testDNSFailure
  43.
       
  44.
      Traceback (most recent call last):
  45.
        File "/usr/lib/python2.4/site-packages/twisted/trial/unittest.py", line 395, in _cb
  46.
          raise self.failureException(
  47.
      twisted.trial.unittest.FailTest: did not catch an error, instead got None
  48.
      ===============================================================================
  49.
      [FAIL]: twisted.web.test.test_webclient.WebClientSSLTestCase.testDownloadPageError3
  50.
       
  51.
      Traceback (most recent call last):
  52.
        File "/usr/lib/python2.4/site-packages/twisted/trial/unittest.py", line 395, in _cb
  53.
          raise self.failureException(
  54.
      twisted.trial.unittest.FailTest: did not catch an error, instead got None
  55.
      ===============================================================================
  56.
      [FAIL]: twisted.web.test.test_webclient.WebClientTestCase.testDownloadPageError3
  57.
       
  58.
      Traceback (most recent call last):
  59.
        File "/usr/lib/python2.4/site-packages/twisted/trial/unittest.py", line 395, in _cb
  60.
          raise self.failureException(
  61.
      twisted.trial.unittest.FailTest: did not catch an error, instead got None
  62.
      ===============================================================================
  63.
      [ERROR]: twisted.test.test_udp.OldConnectedUDPTestCase.testDNSFailure
  64.
       
  65.
      Traceback (most recent call last):
  66.
      Failure: twisted.trial.util.DirtyReactorAggregateError: Reactor was unclean.
  67.
      Selectables:
  68.
      <twisted.test.test_udp.Client on 32802>
  69.
      -------------------------------------------------------------------------------
  70.
      Ran 4615 tests in 177.931s
  71.
       
  72.
      FAILED (skips=200, expectedFailures=12, failures=7, errors=1, successes=4396)

Later I run it as a regular user, but got some different failures.

   1.
      ===============================================================================
   2.
      [FAIL]: twisted.test.test_udp.OldConnectedUDPTestCase.testDNSFailure
   3.
       
   4.
      Traceback (most recent call last):
   5.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/trial/unittest.py", line 395, in _cb
   6.
          raise self.failureException(
   7.
      twisted.trial.unittest.FailTest: did not catch an error, instead got None
   8.
      ===============================================================================
   9.
      [ERROR]: twisted.lore.test.test_lore.TestFactory.testProcessingFunctionFactory
  10.
       
  11.
      Traceback (most recent call last):
  12.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/test/test_lore.py", line 105, in testProcessingFunctionFactory
  13.
          htmlGenerator(self.file, self.linkrel)
  14.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/default.py", line 29, in <lambda>
  15.
          options['baseurl'], templ, options, filenameGenerator)
  16.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/tree.py", line 901, in doFile
  17.
          f = open(newFilename, 'wb')
  18.
      exceptions.IOError: [Errno 13] Permission denied: '/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/test/simple.xhtml'
  19.
      ===============================================================================
  20.
      [ERROR]: twisted.lore.test.test_lore.TestFactory.testProcessingFunctionFactoryWithFilenameGenerator
  21.
       
  22.
      Traceback (most recent call last):
  23.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/test/test_lore.py", line 110, in testProcessingFunctionFactoryWithFilenameGenerator
  24.
          htmlGenerator(self.file, self.linkrel)
  25.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/default.py", line 29, in <lambda>
  26.
          options['baseurl'], templ, options, filenameGenerator)
  27.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/tree.py", line 901, in doFile
  28.
          f = open(newFilename, 'wb')
  29.
      exceptions.IOError: [Errno 13] Permission denied: '/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/test/simple2.xhtml'
  30.
      ===============================================================================
  31.
      [ERROR]: twisted.lore.test.test_lore.TestFactory.test_doFile
  32.
       
  33.
      Traceback (most recent call last):
  34.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/test/test_lore.py", line 116, in test_doFile
  35.
          tree.doFile(self.file, self.linkrel, d['ext'], d['baseurl'], templ, d)
  36.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/tree.py", line 901, in doFile
  37.
          f = open(newFilename, 'wb')
  38.
      exceptions.IOError: [Errno 13] Permission denied: '/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/test/simple.xhtml'
  39.
      ===============================================================================
  40.
      [ERROR]: twisted.lore.test.test_lore.TestFactory.test_doFile_withFilenameGenerator
  41.
       
  42.
      Traceback (most recent call last):
  43.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/test/test_lore.py", line 122, in test_doFile_withFilenameGenerator
  44.
          tree.doFile(self.file, self.linkrel, d['ext'], d['baseurl'], templ, d, filenameGenerator)
  45.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/tree.py", line 901, in doFile
  46.
          f = open(newFilename, 'wb')
  47.
      exceptions.IOError: [Errno 13] Permission denied: '/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/test/simple1.xhtml'
  48.
      ===============================================================================
  49.
      [ERROR]: twisted.lore.test.test_lore.TestFactory.test_getProcessor
  50.
       
  51.
      Traceback (most recent call last):
  52.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/test/test_lore.py", line 140, in test_getProcessor
  53.
          p(sp('simple3.html'), self.linkrel)
  54.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/default.py", line 29, in <lambda>
  55.
          options['baseurl'], templ, options, filenameGenerator)
  56.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/tree.py", line 901, in doFile
  57.
          f = open(newFilename, 'wb')
  58.
      exceptions.IOError: [Errno 13] Permission denied: '/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/test/simple3.xhtml'
  59.
      ===============================================================================
  60.
      [ERROR]: twisted.lore.test.test_lore.TestFactory.test_getProcessorWithFilenameGenerator
  61.
       
  62.
      Traceback (most recent call last):
  63.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/test/test_lore.py", line 149, in test_getProcessorWithFilenameGenerator
  64.
          p(sp('simple4.html'), self.linkrel)
  65.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/default.py", line 29, in <lambda>
  66.
          options['baseurl'], templ, options, filenameGenerator)
  67.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/tree.py", line 901, in doFile
  68.
          f = open(newFilename, 'wb')
  69.
      exceptions.IOError: [Errno 13] Permission denied: '/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/lore/test/simple4.xhtml'
  70.
      ===============================================================================
  71.
      [ERROR]: twisted.test.test_udp.OldConnectedUDPTestCase.testDNSFailure
  72.
       
  73.
      Traceback (most recent call last):
  74.
      Failure: twisted.trial.util.DirtyReactorAggregateError: Reactor was unclean.
  75.
      Selectables:
  76.
      <twisted.test.test_udp.Client on 32834>
  77.
      ===============================================================================
  78.
      [ERROR]: twisted.trial.test.test_loader.FileTest.test_directory
  79.
       
  80.
      Traceback (most recent call last):
  81.
        File "/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/trial/test/test_loader.py", line 138, in test_directory
  82.
          os.mkdir(path)
  83.
      exceptions.OSError: [Errno 13] Permission denied: '/usr/lib/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/trial/test/goodDirectory'
  84.
      -------------------------------------------------------------------------------
  85.
      Ran 4617 tests in 177.182s
  86.
       
  87.
      FAILED (skips=200, expectedFailures=12, failures=1, errors=8, successes=4397)

Change History (8)

comment:1 Changed 10 years ago by Jean-Paul Calderone

Cc: Jean-Paul Calderone added
Milestone: Twisted-8.2+1
Priority: normallowest

CentOS is not currently a supported platform. In order for a platform to be supported, we need to have a buildslave in order to run tests on it. It's also nice if we have shell access to such a machine so that we can actually debug failures. If a platform is not supported, you can still submit fixes for it (though it might take a while for them to be applied if no developer has access to the platform in question to verify them), but any future commit may introduce new failures or regress previous fixes (we prevent this from happening on supported platforms, which is why a buildslave is required).

If you can contribute a buildslave, it would be much appreciated, and we'll be able to make CentOS a supported platform.

Also, you should try Twisted trunk@HEAD. It may be that the failures are different now than they are in 8.2. Anything that has been fixed since 8.2 clearly does not still need to be fixed.

comment:2 Changed 10 years ago by Itamar Turner-Trauring

CentOS is fairly close to (supported) Fedora, so yes we need buildslave, but these issues are mostly unrelated.

A couple of these tests were almost certainly due to running as root; if they still fail like that on Twisted trunk, please open new ticket saying that, for only those test.

Also try running tests out of untarred tarball; some of the tests should pass (e.g. last one already has ticket, #3101).

Please update tickets with results of that. I suspect you'll be down to one failure at that point.

Thanks for the report!

comment:3 Changed 10 years ago by Glyph

Priority: lowestnormal

As far as I can tell, nothing in this ticket is specific to CentOS. (The differences between Fedora and CentOS have mostly to do with the presence of Redhat logos, and I don't think we have any Redhat logos in our packages.) I'm bumping the priority back up since I don't actually think it's a platform thing. There are two separate issues here, though:

  1. tests fail when running as root, and
  2. tests fail when running as a normal user against a system installation

so we may want to resolve this as invalid and open some new tickets for dealing with those separately.

comment:4 Changed 10 years ago by Glyph

Summary: Some test cases of twisted failed on CentOS 5.2test cases fail when run as root, and test cases fail when run against a system installation, in CentOS 5.2.

comment:5 Changed 10 years ago by Thijs Triemstra

Cc: Thijs Triemstra added

See #1593 for a failing twisted.test.test_udp.OldConnectedUDPTestCase.testDNSFailure report.

comment:6 Changed 9 years ago by Glyph

#4780 was a duplicate of this.

comment:7 Changed 9 years ago by Glyph

Priority: normalhigh
Type: enhancementdefect

We should really fix this in the next release if we can. We expect people to be able to run Twisted as root (to shed privileges, et. al.) and we always want people to run the tests to verify that their environment works, so we should set up a buildbot for running them as root.

comment:8 Changed 9 years ago by <automation>

Owner: Glyph deleted
Note: See TracTickets for help on using tickets.