2 from tasks.cephfs.fuse_mount import FuseMount
3 from tasks.cephfs.cephfs_test_case import CephFSTestCase
5 log = logging.getLogger(__name__)
8 class TestReadahead(CephFSTestCase):
10 if not isinstance(self.mount_a, FuseMount):
11 self.skipTest("FUSE needed for measuring op counts")
14 self.mount_a.run_shell(["dd", "if=/dev/urandom", "of=foo", "bs=1M", "count=32"])
16 # Unmount and remount the client to flush cache
17 self.mount_a.umount_wait()
19 self.mount_a.wait_until_mounted()
21 initial_op_r = self.mount_a.admin_socket(['perf', 'dump', 'objecter'])['objecter']['op_r']
22 self.mount_a.run_shell(["dd", "if=foo", "of=/dev/null", "bs=128k", "count=32"])
23 op_r = self.mount_a.admin_socket(['perf', 'dump', 'objecter'])['objecter']['op_r']
24 assert op_r >= initial_op_r
26 log.info("read operations: {0}".format(op_r))
28 # with exponentially increasing readahead, we should see fewer than 10 operations
29 # but this test simply checks if the client is doing a remote read for each local read
31 raise RuntimeError("readahead not working")