From: Mateusz Majewski Date: Fri, 4 Sep 2020 08:31:06 +0000 (+0200) Subject: Add basic persistent logging tests X-Git-Tag: accepted/tizen/unified/20200908.060805^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=726d9b483b89f20bd95d6cdd7a42276be5b1d640;p=platform%2Fcore%2Fsystem%2Fdlog.git Add basic persistent logging tests For pipe backend only for now. Change-Id: I59ea088c9ba39c10cd9706ac5e432513e291bad1 --- diff --git a/configs/dlog-pipe.conf.test b/configs/dlog-pipe.conf.test index 711e14b..06e1568 100644 --- a/configs/dlog-pipe.conf.test +++ b/configs/dlog-pipe.conf.test @@ -84,6 +84,8 @@ radio_size=1048576 kmsg_size=1048576 syslog_size=1048576 +dlog_logger_conf_main=dlogutil -b main -r 512 -n 10 -f /var/lib/dlog-tests/main -v threadtime *:I + util_sorting_time_window=5000 util_sorting_buffer_size=32000 dynamic_config_path=/tmp/dlog-filters/ diff --git a/tests/dlog_test.in b/tests/dlog_test.in index 1e32ea2..0b00a60 100644 --- a/tests/dlog_test.in +++ b/tests/dlog_test.in @@ -842,6 +842,23 @@ LOG_DETAILS="testing if libdlogutil clears the buffer correctly" test_libdlogutil clear $LIBDLOGUTIL_CORRECT_PID $type && ok || fail if [ "$quick" -ne 1 ]; then + if [ "$type" = "pipe" ]; then + dlogsend -b main -t DLOG_LOGGER_TEST0 -c 100 "hi" + sleep 1 + LOG_DETAILS="testing if logger daemon persistent logging works" + [ "$(grep -c DLOG_LOGGER_TEST0 $TESTDIR/main)" -eq 100 ] && ok || fail + + dlogsend -b main -t DLOG_LOGGER_TEST1 -c 500000 "hi" + sleep 1 + RESULT=$(du -c $TESTDIR/main* | tail -n 1 | cut -f 1) + LOG_DETAILS="testing if logger daemon log rotating works (1/2)" + [ "$RESULT" -gt 4096 ] && ok || fail # Min 4 MB + LOG_DETAILS="testing if logger daemon log rotating works (2/2)" + [ "$RESULT" -lt 6144 ] && ok || fail # Max 6 MB + + dlogutil -cb main + fi + LOG_DETAILS="testing if the library works with multithreaded app" dlogutil -f $TESTDIR/dlog_mt_test & MT_TEST=$!