]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Log: Adding UT to catch an issue with huge line logging 7599/head
authorIgor Fedotov <ifedotov@mirantis.com>
Thu, 11 Feb 2016 17:43:51 +0000 (20:43 +0300)
committerIgor Fedotov <ifedotov@mirantis.com>
Thu, 11 Feb 2016 17:45:38 +0000 (20:45 +0300)
Signed-off-by: Igor Fedotov <ifedotov@mirantis.com>
src/log/test.cc

index a2df608665c1dce7a735d2d6557f32becadc079b..4e94addcbb637188ca695cf60d636b1cdf410af0 100644 (file)
@@ -210,3 +210,21 @@ TEST(Log, InternalSegv)
 {
   ASSERT_DEATH(do_segv(), ".*");
 }
+
+TEST(Log, LargeLog)
+{
+  SubsystemMap subs;
+  subs.add(1, "foo", 20, 10);
+  Log log(&subs);
+  log.start();
+  log.set_log_file("/tmp/big");
+  log.reopen_log_file();
+  int l = 10;
+  Entry *e = new Entry(ceph_clock_now(NULL), pthread_self(), l, 1);
+
+  std::string msg(10000000, 0);
+  e->set_str(msg);
+  log.submit_entry(e);
+  log.flush();
+  log.stop();
+}