Message134798
OK, so those test_argparse.py and test_import.py tests succeed if run
as a non-root user , because as the super-user one is allowed to
override mode 0300 ( lack of 'w' bit for owner ) on a directory ,
so some tests that check if they are unable to create files when
directory 'w' permissions would not allow this for a non-root
user fail .
I think if users are not meant to be running the test scripts as root,
then the first thing the test suite should do is :
if os.getuid() == 0 :
print( "The test suite will fail if run as the super-user." )
sys.exit(1) # or is it os.exit ? I forget ...
But if, as I hope, you will allow the root user to run the test suite,
then please skip tests that test if a non-root user shouldn't be
allowed to do something as I did for the patch attached to issue #11956 :
@unittest.skipUnless( (os.name == 'posix') and not ( os.getuid() == 0 ),
"test meaningful only on posix systems as non-root user")
def test_unwritable_directory(self):
... |
|
Date |
User |
Action |
Args |
2011-04-29 17:54:59 | Jason.Vas.Dias | set | recipients:
+ Jason.Vas.Dias, r.david.murray |
2011-04-29 17:54:59 | Jason.Vas.Dias | set | messageid: <1304099699.79.0.647334956227.issue11954@psf.upfronthosting.co.za> |
2011-04-29 17:54:59 | Jason.Vas.Dias | link | issue11954 messages |
2011-04-29 17:54:59 | Jason.Vas.Dias | create | |
|