Add continuous mode integration tests 79/225379/1
authorMateusz Majewski <m.majewski2@samsung.com>
Wed, 19 Feb 2020 10:03:20 +0000 (11:03 +0100)
committerMateusz Majewski <m.majewski2@samsung.com>
Wed, 19 Feb 2020 10:03:20 +0000 (11:03 +0100)
Change-Id: I7090e6b127477eadab7bf34491fa2e442d9507ce

tests/dlog_test.in

index 72b5c48..331964a 100644 (file)
@@ -323,6 +323,24 @@ dlogutil -gb main &> /dev/null && ok || fail
 LOG_DETAILS="testing if writing all entries to single file works (-f)"
 dlogutil -f $TESTDIR/dlog_test_file -d &> /dev/null && ok || fail
 
+LOG_DETAILS="testing if the continuous mode works as expected (1/2)"
+dlogutil -b main -f $TESTDIR/dlog_continuous1_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_continuous1_file` -eq 10 ]] && ok || fail
+
+LOG_DETAILS="testing if the continuous mode works as expected (2/2)"
+dlogutil -b main -f $TESTDIR/dlog_continuous2_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_continuous2_file` -eq 11 ]] && 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=$!