From: David Zafman Date: Fri, 20 Feb 2015 03:48:11 +0000 (-0800) Subject: test: ceph_test_filejournal Add check of journalq in WriteTrim test X-Git-Tag: v9.0.2~168^2~32 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8da4d9f6330c57d6b437ea44f54f147075e24195;p=ceph.git test: ceph_test_filejournal Add check of journalq in WriteTrim test Commit all journal entries and check for empty journalq Signed-off-by: David Zafman --- diff --git a/src/os/FileJournal.h b/src/os/FileJournal.h index 964dbe721bc7..d565252f4efd 100644 --- a/src/os/FileJournal.h +++ b/src/os/FileJournal.h @@ -214,6 +214,8 @@ public: } } __attribute__((__packed__, aligned(4))); + bool journalq_empty() { return journalq.empty(); } + private: string fn; diff --git a/src/test/test_filejournal.cc b/src/test/test_filejournal.cc index befe761400db..5bbaab1c99fb 100644 --- a/src/test/test_filejournal.cc +++ b/src/test/test_filejournal.cc @@ -360,9 +360,11 @@ TEST(TestFileJournal, WriteTrim) { while (ls.size()) { delete ls.front(); ls.pop_front(); - j.committed_thru(committed); + j.committed_thru(++committed); } + ASSERT_TRUE(j.journalq_empty()); + j.close(); }