]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/test_rados: test aio_setxattr()
authorzhangjiao <zhangjiao_yewu@cmss.chinamobile.com>
Mon, 12 Oct 2020 06:14:58 +0000 (14:14 +0800)
committerzhangjiao <zhangjiao_yewu@cmss.chinamobile.com>
Fri, 6 Nov 2020 09:02:48 +0000 (17:02 +0800)
Signed-off-by: Zhang Jiao <zhangjiao_yewu@cmss.chinamobile.com>
src/test/pybind/test_rados.py

index 55754161095750b981b28162f537257a61c8afe4..0f637281631d32c7fc2a58012f94d2eee8b11c55 100644 (file)
@@ -970,6 +970,22 @@ class TestIoctx(object):
 
         [i.remove() for i in self.ioctx.list_objects()]
 
+    def test_aio_setxattr(self):
+        lock = threading.Condition()
+        count = [0]
+        def cb(blah):
+            with lock:
+                count[0] += 1
+                lock.notify()
+            return 0
+        comp = self.ioctx.aio_setxattr("obj", "key", b'value', cb)
+        comp.wait_for_complete()
+        with lock:
+            while count[0] < 1:
+                lock.wait()
+        eq(comp.get_return_value(), 0)
+        eq(self.ioctx.get_xattr("obj", "key"), b'value')
+
     def test_applications(self):
         cmd = {"prefix":"osd dump", "format":"json"}
         ret, buf, errs = self.rados.mon_command(json.dumps(cmd), b'')