> Oh, one more interesting tidbit:
>
> This failure only happens when I run "make test" as root.
>
> In other words:
>
> pfexec bash
> make test
>
> It seems to work fine if I run it as my own user.
>
> Does that mean anything?
Yes. Directory permission checks aren't enforced for root, so this test
case will fail when run as root.
I've written a pejorative case for when we are running as root. It
doesn't test for the exception, but it does assert that we've set our
errorlevel high enough to get exceptions, should they occur.
Here's the diff for that:
diff -r ca9993d3aaea src/tests/api/t_pkgtarfile.py
--- a/src/tests/api/t_pkgtarfile.py Tue Mar 04 18:00:58 2008 -0800
+++ b/src/tests/api/t_pkgtarfile.py Fri Mar 07 12:27:23 2008 -0800
@@ -62,11 +62,17 @@ class TestPkgTarFile(unittest.TestCase):
def testerrorlevelIsCorrect(self):
p = pkgtarfile.PkgTarFile(self.tarfile, 'r')
+
+ if os.getuid() == 0:
+ self.assert_(p.errorlevel == 2)
+ p.close()
+ return
+
extractpath = os.path.join(self.tpath, "foo/bar")
os.makedirs(extractpath)
os.chmod(extractpath, 0555)
self.assertRaises(IOError, p.extract, "foo/bar/baz",
- extractpath)
+ self.tpath)
p.close()
os.chmod(extractpath, 777)
-j
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss