classification
Title: fix test_httpservers failures when run as root
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: neologix, petri.lehtinen, pitrou, python-dev, vstinner
Priority: normal Keywords: needs review, patch

Created on 2011-11-01 08:55 by neologix, last changed 2011-11-03 08:37 by petri.lehtinen. This issue is now closed.

Files
File name Uploaded Description Edit
test_httpserver_root.diff neologix, 2011-11-01 08:55 review
Messages (6)
msg146762 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2011-11-01 08:55
Here's a patch fixing test_httpservers failures when run as root (a couple buildbots are consistently failing on this, e.g. http://python.org/dev/buildbot/all/builders/x86 FreeBSD 7.2 3.x/builds/2282/steps/test/logs/stdio).
The test is failing for two reasons:
1) test_get does a chmod(0) on a directory, and checks that the server returns an error when requesting a file under this directory: unfortunately, filesystem permissions are ignored by root
2) CGI tests fail because they try to execute CGI scripts, created in a temporary directory: unfortunately, the temp directory is created as root with mkdtemp() (mode == 0700), and the http server changes to user "nobody" before running the scripts => EACCES
msg146763 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-11-01 09:00
You should change "issue #XXXX" with the real issue number now that there's an issue for this :)
msg146865 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-11-02 18:36
New changeset d1cde7081bf5 by Charles-François Natali in branch '2.7':
Issue #13308: Fix test_httpservers failures when run as root.
http://hg.python.org/cpython/rev/d1cde7081bf5

New changeset 4dc5590dbd0b by Charles-François Natali in branch '3.2':
Issue #13308: Fix test_httpservers failures when run as root.
http://hg.python.org/cpython/rev/4dc5590dbd0b

New changeset f2d3927a1165 by Charles-François Natali in branch 'default':
Issue #13308: Fix test_httpservers failures when run as root.
http://hg.python.org/cpython/rev/f2d3927a1165
msg146898 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2011-11-03 07:53
> You should change "issue #XXXX" with the real issue number now that 
> there's an issue for this :)

Done :-)
msg146903 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-11-03 08:36
I mean that this should be enough to close this issue:

-	-find $(srcdir) -name '__pycache__' -exec rmdir {} '+'
+	-find $(srcdir) -name '__pycache__' -exec rmdir {} ';'

That is, use ';' instead of the unportable '+' instead of changing all cleaning to use find ... | xargs ...
msg146904 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-11-03 08:37
Whoops, posted the previous message to a totally wrong issue. Who was it thag introduced tabbed browsing?
History
Date User Action Args
2011-11-03 08:37:38petri.lehtinensetmessages: + msg146904
2011-11-03 08:36:23petri.lehtinensetmessages: + msg146903
2011-11-03 07:53:23neologixsetstatus: open -> closed
resolution: fixed
messages: + msg146898

stage: patch review -> resolved
2011-11-02 18:36:44python-devsetnosy: + python-dev
messages: + msg146865
2011-11-01 09:00:02petri.lehtinensetnosy: + petri.lehtinen
messages: + msg146763
2011-11-01 08:55:53neologixcreate