Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion projects/libspdm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ RUN apt-get update && apt-get install -y make autoconf automake libtool
#RUN git config --global http.proxy http://proxy.example.com:80/
#RUN git config --global https.proxy https://proxy.example.com:80/
RUN git clone --depth 1 https://github.com/DMTF/libspdm.git libspdm && cd libspdm && git submodule update --init # or use other version control
COPY build.sh $SRC/
COPY run_tests.sh build.sh $SRC/
WORKDIR $SRC/libspdm
24 changes: 19 additions & 5 deletions projects/libspdm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,24 @@
################################################################################

# build project
cd $SRC/libspdm
mkdir build
cd build
pushd build
cmake -DARCH=x64 -DTOOLCHAIN=LIBFUZZER -DTARGET=Release -DCRYPTO=mbedtls -DGCOV=ON ..
make copy_sample_key
make
cp -r ./bin/* $OUT
make copy_sample_key -j$(nproc)
make -j$(nproc)
cp -r ./bin/* $OUT
popd

# build unit testing that requires different TOOLCHAIN
# Unset CFLAGS that incompatible with unit testing build
unset CFLAGS
mkdir build-test
pushd build-test
cmake -DARCH=x64 -DTOOLCHAIN="CLANG" -DTARGET=Release -DCRYPTO=mbedtls ..
make -j$(nproc)
popd

# Prepare sample key and unit testing binary
mkdir $SRC/unit_testing
cp -r $SRC/libspdm/unit_test/sample_key/* $SRC/unit_testing/
cp $SRC/libspdm/build-test/bin/* $SRC/unit_testing/
27 changes: 27 additions & 0 deletions projects/libspdm/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash -eu
#
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

cd $SRC/unit_testing

# Run all unit testing (excluding failing one
./test_crypt && ./test_spdm_common && ./test_spdm_crypt && \
./test_spdm_requester && ./test_spdm_responder && ./test_spdm_secured_message

# Failing unit testing for reference
# ./test_spdm_fips && ./test_spdm_sample

Loading