Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 162246

Summary: dev-python/twisted-2.0.1 fails on test
Product: Gentoo Linux Reporter: Bart Van Loon <bart>
Component: [OLD] DevelopmentAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED TEST-REQUEST    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Bart Van Loon 2007-01-15 18:30:25 UTC
when emerging dev-python/twisted-2.0.1 with the test feature set in portage, it fails, saying the message below. I tried it with /dev/tty set to root:root crw-r----- and crw-rw----. before, it was set to loes:tty crw-r-----, which also caused it to fail. loes is just a random user on the system.

[FAIL]: testOpeningTTY (twisted.test.test_process.PosixProcessTestCasePTY)


  File "/var/tmp/portage/twisted-2.0.1/temp/tests/usr/lib/python2.4/site-packages/twisted/internet/defer.py", line 117, in maybeDeferred
    result = f(*args, **kw)
  File "/var/tmp/portage/twisted-2.0.1/temp/tests/usr/lib/python2.4/site-packages/twisted/test/test_process.py", line 552, in testOpeningTTY
    self.assertEquals(p.outF.getvalue(), "hello world!\r\nhello world!\r\n", "Error message from process_tty follows:\n\n%s\n\n" % p.outF.getvalue())
  File "/var/tmp/portage/twisted-2.0.1/temp/tests/usr/lib/python2.4/site-packages/twisted/trial/unittest.py", line 415, in <lambda>
    failUnlessEqual = lambda self, a, b, msg=None: failUnlessEqual(a, b, msg)
  File "/var/tmp/portage/twisted-2.0.1/temp/tests/usr/lib/python2.4/site-packages/twisted/trial/assertions.py", line 77, in failUnlessEqual
    raise FailTest, (msg or '%r != %r' % (first, second))
twisted.trial.assertions.FailTest: Error message from process_tty follows:

hello world!
Traceback (most recent call last):
  File "/var/tmp/portage/twisted-2.0.1/temp/tests/usr/lib/python2.4/site-packages/twisted/test/process_tty.py", line 3, in ?
    f = open("/dev/tty", "r+")
IOError: [Errno 13] Permission denied: '/dev/tty'



-------------------------------------------------------------------------------
Ran 851 tests in 132.209s

FAILED (skips=33, expectedFailures=7, failures=1, successes=810)

Reproducible: Always

Steps to Reproduce:
1. emerge --sync
2. emerge twisted

Actual Results:  
merge fails

Expected Results:  
merge succeeds

running gentoo hardened on x86 platform. test feature set in portage.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-01-15 18:34:44 UTC
Reopen if you can reproduce this w/ >=2.4.0
Comment 2 Bart Van Loon 2007-01-15 18:35:18 UTC
when invoking python myself as root, this works fine:

>>> f = open("/dev/tty", "r+")
>>> f
<open file '/dev/tty', mode 'r+' at 0xb7c48380>

also, portage drops root privileges during the compilation, so porbably also during the testing (userpriv feature). the portage user doesn't belong to the tty group, that may be why it fails...
Comment 3 Bart Van Loon 2007-01-15 18:40:31 UTC
2.4.0 still seems so far away (Available versions:  1.2.0 ~1.3.0 2.0.1 ~2.1.0 ~2.2.0 ~2.4.0 ~2.5.0)

but when chmodding /dev/ty to a+rw, the test passes and twisted merges just fine. I think the testcase should be skipped whe /dev/tty can't be opened, instead of fail. other tests, like the database connector tests, are marked skipped as wll when the database can't be connected to.