Skip to content

Commit

Permalink
Make spdm_emu return_false_for_error for CI
Browse files Browse the repository at this point in the history
Fix the issue: DMTF#265

Make the spdm_emu return false for the error case.
Then the CI check can be simplified.

Signed-off-by: Wenxing Hou <[email protected]>
  • Loading branch information
Wenxing-hou committed Oct 9, 2023
1 parent d2c59c1 commit 3353670
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 651 deletions.
188 changes: 17 additions & 171 deletions .github/workflows/build_CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,40 +54,16 @@ jobs:
echo "port is used"
fi
./spdm_responder_emu &
sleep 5s
./spdm_requester_emu >requester.log
filename=./requester.log
if [ ! -f "$filename" ];
then
echo "Gen requester.log fail"
exit 1
fi
if grep "Connect Error - 6f" requester.log
then
sleep 100s
echo -e "\n try connect again!!! \n"
./spdm_responder_emu &
./spdm_requester_emu >requester.log
if [ ! -f "$filename" ];
then
echo "Second Gen requester.log fail"
exit 1
fi
fi
sleep 10s
minsize=1070000
if [ `stat -c%s "$filename"` -lt $minsize ] ||
! grep "libspdm_stop_session - (nil)" requester.log;
then
echo "requester run fail"
cat -n "$filename"
echo "requester.log size is `stat -c%s "$filename"`"
exit 1
fi
- name: Responder_validator_Test
run: |
cd build/bin
./spdm_responder_emu &
sleep 5s
./spdm_device_validator_sample
- name: Test_RECORD_TRANSCRIPT_DATA_consistent
# open LIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT flag
Expand All @@ -105,71 +81,15 @@ jobs:
cd bin
echo "requester (DATA_SUPPORT = 0) <=> responder (DATA_SUPPORT = 1)"
./spdm_responder_emu &
sleep 5s
./../../build/bin/spdm_requester_emu >requester.log
filename=./../../build/bin/requester.log
if [ ! -f "$filename" ];
then
echo "Gen requester.log fail"
exit 1
fi
if grep "Connect Error - 6f" requester.log
then
sleep 100s
echo -e "\n try connect again!!! \n"
./spdm_responder_emu &
./../../build/bin/spdm_requester_emu >requester.log
if [ ! -f "$filename" ];
then
echo "Second Gen requester.log fail"
exit 1
fi
fi
minsize=1070000
if [ `stat -c%s "$filename"` -lt $minsize ] ||
! grep "libspdm_stop_session - (nil)" requester.log;
then
echo "requester run fail"
cat -n "$filename"
echo "requester.log size is `stat -c%s "$filename"`"
exit 1
fi
sleep 10s
echo "requester (DATA_SUPPORT = 1) <=> responder (DATA_SUPPORT = 0)"
./../../build/bin/spdm_responder_emu &
sleep 5s
./spdm_requester_emu >requester.log
filename=./requester.log
if [ ! -f "$filename" ];
then
echo "Gen requester.log fail"
exit 1
fi
if grep "Connect Error - 6f" requester.log
then
sleep 100s
echo -e "\n try connect again!!! \n"
./../../build/bin/spdm_responder_emu &
./spdm_requester_emu >requester.log
if [ ! -f "$filename" ];
then
echo "Second Gen requester.log fail"
exit 1
fi
fi
minsize=1070000
if [ `stat -c%s "$filename"` -lt $minsize ] ||
! grep "libspdm_stop_session - (nil)" requester.log;
then
echo "requester run fail"
cat -n "$filename"
echo "requester.log size is `stat -c%s "$filename"`"
exit 1
fi
gcc_openssl_build:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -198,40 +118,15 @@ jobs:
echo "port is used"
fi
./spdm_responder_emu &
sleep 5s
./spdm_requester_emu >requester.log
sleep 10s
filename=./requester.log
if [ ! -f "$filename" ];
then
echo "Gen requester.log fail"
exit 1
fi
if grep "Connect Error - 6f" requester.log
then
sleep 100s
echo -e "\n try connect again!!! \n"
./spdm_responder_emu &
./spdm_requester_emu >requester.log
if [ ! -f "$filename" ];
then
echo "Second Gen requester.log fail"
exit 1
fi
fi
minsize=1070000
if [ `stat -c%s "$filename"` -lt $minsize ] ||
! grep "libspdm_stop_session - (nil)" requester.log;
then
echo "requester run fail"
cat -n "$filename"
echo "requester.log size is `stat -c%s "$filename"`"
exit 1
fi
- name: Responder_validator_Test
run: |
cd build/bin
./spdm_responder_emu &
sleep 5s
./spdm_device_validator_sample
- name: Test_RECORD_TRANSCRIPT_DATA_consistent
# open LIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT flag
Expand All @@ -249,70 +144,15 @@ jobs:
cd bin
echo "requester (DATA_SUPPORT = 0) <=> responder (DATA_SUPPORT = 1)"
./spdm_responder_emu &
sleep 5s
./../../build/bin/spdm_requester_emu >requester.log
filename=./../../build/bin/requester.log
if [ ! -f "$filename" ];
then
echo "Gen requester.log fail"
exit 1
fi
if grep "Connect Error - 6f" requester.log
then
sleep 100s
echo -e "\n try connect again!!! \n"
./spdm_responder_emu &
./../../build/bin/spdm_requester_emu >requester.log
if [ ! -f "$filename" ];
then
echo "Second Gen requester.log fail"
exit 1
fi
fi
minsize=1070000
if [ `stat -c%s "$filename"` -lt $minsize ] ||
! grep "libspdm_stop_session - (nil)" requester.log;
then
echo "requester run fail"
cat -n "$filename"
echo "requester.log size is `stat -c%s "$filename"`"
exit 1
fi
sleep 10s
echo "requester (DATA_SUPPORT = 1) <=> responder (DATA_SUPPORT = 0)"
./../../build/bin/spdm_responder_emu &
sleep 5s
./spdm_requester_emu >requester.log
filename=./requester.log
if [ ! -f "$filename" ];
then
echo "Gen requester.log fail"
exit 1
fi
if grep "Connect Error - 6f" requester.log
then
sleep 100s
echo -e "\n try connect again!!! \n"
./../../build/bin/spdm_responder_emu &
./spdm_requester_emu >requester.log
if [ ! -f "$filename" ];
then
echo "Second Gen requester.log fail"
exit 1
fi
fi
minsize=1070000
if [ `stat -c%s "$filename"` -lt $minsize ] ||
! grep "libspdm_stop_session - (nil)" requester.log;
then
echo "requester run fail"
cat -n "$filename"
echo "requester.log size is `stat -c%s "$filename"`"
exit 1
fi
VS2019_mbedtls_build:
runs-on: windows-latest
Expand All @@ -338,11 +178,14 @@ jobs:
run: |
cd build/bin
./spdm_responder_emu &
sleep 5s
./spdm_requester_emu
sleep 10s
- name: Responder_validator_Test
run: |
cd build/bin
./spdm_responder_emu &
sleep 5s
./spdm_device_validator_sample
VS2019_openssl_build:
Expand Down Expand Up @@ -370,9 +213,12 @@ jobs:
run: |
cd build/bin
./spdm_responder_emu &
sleep 5s
./spdm_requester_emu
sleep 10s
- name: Responder_validator_Test
run: |
cd build/bin
./spdm_responder_emu &
./spdm_device_validator_sample
sleep 5s
./spdm_device_validator_sample
Loading

0 comments on commit 3353670

Please sign in to comment.