]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/cephfs: test case for timeout config of individual session
authorYan, Zheng <zyan@redhat.com>
Tue, 23 Jul 2019 12:21:07 +0000 (20:21 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 29 Jul 2019 06:42:41 +0000 (14:42 +0800)
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
qa/tasks/cephfs/test_client_recovery.py

index e4c3ce60691cc06be629dc8adc1810b92cfb8059..457b991ee3432a8fabbe257212347bdb5e401770 100644 (file)
@@ -601,3 +601,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()