[P. Nagaraj]
[ZODB3-3.4.0]# python test.py
Running tests from build/lib.linux-i686-2.3
Running unit tests:

Error in test testUmask (zdaemon.tests.testzdrun.ZDaemonTests)
Traceback (most recent call last):
  File "build/lib.linux-i686-2.3/zdaemon/tests/testzdrun.py", line
75, in tearDown
    self.assertEqual(self.expect, output)
  File "/var/tmp/python2.3-2.3.5-root/usr/lib/python2.3/unittest.py",
line 302, in failUnlessEqual
    raise self.failureException, \
AssertionError: '' != '\n\nFailure in test testUmask
(zdaemon.tests.testzdrun.ZDaemonTests)\nTraceback (most recent call
last):\n  File "build/lib.linux-i686-2.3/zdaemon/tests/testzdrun.py", line
260, in testUmask\n    self.assert_(not os.access(path, os.W_OK))\n  File
"/var/tmp/python2.3-2.3.5-root/usr/lib/python2.3/unittest.py", line 278,
in failUnless\n    if not expr: raise self.failureException,

[Dieter Maurer]
I think you can ignore this failure in the "testUmask" test
of "zdaemon". Almost surely, you will not need this feature.

For me, the above looks like a broken test (at least I have
problems to decode the 'AssertionError').

The test asks zdaemon to run the `touch` command with umask 666.
Therefore nobody (except root) should have write access to the file
`touch` creates.  The failing

   self.assert_(not os.access(path, os.W_OK))

asserts that write access is in fact not allowed.

But note the "except root" in the above:  if someone is running as
root, there's no chance this can work.  More recent versions of
zdaemon start the test with this check:

       if os.getuid() == 0 :
I am root!
Do not run the tests as root.
Testing proper umask handling cannot be done as root.
Furthermore, it is not a good idea and strongly discouraged to run zope, the
build system (configure, make) or the tests as root.
In general do not run anything as root unless absolutely necessary.
""" )

Good advice :-)
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to