modulesloadd_DATA = \
configs/tizen-modules-dlog-zero-copy.conf
-bin_SCRIPTS = dlog_test dlog_test_header dlog_test_daemon_early_quit dlog_cpu
+bin_SCRIPTS = dlog_test dlog_test_header dlog_test_daemon_early_quit dlog_test_tid_filtering_secure_logging dlog_cpu
[run-unittest.sh:tests/dlog_coverage.in]
[dlog_test_header:tests/dlog_test_header.in]
[dlog_test_daemon_early_quit:tests/dlog_test_daemon_early_quit.in]
+ [dlog_test_tid_filtering_secure_logging:tests/dlog_test_tid_filtering_secure_logging.in]
[dlog_cpu:tests/dlog_cpu.in]
[README.testsuite:tests/README.testsuite.in]
[units/dlog_logger.service]
%{_bindir}/dlog_test
%{_bindir}/dlog_test_header
%{_bindir}/dlog_test_daemon_early_quit
+%{_bindir}/dlog_test_tid_filtering_secure_logging
%{_bindir}/dlog_cpu
/usr/share/doc/dlog/README.testsuite
%{_libexecdir}/libdlog/perf_libdlog
dlogutil -db kmsg -v raw | grep -Fm1 "$last_dmesg" >/dev/null && ok || fail
fi
- LOG_DETAILS="testing if pid filtering works"
- dlogsend -b main -t DLOG_TESTSUITE pidTEST &
- sleep 1
- line=$(dlogutil -v raw -d --pid $!)
- [ "$line" = "pidTEST" ] && ok || fail
-
- LOG_DETAILS="testing if tid filtering works"
- dlogsend -b main -t DLOG_TESTSUITE tidTEST &
- sleep 1
- line=$(dlogutil -v raw -d --tid $!) #dlogsend is a single threaded app so tid is the same as pid
- [ "$line" = "tidTEST" ] && ok || fail
-
- mv $DLOG_CONFIG_PATH $DLOG_CONFIG_PATH.1
- LOG_DETAILS="testing if secure logging works (1/2)"
- grep -v enable_secure_logs $DLOG_CONFIG_PATH.1 > $DLOG_CONFIG_PATH
- echo "enable_secure_logs=1" >> $DLOG_CONFIG_PATH
- dlogutil -c
- dlogsend -zb main -t DLOG_TESTSUITE secure &
- sleep 1
- dlogsend -b main -t DLOG_TESTSUITE insecure &
- sleep 1
- line=$(dlogutil -v raw -d | head -n1)
- [ "$line" = "secure" ] && ok || fail
- LOG_DETAILS="testing if secure logging works (2/2)"
- grep -v enable_secure_logs $DLOG_CONFIG_PATH.1 > $DLOG_CONFIG_PATH
- echo "enable_secure_logs=0" >> $DLOG_CONFIG_PATH
- dlogutil -c
- dlogsend -zb main -t DLOG_TESTSUITE secure &
- sleep 1
- dlogsend -b main -t DLOG_TESTSUITE insecure &
- sleep 1
- line=$(dlogutil -v raw -d | head -n1)
- [ "$line" = "insecure" ] && ok || fail
- mv $DLOG_CONFIG_PATH.1 $DLOG_CONFIG_PATH
+ dlog_test_tid_filtering_secure_logging $type
fi
+dlog_logger -t 0 &
+LOGGER=$!
+sleep 1
+
dlogsend -b main -t DLOG_TESTSUITE_TAG0 -pI tagTEST0
dlogsend -b main -t DLOG_TESTSUITE_TAG1 -pI tagTEST1
dlogsend -b main -t DLOG_TESTSUITE_TAG2 -pF tagTEST2
--- /dev/null
+#!/bin/sh
+
+source dlog_test_header
+
+trap cleanup 0
+
+export DLOG_CONFIG_PATH="@datadir@/dlog-$type.conf.test"
+
+if [ $LOGGER -eq -1 ]; then
+ dlog_logger -t 0 &
+ LOGGER=$!
+ sleep 1
+fi
+
+LOG_DETAILS="testing if pid filtering works"
+dlogsend -b main -t DLOG_TESTSUITE pidTEST &
+sleep 1
+line=$(dlogutil -v raw -d --pid $!)
+[ "$line" = "pidTEST" ] && ok || fail
+
+LOG_DETAILS="testing if tid filtering works"
+dlogsend -b main -t DLOG_TESTSUITE tidTEST &
+sleep 1
+line=$(dlogutil -v raw -d --tid $!) #dlogsend is a single threaded app so tid is the same as pid
+[ "$line" = "tidTEST" ] && ok || fail
+
+mv $DLOG_CONFIG_PATH $DLOG_CONFIG_PATH.1
+LOG_DETAILS="testing if secure logging works (1/2)"
+grep -v enable_secure_logs $DLOG_CONFIG_PATH.1 > $DLOG_CONFIG_PATH
+echo "enable_secure_logs=1" >> $DLOG_CONFIG_PATH
+dlogutil -c
+dlogsend -zb main -t DLOG_TESTSUITE secure &
+sleep 1
+dlogsend -b main -t DLOG_TESTSUITE insecure &
+sleep 1
+line=$(dlogutil -v raw -d | head -n1)
+[ "$line" = "secure" ] && ok || fail
+LOG_DETAILS="testing if secure logging works (2/2)"
+grep -v enable_secure_logs $DLOG_CONFIG_PATH.1 > $DLOG_CONFIG_PATH
+echo "enable_secure_logs=0" >> $DLOG_CONFIG_PATH
+dlogutil -c
+dlogsend -zb main -t DLOG_TESTSUITE secure &
+sleep 1
+dlogsend -b main -t DLOG_TESTSUITE insecure &
+sleep 1
+line=$(dlogutil -v raw -d | head -n1)
+[ "$line" = "insecure" ] && ok || fail
+mv $DLOG_CONFIG_PATH.1 $DLOG_CONFIG_PATH
+
+if [ $LOGGER -ne -1 ]; then
+ kill $LOGGER > /dev/null
+ sleep 1
+fi