]> git.proxmox.com Git - ceph.git/blame - ceph/qa/tasks/cephfs/test_readahead.py
import 15.2.4
[ceph.git] / ceph / qa / tasks / cephfs / test_readahead.py
CommitLineData
7c673cae
FG
1import logging
2from tasks.cephfs.fuse_mount import FuseMount
3from tasks.cephfs.cephfs_test_case import CephFSTestCase
4
5log = logging.getLogger(__name__)
6
7
8class TestReadahead(CephFSTestCase):
9 def test_flush(self):
10 if not isinstance(self.mount_a, FuseMount):
11 self.skipTest("FUSE needed for measuring op counts")
12
13 # Create 32MB file
14 self.mount_a.run_shell(["dd", "if=/dev/urandom", "of=foo", "bs=1M", "count=32"])
15
16 # Unmount and remount the client to flush cache
17 self.mount_a.umount_wait()
e306af50 18 self.mount_a.mount_wait()
7c673cae
FG
19
20 initial_op_r = self.mount_a.admin_socket(['perf', 'dump', 'objecter'])['objecter']['op_r']
21 self.mount_a.run_shell(["dd", "if=foo", "of=/dev/null", "bs=128k", "count=32"])
22 op_r = self.mount_a.admin_socket(['perf', 'dump', 'objecter'])['objecter']['op_r']
23 assert op_r >= initial_op_r
24 op_r -= initial_op_r
25 log.info("read operations: {0}".format(op_r))
26
27 # with exponentially increasing readahead, we should see fewer than 10 operations
28 # but this test simply checks if the client is doing a remote read for each local read
29 if op_r >= 32:
30 raise RuntimeError("readahead not working")