From 4991e72186e64152ea32286a8e2e73ebf651f30f Mon Sep 17 00:00:00 2001 From: Michael Hanselmann Date: Fri, 27 Jul 2018 17:00:27 +0200 Subject: 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 --- test/functional/libgfapi-python-tests.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/functional') 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): -- cgit