]>
git.proxmox.com Git - ceph.git/blob - ceph/qa/tasks/cephfs/test_config_commands.py
2 from unittest
import case
3 from tasks
.cephfs
.cephfs_test_case
import CephFSTestCase
4 from tasks
.cephfs
.fuse_mount
import FuseMount
7 class TestConfigCommands(CephFSTestCase
):
9 Test that daemons and clients respond to the otherwise rarely-used
10 runtime config modification operations.
16 def test_client_config(self
):
18 That I can successfully issue asok "config set" commands
23 if not isinstance(self
.mount_a
, FuseMount
):
24 raise case
.SkipTest("Test only applies to FUSE clients")
26 test_key
= "client_cache_size"
28 self
.mount_a
.admin_socket(['config', 'set', test_key
, test_val
])
29 out
= self
.mount_a
.admin_socket(['config', 'get', test_key
])
30 self
.assertEqual(out
[test_key
], test_val
)
32 self
.mount_a
.write_n_mb("file.bin", 1);
34 # Implicitly asserting that things don't have lockdep error in shutdown
35 self
.mount_a
.umount_wait(require_clean
=True)
38 def test_mds_config_asok(self
):
39 test_key
= "mds_max_purge_ops"
41 self
.fs
.mds_asok(['config', 'set', test_key
, test_val
])
42 out
= self
.fs
.mds_asok(['config', 'get', test_key
])
43 self
.assertEqual(out
[test_key
], test_val
)
45 # Implicitly asserting that things don't have lockdep error in shutdown
46 self
.mount_a
.umount_wait(require_clean
=True)
49 def test_mds_config_tell(self
):
50 test_key
= "mds_max_purge_ops"
53 mds_id
= self
.fs
.get_lone_mds_id()
54 self
.fs
.mon_manager
.raw_cluster_cmd("tell", "mds.{0}".format(mds_id
), "injectargs",
55 "--{0}={1}".format(test_key
, test_val
))
57 # Read it back with asok because there is no `tell` equivalent
58 out
= self
.fs
.mds_asok(['config', 'get', test_key
])
59 self
.assertEqual(out
[test_key
], test_val
)
61 # Implicitly asserting that things don't have lockdep error in shutdown
62 self
.mount_a
.umount_wait(require_clean
=True)