]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephfs: test case for timeout config of individual session 32245/head
authorYan, Zheng <zyan@redhat.com>
Tue, 23 Jul 2019 12:21:07 +0000 (20:21 +0800)
committerNathan Cutler <ncutler@suse.com>
Tue, 21 Jan 2020 16:43:01 +0000 (17:43 +0100)
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit 4b28a4a7569ab516d75752c97226f598e6229ca2)

qa/tasks/cephfs/test_client_recovery.py

index 370a64216fa67f0db91d0defeebef6b1cb9db84d..91ef54415fc9b8de32273d73c56666f5393bb28b 100644 (file)
@@ -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()