]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks: mark start and end of tests in clog
authorJohn Spray <john.spray@redhat.com>
Thu, 17 Nov 2016 11:03:49 +0000 (11:03 +0000)
committerJohn Spray <john.spray@redhat.com>
Thu, 17 Nov 2016 23:50:08 +0000 (23:50 +0000)
This makes it much easier to associate e.g. slow
requests messages with which test was running.

Signed-off-by: John Spray <john.spray@redhat.com>
tasks/ceph_test_case.py
tasks/cephfs/cephfs_test_case.py

index b914a10083d415b4e83e97972c59b74a4f0cf3b9..270c18553edbbfdf9e30139bbb9d0ccc454704d5 100644 (file)
@@ -25,6 +25,14 @@ class CephTestCase(unittest.TestCase):
 
     mon_manager = None
 
+    def setUp(self):
+        self.ceph_cluster.mon_manager.raw_cluster_cmd("log",
+            "Starting test {0}".format(self.id()))
+
+    def tearDown(self):
+        self.ceph_cluster.mon_manager.raw_cluster_cmd("log",
+            "Ended test {0}".format(self.id()))
+
     def assert_cluster_log(self, expected_pattern, invert_match=False, timeout=10):
         """
         Context manager.  Assert that during execution, or up to 5 seconds later,
index d91777b17ae2035c78162ff6de45219308cbc816..ba2a43f4aaf498757ba7bc437913ace59b0d6380 100644 (file)
@@ -58,6 +58,8 @@ class CephFSTestCase(CephTestCase):
     LOAD_SETTINGS = []
 
     def setUp(self):
+        super(CephFSTestCase, self).setUp()
+
         if len(self.mds_cluster.mds_ids) < self.MDSS_REQUIRED:
             raise case.SkipTest("Only have {0} MDSs, require {1}".format(
                 len(self.mds_cluster.mds_ids), self.MDSS_REQUIRED
@@ -177,6 +179,8 @@ class CephFSTestCase(CephTestCase):
         self.configs_set = set()
 
     def tearDown(self):
+        super(CephFSTestCase, self).tearDown()
+
         self.mds_cluster.clear_firewall()
         for m in self.mounts:
             m.teardown()