testsuite: speed up format tests 07/196907/1
authorMaciej Slodczyk <m.slodczyk2@partner.samsung.com>
Mon, 7 Jan 2019 11:46:19 +0000 (12:46 +0100)
committerMaciej Slodczyk <m.slodczyk2@partner.samsung.com>
Mon, 7 Jan 2019 11:46:19 +0000 (12:46 +0100)
Get rid of unnecessary sorting in dlogutil
when performing format checks.

Change-Id: Iaecd583c3994f73de0b11626a89e87b19379f7ae
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
tests/dlog_test.in

index 09c05fe..0ee8c7c 100644 (file)
@@ -328,7 +328,8 @@ if [ $(du $TESTDIR/dlog_rotating_file.3 | sed "s#$TESTDIR/dlog_rotating_file.3##
 kill $UTIL_PID
 UTIL_PID=-1
 
-cmd="dlogutil -t 1 -v "
+cmd_prefix="dlogutil -d -u 0 -v"
+cmd_postfix="head -n 1 "
 
 format="process"
 regex_prio="[VDIWEFS]{1}"
@@ -338,67 +339,68 @@ regex_timezone="[\+-]{1}[0-9]{4}"
 
 REGEX="s/^$regex_prio\([0-9[:space:]]{5,}\)[[:print:]]*\([[:print:]]*\)$/1/g"
 LOG_DETAILS="testing if \"$format\" print format works"
-line=`$cmd $format`
+line=`$cmd_prefix $format | $cmd_postfix`
 [[ `echo "$line" | sed -re $REGEX` == "1" ]] && ok || fail
 
 format="tag"
 REGEX="s/^$regex_prio\/[[:print:]]{9,}:\s{1}[[:print:]]*$/1/g"
 LOG_DETAILS="testing if \"$format\" print format works"
-line=`$cmd $format`
+line=`$cmd_prefix $format | $cmd_postfix`
 [[ `echo "$line" | sed -re $REGEX` == "1" ]] && ok || fail
 
 format="thread"
 REGEX="s/^$regex_prio\($regex_pidtid\)\s{1}[[:print:]]*$/1/g"
 LOG_DETAILS="testing if \"$format\" print format works"
-line=`$cmd $format`
+line=`$cmd_prefix $format | $cmd_postfix`
 [[ `echo "$line" | sed -re $REGEX` == "1" ]] && ok || fail
 
 format="time"
 REGEX="s/^$regex_time.[0-9]{3}$regex_timezone\s{1}$regex_prio\/[[:print:]]{8,}\([0-9[:space:]]{5,}\):\s{1}[[:print:]]*$/1/g"
 LOG_DETAILS="testing if \"$format\" print format works"
-line=`$cmd $format`
+line=`$cmd_prefix $format | $cmd_postfix`
 [[ `echo "$line" | sed -re $REGEX` == "1" ]] && ok || fail
 
 format="threadtime"
 REGEX="s/^$regex_time.[0-9]{3}$regex_timezone\s{1}$regex_prio\/[[:print:]]{8,}\($regex_pidtid\):\s{1}[[:print:]]*$/1/g"
 LOG_DETAILS="testing if \"$format\" print format works"
-line=`$cmd $format`
+line=`$cmd_prefix $format | $cmd_postfix`
 [[ `echo "$line" | sed -re $REGEX` == "1" ]] && ok || fail
 
 format="kerneltime"
 REGEX="s/^[0-9[:space:]]{1,}.[0-9]{3,}\s{1}$regex_prio\/[[:print:]]{8,}\($regex_pidtid\):\s{1}[[:print:]]*$/1/g"
 LOG_DETAILS="testing if \"$format\" print format works"
-line=`$cmd $format`
+line=`$cmd_prefix $format | $cmd_postfix`
 [[ `echo "$line" | sed -re $REGEX` == "1" ]] && ok || fail
 
 format="recv_realtime"
 REGEX="s/^$regex_time.[0-9]{3}\s{1}$regex_prio\/[[:print:]]{8,}\($regex_pidtid\):\s{1}[[:print:]]*$/1/g"
 LOG_DETAILS="testing if \"$format\" print format works"
-line=`$cmd $format`
+line=`$cmd_prefix $format | $cmd_postfix`
 [[ `echo "$line" | sed -re $REGEX` == "1" ]] && ok || fail
 
 format="rwtime"
 REGEX="s/^$regex_time\s{1}\[[0-9[:space:]]{3,}.[0-9[:space:]]{3,}\]\s{1}$regex_prio\/[[:print:]]{8,}\($regex_pidtid\):\s{1}[[:print:]]*$/1/g"
 LOG_DETAILS="testing if \"$format\" print format works"
-line=`$cmd $format`
+line=`$cmd_prefix $format | $cmd_postfix`
 [[ `echo "$line" | sed -re $REGEX` == "1" ]] && ok || fail
 
 format="long"
 REGEX="s/^\[\s{1}$regex_time.[0-9]{3,}\s{1}$regex_prio\/[[:print:]]{8,}\s{1}$regex_pidtid\]\s{1}[[:print:]]*$/1/g"
 LOG_DETAILS="testing if \"$format\" print format works"
-line=`$cmd $format`
+line=`$cmd_prefix $format | $cmd_postfix`
 [[ `echo "$line" | tr '\n' ' ' | sed -re $REGEX` == "1" ]] && ok || fail
 
 format="brief"
 REGEX="s/^$regex_prio\/[[:print:]]{8,}\([0-9[:space:]]{5,}\):\s{1}[[:print:]]*$/1/g"
 LOG_DETAILS="testing if \"$format\" print format works"
-line=`$cmd $format`
+line=`$cmd_prefix $format | $cmd_postfix`
 [[ `echo "$line" | sed -re $REGEX` == "1" ]] && ok || fail
 
 format="raw"
 LOG_DETAILS="testing if \"$format\" print format works"
+dlogutil -c
 dlogsend -b main -t DLOG_TESTSUITE rawformatTEST
-line=`$cmd $format`
+line=`$cmd_prefix $format | $cmd_postfix`
 [[ "$line" == "rawformatTEST" ]] && ok || fail
 
 LOG_DETAILS="testing if pid filtering works"