Add a simple critical log integration test 49/242349/3
authorMateusz Majewski <m.majewski2@samsung.com>
Tue, 25 Aug 2020 12:54:29 +0000 (14:54 +0200)
committerMateusz Majewski <m.majewski2@samsung.com>
Wed, 26 Aug 2020 10:10:25 +0000 (12:10 +0200)
Change-Id: If70b4d29efd36df435f0e91fffdc0cef17da2a08

tests/dlog_test.in

index abd84be..ce45dbd 100644 (file)
@@ -281,6 +281,14 @@ if [ "$TEST_DYNAMIC_FILTERS" == "true" ]; then
        rm $RUNTIME_FILTERS_DIR/10-other.conf
 fi
 
+SEED=$(head -c 6 /dev/urandom | base64)
+dlogsend -k "$SEED"
+# -k is async, unlike normal mode; therefore we have to wait until the logging process actually finishes
+while ps -o args | grep "dlogsend" | grep -v grep &> /dev/null || ps -o args | grep "dlog-log-critical" | grep -v grep &> /dev/null; do :; done
+CRIT_PATH="@DLOG_CRITICAL_LOGFILE_PATH@"
+LOG_DETAILS="testing if critical logging works"
+cat "$CRIT_PATH".{a,b} | grep -F "$SEED" &> /dev/null && ok || fail
+
 # put 100 log entries in the "main" buffer
 dlogutil -c
 test_libdlog 100