summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorThiago da Silva <thiago@redhat.com>2015-02-19 17:00:11 -0500
committerThiago da Silva <thiago@redhat.com>2015-02-19 17:00:11 -0500
commitfc318e921b073cdbe9fbe62b8c893634b057f0e8 (patch)
tree62623b3d198d2393089846b0e3c0daed42cbe94a /test/functional
parentec407b4d61b15506e6ae5b3f28d3983af4f28457 (diff)
adding chmod and fchmod
Change-Id: Iba5f4e72a257adeb8ec78b267dfdef26a1ec66f1 Signed-off-by: Thiago da Silva <thiago@redhat.com>
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/libgfapi-python-tests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/libgfapi-python-tests.py b/test/functional/libgfapi-python-tests.py
index 8bcbf45..4dbdf2d 100644
--- a/test/functional/libgfapi-python-tests.py
+++ b/test/functional/libgfapi-python-tests.py
@@ -163,6 +163,16 @@ class FileOpsTest(unittest.TestCase):
except OSError as e:
self.fail(e.message)
+ def test_chmod(self):
+ stat = self.vol.stat(self.path)
+ orig_mode = oct(stat.st_mode & 0777)
+ self.assertEqual(orig_mode, '0644L')
+ ret = self.vol.chmod(self.path, 0600)
+ self.assertEqual(ret, 0)
+ stat = self.vol.stat(self.path)
+ new_mode = oct(stat.st_mode & 0777)
+ self.assertEqual(new_mode, '0600L')
+
def test_exists(self):
e = self.vol.exists(self.path)
self.assertTrue(e)