Skip to content

Commit 619257b

Browse files
committed
sof-logger: fix "unary operator expected"
Fix for: ``` /home/ubuntu/sof-test/test-case/../case-lib/lib.sh: line 955: [: -eq: unary operator expected ``` Also set default value for an arg -s for the tests which not set it. Signed-off-by: Artur Wilczak <arturx.wilczak@intel.com>
1 parent 77dd64c commit 619257b

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

case-lib/lib.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -949,11 +949,21 @@ is_ipc4()
949949
return 1
950950
}
951951

952+
set_default_param_for_sof_logger()
953+
{
954+
OPT_NAME['s']='sof-logger'
955+
OPT_DESC['s']="Open sof-logger trace the data will store at $LOG_ROOT"
956+
OPT_HAS_ARG['s']=0
957+
OPT_VAL['s']=1
958+
}
959+
952960
logger_disabled()
953961
{
954962
# Disable logging when available...
955-
if [ ${OPT_VAL['s']} -eq 0 ]; then
956-
return 0
963+
if [ -n "${OPT_VAL['s']}" ]; then
964+
[ "${OPT_VAL['s']}" -eq 0 ] && return 0
965+
else
966+
set_default_param_for_sof_logger
957967
fi
958968

959969
# ... across all tests at once.

0 commit comments

Comments
 (0)