[Zodb-checkins] CVS: ZODB3/zdaemon/tests - testzdrun.py:1.10
Jeremy Hylton
jeremy at zope.com
Wed Jan 14 10:28:08 EST 2004
Update of /cvs-repository/ZODB3/zdaemon/tests
In directory cvs.zope.org:/tmp/cvs-serv26520/zdaemon/tests
Modified Files:
testzdrun.py
Log Message:
Add -m/--umask option to zdaemon.
Patch from John Belmonte.
Bug fix candidate? It appears ZODB 3.2 would have the same problem,
preventing some user from connecting to a ZEO server. It's a new
feature, but a necessary one.
=== ZODB3/zdaemon/tests/testzdrun.py 1.9 => 1.10 ===
--- ZODB3/zdaemon/tests/testzdrun.py:1.9 Fri Jan 2 18:11:16 2004
+++ ZODB3/zdaemon/tests/testzdrun.py Wed Jan 14 10:28:07 2004
@@ -1,6 +1,7 @@
"""Test suite for zdrun.py."""
import os
+import stat
import sys
import time
import signal
@@ -227,6 +228,21 @@
self.assert_(len(params) > 1, repr(response))
# kill the process
send_action('exit\n', zdrun_socket)
+
+ def testUmask(self):
+ 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.
+ try:
+ self.rundaemon(["-m", "666", "/bin/touch", path])
+ for i in range(5):
+ if not os.path.exists(path):
+ time.sleep(0.1)
+ self.assert_(os.path.exists(path))
+ self.assert_(not os.access(path, os.W_OK))
+ finally:
+ if os.path.exists(path):
+ os.remove(path)
def send_action(action, sockname):
"""Send an action to the zdrun server and return the response.
More information about the Zodb-checkins
mailing list