Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib.sh: simplify the check for firmware rtos #973

Merged
merged 1 commit into from
Nov 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 14 additions & 19 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -680,28 +680,23 @@ is_zephyr()
test "$znum" -gt 10
}

# FIXME: the kernel driver should give us the FW path
# https://github.com/thesofproject/linux/issues/3867
get_firmware_path()
{
journalctl_cmd -k |
awk '/sof.*request_firmware/ { sub(/^.*request_firmware/,""); last_loaded_file=$1 } END { print last_loaded_file }'
}

is_firmware_file_zephyr()
{
local firmware_name firmware_path znum platform
# get the FW name and path
# TODO: optimize this part after driver can expose the FW path to userspace via debugfs
if is_ipc4; then
firmware_name=dsp_basefw.bin
fw_mod_para=/sys/module/snd_sof_pci/parameters/fw_path
if [ -s "$fw_mod_para" ]; then
firmware_path=$(cat $fw_mod_para)
else
# # FIXME: the kernel driver should give us the FW path
# https://github.com/thesofproject/linux/issues/3867
die "Failed to get the IPC4 FW path."
fi
else # for IPC3
platform=$(sof-dump-status.py -p)
firmware_name=sof-$platform.ri
firmware_path=$(sof-dump-status.py -P)
fi
local firmware_path znum

firmware_path=$(get_firmware_path)
[ -n "$firmware_path" ] ||
die 'firmware path not found from journalctl, no firmware loaded or debug option disabled?'
Copy link
Contributor

@miRoox miRoox Nov 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

die here will lose "Test Result: FAIL!" and make our CI treat it as TIMEOUT. #979

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @miRoox! The func_exit_handler() should print "Test Result: something", did you find why it does not?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To reproduce simply change the grep value to make it fail.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The func_exit_handler() should print "Test Result: something", did you find why it does not?

As you said in #977, func_exit_handler will not be called again when exit inside it.

Copy link
Collaborator

@marc-hb marc-hb Nov 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you said in #977, func_exit_handler will not be called again when exit inside it.

Answering in bug #979 , let's move the discussion there.


znum=$(strings "/lib/firmware/$firmware_path/$firmware_name" | grep -c -i zephyr)
znum=$(strings "/lib/firmware/$firmware_path" | grep -c -i zephyr)
aiChaoSONG marked this conversation as resolved.
Show resolved Hide resolved
test "$znum" -gt 10
}

Expand Down