]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/cephfs: reproducer for #15303 client bug
authorJohn Spray <john.spray@redhat.com>
Tue, 29 Mar 2016 11:10:34 +0000 (12:10 +0100)
committerJohn Spray <john.spray@redhat.com>
Tue, 29 Mar 2016 11:13:15 +0000 (12:13 +0100)
Run through two-client scenario where the first client
thinks a dir is empty even though the second client
has written some files to it.

Signed-off-by: John Spray <john.spray@redhat.com>
tasks/cephfs/test_volume_client.py

index e537488bd556e016a0f400bff02b3c957eee0ddf..bee9234cb725e3c61b496036eef6a26cb4a24ce3 100644 (file)
@@ -273,3 +273,26 @@ vc.disconnect()
         #  it at some point as/when the logic gets fancier)
         created_pg_num = self.fs.mon_manager.get_pool_property(list(new_pools)[0], "pg_num")
         self.assertEqual(expected_pg_num, created_pg_num)
+
+    def test_15303(self):
+        """
+        Reproducer for #15303 "Client holds incorrect complete flag on dir
+        after losing caps" (http://tracker.ceph.com/issues/15303)
+        """
+        for m in self.mounts:
+            m.umount_wait()
+
+        # Create a dir on mount A
+        self.mount_a.mount()
+        self.mount_a.run_shell(["mkdir", "parent1"])
+        self.mount_a.run_shell(["mkdir", "parent2"])
+        self.mount_a.run_shell(["mkdir", "parent1/mydir"])
+
+        # Put some files in it from mount B
+        self.mount_b.mount()
+        self.mount_b.run_shell(["touch", "parent1/mydir/afile"])
+        self.mount_b.umount_wait()
+
+        # List the dir's contents on mount A
+        self.assertListEqual(self.mount_a.ls("parent1/mydir"),
+                             ["afile"])