[Zodb-checkins] SVN: zdaemon/trunk/tests/testzdrun.py The testUmask test fails when the process is run as root. When failing for

Derrick Hudson dman at dman13.dyndns.org
Fri Aug 5 11:01:44 EDT 2005


Log message for revision 37732:
  The testUmask test fails when the process is run as root.  When failing for
  this reason, the test now informs the user that they really shouldn't run the
  tests as root.
  

Changed:
  U   zdaemon/trunk/tests/testzdrun.py

-=-
Modified: zdaemon/trunk/tests/testzdrun.py
===================================================================
--- zdaemon/trunk/tests/testzdrun.py	2005-08-05 14:37:34 UTC (rev 37731)
+++ zdaemon/trunk/tests/testzdrun.py	2005-08-05 15:01:44 UTC (rev 37732)
@@ -245,6 +245,17 @@
         send_action('exit\n', zdrun_socket)
 
     def testUmask(self):
+        # people have a strange tendency to run the tests as root
+        if os.getuid() == 0 :
+            self.fail("""
+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.
+""" )
+
         path = tempfile.mktemp()
         # With umask 666, we should create a file that we aren't able
         # to write.  If access says no, assume that umask works.



More information about the Zodb-checkins mailing list