Add monitor mode integration tests 80/225380/2
authorMateusz Majewski <m.majewski2@samsung.com>
Wed, 19 Feb 2020 10:03:36 +0000 (11:03 +0100)
committerMateusz Majewski <m.majewski2@samsung.com>
Wed, 19 Feb 2020 10:11:38 +0000 (11:11 +0100)
Change-Id: I639bf18439826c6900a843dd918c8c10e1d6bbee

tests/dlog_test.in

index 331964a..7f983da 100644 (file)
@@ -341,6 +341,24 @@ kill $UTIL_PID && WAS_ALIVE=1 || WAS_ALIVE=0
 UTIL_PID=-1
 [[ $WAS_ALIVE -eq 1 && `wc -l < $TESTDIR/dlog_continuous2_file` -eq 11 ]] && ok || fail
 
+LOG_DETAILS="testing if the monitor mode works as expected (1/2)"
+dlogutil -mb main -f $TESTDIR/dlog_monitor1_file &
+UTIL_PID=$!
+sleep 1
+kill $UTIL_PID && WAS_ALIVE=1 || WAS_ALIVE=0
+UTIL_PID=-1
+[[ $WAS_ALIVE -eq 1 && `wc -l < $TESTDIR/dlog_monitor1_file` -eq 0 ]] && ok || fail
+
+LOG_DETAILS="testing if the monitor mode works as expected (2/2)"
+dlogutil -mb main -f $TESTDIR/dlog_monitor2_file &
+UTIL_PID=$!
+sleep 1
+dlogsend -b main "Hi!"
+sleep 1
+kill $UTIL_PID && WAS_ALIVE=1 || WAS_ALIVE=0
+UTIL_PID=-1
+[[ $WAS_ALIVE -eq 1 && `wc -l < $TESTDIR/dlog_monitor2_file` -eq 1 ]] && ok || fail
+
 LOG_DETAILS="testing if writing entries to rotating files works (-r/-n)"
 dlogutil -f $TESTDIR/dlog_rotating_file -r 12 -n 3 & # 3 files at 12 KB each
 UTIL_PID=$!