]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/cephfs: cover fancy layout in test_strays
authorYan, Zheng <zyan@redhat.com>
Fri, 11 Mar 2016 08:58:23 +0000 (16:58 +0800)
committerYan, Zheng <zyan@redhat.com>
Fri, 11 Mar 2016 12:15:56 +0000 (20:15 +0800)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
tasks/cephfs/mount.py
tasks/cephfs/test_strays.py

index f714238fffb93fbc4aed6eeb85abf2920a3b3784..cdfa873141720be017cd21058723b02eb43547d4 100644 (file)
@@ -288,7 +288,7 @@ class CephFSMount(object):
         assert(self.is_mounted())
 
         return self.run_shell(["dd", "if=/dev/urandom", "of={0}".format(filename),
-                               "bs=1M",
+                               "bs=1M", "conv=fdatasync",
                                "count={0}".format(n_mb),
                                "seek={0}".format(seek)
                                ], wait=wait)
index fd2e6b92f123c7381aeac5fe2c08c0fa6e3708b6..317870bba6121a91a14a7631f33aeef03cafb5ad 100644 (file)
@@ -614,3 +614,24 @@ class TestStrays(CephFSTestCase):
 
         self.assertTrue(self.fs.data_objects_absent(file_a_ino, size_mb * 1024 * 1024))
         self.await_data_pool_empty()
+
+    def test_fancy_layout(self):
+        """
+        purge stray file with fancy layout
+        """
+
+        file_name = "fancy_layout_file"
+        self.mount_a.run_shell(["touch", file_name])
+
+        file_layout = "stripe_unit=1048576 stripe_count=4 object_size=8388608"
+        self.mount_a.run_shell(["setfattr", "-n", "ceph.file.layout", "-v", file_layout, file_name])
+
+        # 35MB requires 7 objects
+        size_mb = 35
+        self.mount_a.write_n_mb(file_name, size_mb)
+
+        self.mount_a.run_shell(["rm", "-f", file_name])
+        self.fs.mds_asok(["flush", "journal"])
+
+        # can't use self.fs.data_objects_absent here, it does not support fancy layout
+        self.await_data_pool_empty()