Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Fix test fail while CI passed. #82

Closed
wants to merge 1 commit into from
Closed
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
24 changes: 22 additions & 2 deletions sh_script/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,26 @@ RUN_RESPONDER_FEATURES=${RUN_RESPONDER_FEATURES:-spdm-ring,hashed-transcript-dat
RUN_REQUESTER_MUTAUTH_FEATURES="${RUN_REQUESTER_FEATURES},mut-auth"
RUN_RESPONDER_MUTAUTH_FEATURES="${RUN_RESPONDER_FEATURES},mut-auth"

run_spdm_emu_with_check() {
# Workaround for https://github.com/DMTF/spdm-emu/issues/265
# The check logic port from https://github.com/DMTF/spdm-emu/blob/07c0a838bcc1c6207c656ac75885c0603e344b6f/.github/workflows/build_CI.yml#L129C1-L137C13
filename=requester.log
set -x
"$@" > $filename
sleep 5
minsize=160000
if [ `stat -c%s "$filename"` -lt $minsize ] ||
! grep "libspdm_stop_session - (nil)" $filename;
then
echo "requester run fail"
cat -n "$filename"
echo "$filename size is `stat -c%s "$filename"`"
cleanup
exit 1
fi
set +x
}

run_with_spdm_emu() {
echo "Running with spdm-emu..."
pushd test_key
Expand All @@ -103,7 +123,7 @@ run_with_spdm_emu() {
sleep 5
pushd test_key
chmod +x ./spdm_requester_emu
echo_command ./spdm_requester_emu --trans PCI_DOE --exe_conn DIGEST,CERT,CHAL,MEAS --exe_session KEY_EX,PSK,KEY_UPDATE,HEARTBEAT,MEAS,DIGEST,CERT
run_spdm_emu_with_check ./spdm_requester_emu --trans PCI_DOE --exe_conn DIGEST,CERT,CHAL,MEAS --exe_session KEY_EX,PSK,KEY_UPDATE,HEARTBEAT,MEAS,DIGEST,CERT
popd
}

Expand All @@ -121,7 +141,7 @@ run_with_spdm_emu_mut_auth() {
sleep 5
pushd test_key
chmod +x ./spdm_requester_emu
echo_command ./spdm_requester_emu --trans PCI_DOE --req_asym ECDSA_P384 --exe_conn DIGEST,CERT,CHAL,MEAS --exe_session KEY_EX,PSK,KEY_UPDATE,HEARTBEAT,MEAS,DIGEST,CERT
run_spdm_emu_with_check ./spdm_requester_emu --trans PCI_DOE --req_asym ECDSA_P384 --exe_conn DIGEST,CERT,CHAL,MEAS --exe_session KEY_EX,PSK,KEY_UPDATE,HEARTBEAT,MEAS,DIGEST,CERT
popd
}

Expand Down
Loading