Skip to content

Commit

Permalink
tasks/cephfs: add TestConfigCommands
Browse files Browse the repository at this point in the history
Get some coverage on the otherwise rarely touched
injectargs and `config set` interfaces.

Fixes: #14365
Signed-off-by: John Spray <john.spray@redhat.com>
  • Loading branch information
John Spray committed Jan 27, 2016
1 parent ac3873d commit c7182c3
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
11 changes: 11 additions & 0 deletions suites/fs/recovery/tasks/config-commands.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

overrides:
ceph:
conf:
global:
lockdep: true

tasks:
- cephfs_test_runner:
modules:
- tasks.cephfs.test_config_commands
51 changes: 51 additions & 0 deletions tasks/cephfs/test_config_commands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

from unittest import case
from tasks.cephfs.cephfs_test_case import CephFSTestCase
from tasks.cephfs.fuse_mount import FuseMount


class TestConfigCommands(CephFSTestCase):
"""
Test that daemons and clients respond to the otherwise rarely-used
runtime config modification operations.
"""

CLIENTS_REQUIRED = 1
MDSS_REQUIRED = 1

def test_client_config(self):
"""
That I can successfully issue asok "config set" commands
:return:
"""

if not isinstance(self.mount_a, FuseMount):
raise case.SkipTest("Test only applies to FUSE clients")

test_key = "client_cache_size"
test_val = "123"
self.mount_a.admin_socket(['config', 'set', test_key, test_val])
out = self.mount_a.admin_socket(['config', 'get', test_key])
self.assertEqual(out[test_key], test_val)

self.mount_a.umount_wait()

def test_mds_config_asok(self):
test_key = "mds_max_purge_ops"
test_val = "123"
self.fs.mds_asok(['config', 'set', test_key, test_val])
out = self.fs.mds_asok(['config', 'get', test_key])
self.assertEqual(out[test_key], test_val)

def test_mds_config_tell(self):
test_key = "mds_max_purge_ops"
test_val = "123"

mds_id = self.fs.get_lone_mds_id()
self.fs.mon_manager.raw_cluster_cmd("tell", "mds.{0}".format(mds_id), "injectargs",
"--{0}={1}".format(test_key, test_val))

# Read it back with asok because there is no `tell` equivalent
out = self.fs.mds_asok(['config', 'get', test_key])
self.assertEqual(out[test_key], test_val)

0 comments on commit c7182c3

Please sign in to comment.