summaryrefslogtreecommitdiffstats
path: root/test/functional/libgfapi-python-tests.py
diff options
context:
space:
mode:
authorMichael Hanselmann <public@hansmi.ch>2018-07-27 17:00:27 +0200
committerMichael Hanselmann <public@hansmi.ch>2018-07-27 19:53:14 +0200
commit4991e72186e64152ea32286a8e2e73ebf651f30f (patch)
treeebb0258eb9e67d10ec2e3d25fc80786b4de2c782 /test/functional/libgfapi-python-tests.py
parentd5e4a0362a08ca3c0e7a33ea8caafccb22b906b2 (diff)
Support mknod API
Gluster supports the mknod(2) API to create special files such as character and block devices. Add it to the "gfapi.Volume" class. Change-Id: Ie62245441997111b0cf6e44b2a14a1ad7b6d7d56 Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Diffstat (limited to 'test/functional/libgfapi-python-tests.py')
-rw-r--r--test/functional/libgfapi-python-tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/libgfapi-python-tests.py b/test/functional/libgfapi-python-tests.py
index be2801f..a699d8c 100644
--- a/test/functional/libgfapi-python-tests.py
+++ b/test/functional/libgfapi-python-tests.py
@@ -815,6 +815,13 @@ class FileOpsTest(unittest.TestCase):
self.assertEqual(src_stat.st_mode, dest_stat.st_mode)
self.assertEqual(src_stat.st_mtime, dest_stat.st_mtime)
+ def test_mknod(self):
+ self.vol.mknod("dev", stat.S_IFCHR | 0o644, os.makedev(1, 3))
+ st = self.vol.stat("dev")
+ self.assertTrue(stat.S_ISCHR(st.st_mode))
+ self.assertEqual(os.major(st.st_rdev), 1)
+ self.assertEqual(os.minor(st.st_rdev), 3)
+
class DirOpsTest(unittest.TestCase):