configs/dlog-logger.conf.test \
configs/dlog-logger.conf.alias \
configs/dlog-pipe.conf.cpu \
- configs/dlog-logger.conf.cpu
+ configs/dlog-logger.conf.cpu \
+ configs/qos-additions
unitdir = $(prefix)/lib/systemd/system
nodist_unit_DATA = configs/dlog_logger.service \
%{_datadir}/dlog-logger.conf.alias
%{_datadir}/dlog-pipe.conf.cpu
%{_datadir}/dlog-logger.conf.cpu
+%{_datadir}/qos-additions
%{_sysconfdir}/dlog.conf.d/99-dlog-logger.disable-platform-logging-for-testsuite.conf
%dir %attr(755,log,log) /var/lib/dlog-tests
%dir %attr(755,log,log) /usr/share/dlog-filters.conf.test
# In each 5 second period, 5 logs are sent, so there are 3 periods.
# 2 logs from each period are allowed.
[[ $(dlogutil --pid $DLOGSEND_PID -d | wc -l) -eq 6 ]] && ok || fail
+
+ if [ $type == "pipe" ]; then
+ PREQOS_CONFIG_PATH=$DLOG_CONFIG_PATH
+ DLOG_CONFIG_PATH="$TESTDIR/qos.conf"
+ cat $PREQOS_CONFIG_PATH "@datadir@/qos-additions" > $DLOG_CONFIG_PATH
+ kill $LOGGER > /dev/null
+ sleep 1
+ dlog_logger -b 99 -t 0 &
+ LOGGER=$!
+ sleep 1
+
+ dlogsend -b main -t DLOG_QOS_TEST1 -c 300 -d 1 -f 20 "Some log spam"
+ LOG_DETAILS="testing if QoS works (1/3)"
+ [[ $(dlogutil -d DLOG_QOS_TEST1 | wc -l) -le 180 ]] && ok || fail
+
+ dlogsend -b main -t DLOG_QOS_TEST2 -c 60 -d 1 -f 4 "A normal app that just wants to log" &
+ DLOGSEND_PID=$!
+ dlogsend -b main -t DLOG_QOS_TEST3 -c 240 -d 1 -f 16 "Some log spam"
+ wait $DLOGSEND_PID
+ LOG_DETAILS="testing if QoS works (2/3)"
+ [[ $(dlogutil -d DLOG_QOS_TEST2 DLOG_QOS_TEST3 | wc -l) -le 180 ]] && ok || fail
+ LOG_DETAILS="testing if QoS works (3/3)"
+ [[ $(dlogutil -d DLOG_QOS_TEST2 | wc -l) -gt 40 ]] && ok || fail
+
+ DLOG_CONFIG_PATH=$PREQOS_CONFIG_PATH
+ kill $LOGGER > /dev/null
+ sleep 1
+ dlog_logger -b 99 -t 0 &
+ LOGGER=$!
+ sleep 1
+ fi
fi
LOG_DETAILS="testing if libdlogutil clears the buffer correctly"