summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test-ingest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test-ingest.cpp b/test/test-ingest.cpp
index 41b3690..be3be56 100644
--- a/test/test-ingest.cpp
+++ b/test/test-ingest.cpp
@@ -249,6 +249,19 @@ BOOST_AUTO_TEST_CASE(StoreLog, *boost::unit_test::depends_on("I/StoreLogLine"))
BOOST_CHECK_EQUAL(linesDiscarded, 0);
}
+BOOST_AUTO_TEST_CASE(TerminateHandler, *boost::unit_test::timeout(5))
+{
+ WebStat::FilePtr input {fopen("/dev/null", "r")};
+ BOOST_REQUIRE(input);
+ BOOST_REQUIRE(!terminated);
+ raise(SIGTERM);
+ BOOST_REQUIRE(terminated);
+ ingestLog(input.get());
+ BOOST_CHECK_EQUAL(linesRead, 0);
+ BOOST_CHECK_EQUAL(linesParsed, 0);
+ BOOST_CHECK_EQUAL(linesDiscarded, 0);
+}
+
BOOST_AUTO_TEST_CASE(ParkLogLine)
{
parkLogLine(LOGLINE1);