From 1015ab21d92ba117576a5a39d0e91c29ae387a20 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Tue, 23 Jul 2019 20:21:07 +0800 Subject: [PATCH] qa/cephfs: test case for timeout config of individual session Signed-off-by: "Yan, Zheng" (cherry picked from commit 4b28a4a7569ab516d75752c97226f598e6229ca2) --- qa/tasks/cephfs/test_client_recovery.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/qa/tasks/cephfs/test_client_recovery.py b/qa/tasks/cephfs/test_client_recovery.py index 370a64216fa67..91ef54415fc9b 100644 --- a/qa/tasks/cephfs/test_client_recovery.py +++ b/qa/tasks/cephfs/test_client_recovery.py @@ -612,3 +612,22 @@ class TestClientRecovery(CephFSTestCase): self.assertLess(time.time(), time_at_beg + SESSION_AUTOCLOSE) self.mount_a.send_signal('sigcont') + + def test_config_session_timeout(self): + self.fs.mds_asok(['config', 'set', 'mds_defer_session_stale', 'false']) + session_timeout = self.fs.get_var("session_timeout") + mount_a_gid = self.mount_a.get_global_id() + + self.fs.mds_asok(['session', 'config', '%s' % mount_a_gid, 'timeout', '%s' % (session_timeout * 2)]) + + self.mount_a.kill(); + + self.assert_session_count(2) + + time.sleep(session_timeout * 1.5) + self.assert_session_state(mount_a_gid, "open") + + time.sleep(session_timeout) + self.assert_session_count(1) + + self.mount_a.kill_cleanup() -- 2.39.5