ganeti.backend_unittest: chmod restricted cmd dir
authorApollon Oikonomopoulos <apoikos@gmail.com>
Wed, 31 Jul 2013 14:30:29 +0000 (17:30 +0300)
committerGuido Trotter <ultrotter@google.com>
Wed, 31 Jul 2013 14:38:18 +0000 (16:38 +0200)
TestVerifyRestrictedCmdDirectory.testNormal implicitly relies on the current
umask to check the behaviour of backend._VerifyRestrictedCmdDirectory. However,
when run under a more relaxed umask (as in the case of the Debian buildd's
using sbuild and - apparently - umask 0002), it fails.

Since this kind of failure is already tested for previously and since we should
check that a "known-normal" directory passes the test, we explicitly chmod()
the temporary directory to 0755.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

test/py/ganeti.backend_unittest.py

index a84fbff..da5b500 100755 (executable)
@@ -167,6 +167,7 @@ class TestVerifyRestrictedCmdDirectory(unittest.TestCase):
   def testNormal(self):
     tmpname = utils.PathJoin(self.tmpdir, "foobar")
     os.mkdir(tmpname)
+    os.chmod(tmpname, 0755)
     self.assertTrue(os.path.isdir(tmpname))
     (status, msg) = \
       backend._VerifyRestrictedCmdDirectory(tmpname,