Skip to content

Commit a7bcac4

Browse files
author
Chao Song
committed
sof-test: remove dependency on /var/log/kern.log
Signed-off-by: Chao Song <chao.song@linux.intel.com>
1 parent 7f6f7ec commit a7bcac4

9 files changed

Lines changed: 9 additions & 17 deletions

case-lib/lib.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,6 @@ die()
339339
exit 1
340340
}
341341

342-
# force ask buffer data write into file system
343-
sudo sync -f || true
344-
# catch kern.log last line as current case start line
345-
if [ ! "$DMESG_LOG_START_LINE" ]; then
346-
DMESG_LOG_START_LINE=$(wc -l /var/log/kern.log|awk '{print $1;}')
347-
fi
348-
349342
is_sof_used()
350343
{
351344
grep -q "sof" /proc/asound/cards;

test-case/check-ipc-flood.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ OPT_NAME['l']='loop' OPT_DESC['l']='loop count'
2525
OPT_HAS_ARG['l']=1 OPT_VAL['l']=1
2626

2727
func_opt_parse_option "$@"
28+
setup_kernel_check_point "now"
2829

2930
lpc_loop_cnt=${OPT_VAL['c']}
3031
ipc_flood_dfs=${OPT_VAL['f']}

test-case/check-reboot.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ $old_content
150150
151151
$boot_once_flag
152152
export LOG_ROOT='$(realpath $LOG_ROOT)'
153-
export DMESG_LOG_START_LINE=$(wc -l /var/log/kern.log|awk '{print $1;}')
153+
setup_kernel_check_point "now"
154+
export KERNEL_CHECKPOINT
154155
bash -c '$full_cmd'
155156
156157
exit 0

test-case/check-sof-logger.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ func_opt_parse_option "$@"
2222

2323
#TODO: need to add arguments for user to give location for logger and ldc file
2424

25-
# hijack DMESG_LOG_START_LINE which refer dump kernel log in exit function
26-
DMESG_LOG_START_LINE=$(sof-get-kernel-line.sh|tail -n 1 |awk '{print $1;}')
25+
setup_kernel_check_point "now"
2726

2827
# check sof-logger location
2928
if [ -z $(which sof-logger) ]; then

test-case/verify-firmware-presence.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ set -e
2020
source "$(dirname "${BASH_SOURCE[0]}")"/../case-lib/lib.sh
2121

2222
func_opt_parse_option "$@"
23+
setup_kernel_check_point "boot"
2324

2425
path=$(sof-dump-status.py -P)
2526
platform=$(sof-dump-status.py -p)

test-case/verify-kernel-module-load-probe.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ source $(dirname ${BASH_SOURCE[0]})/../case-lib/lib.sh
1717

1818
func_opt_parse_option "$@"
1919

20-
# hijack DMESG_LOG_START_LINE which refer dump kernel log in exit function
21-
DMESG_LOG_START_LINE=$(sof-get-kernel-line.sh|tail -n 1 |awk '{print $1;}')
20+
setup_kernel_check_point "now"
2221

2322
dlogi "Checking if sof relative modules loaded"
2423
dlogc "lsmod | grep \"sof\""

test-case/verify-pcm-list.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ tplg=${OPT_VAL['t']}
2929
tplg_path=`func_lib_get_tplg_path "$tplg"`
3030
[[ "$?" != "0" ]] && die "No available topology for this test case"
3131

32-
# hijack DMESG_LOG_START_LINE which refer dump kernel log in exit function
33-
DMESG_LOG_START_LINE=$(sof-get-kernel-line.sh|tail -n 1 |awk '{print $1;}')
32+
setup_kernel_check_point "now"
3433

3534
tplg_str="$(sof-tplgreader.py $tplg_path -d id pcm type -o)"
3635
pcm_str="$(sof-dump-status.py -i ${SOFCARD:-0})"

test-case/verify-sof-firmware-load.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ source "$(dirname "${BASH_SOURCE[0]}")"/../case-lib/lib.sh
2020

2121
func_opt_parse_option "$@"
2222

23-
# hijack DMESG_LOG_START_LINE to dump kernel from file start is not Sub-Test
24-
# TODO: clean up Sub-Test feature
25-
alias | grep -q 'Sub-Test' || DMESG_LOG_START_LINE=$(sof-get-kernel-line.sh | tail -n 1 | awk '{print $1;}' )
23+
alias | grep -q 'Sub-Test' || setup_kernel_check_point "now"
2624

2725
cmd="journalctl_cmd"
2826

test-case/verify-tplg-binary.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ OPT_NAME['t']='tplg' OPT_DESC['t']='tplg file, default value is env TPLG: $'
2323
OPT_HAS_ARG['t']=1 OPT_VAL['t']="$TPLG"
2424

2525
func_opt_parse_option "$@"
26+
setup_kernel_check_point "now"
2627
tplg=${OPT_VAL['t']}
2728

2829
tplg_path=`func_lib_get_tplg_path "$tplg"`

0 commit comments

Comments
 (0)