From 3c4208775411535cba44bb43e92bddd25a1b8e3b Mon Sep 17 00:00:00 2001 From: "Wu, BinX" Date: Thu, 2 Apr 2020 10:24:48 +0800 Subject: [PATCH] test-case: refine check-sof-logger.sh test case Previously, if sof-logger only catchs the firmware log header, we will fail the test case. Obviously, this is an overaction. So this patch relaxes the firmware log check rule by allowing the log size less than 4K. As this test case focuses on sof-logger function check, if firmware error is found in the log, we just print out the error without failing the test case. Signed-off-by: Wu, BinX --- test-case/check-sof-logger.sh | 52 +++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/test-case/check-sof-logger.sh b/test-case/check-sof-logger.sh index 54627878..fc0e3fc3 100755 --- a/test-case/check-sof-logger.sh +++ b/test-case/check-sof-logger.sh @@ -47,47 +47,53 @@ if [[ ! -f $ldcFile ]]; then fi dlogi "Found file: $(md5sum $ldcFile|awk '{print $2, $1;}')" -rdnum=$RANDOM -tmp_file=/tmp/$rdnum.logger.log -err_tmp_file=/tmp/$rdnum.err_logger.log +data_file=$LOG_ROOT/logger.data.log +error_file=$LOG_ROOT/logger.error.log func_lib_check_sudo dlogi "Try to dump the dma trace log via sof-logger ..." -# sof-logger errors will output to $err_tmp_file -dlogc "sudo $loggerBin -t -l $ldcFile -o $tmp_file 2> $err_tmp_file &" -sudo bash -c "'$loggerBin -t -l $ldcFile -o $tmp_file 2> $err_tmp_file &'" +# sof-logger errors will output to $error_file +dlogc "sudo $loggerBin -t -l $ldcFile -o $data_file 2> $error_file &" +sudo bash -c "'$loggerBin -t -l $ldcFile -o $data_file 2> $error_file &'" sleep 2 dlogc "sudo pkill -9 $(basename $loggerBin)" sudo pkill -9 $(basename $loggerBin) 2> /dev/null +func_logger_exit() +{ + local code=$1 type=${2:-data} + dlogi "Log $type BEG>>" + cat $LOG_ROOT/logger.$type.log + dlogi "<>" - cat $err_tmp_file - dlogi "<>" - cat $tmp_file - dlogi "<>" -cat $tmp_file -dlogi "<