mirror of
https://github.com/stefanberger/libtpms
synced 2025-08-26 04:33:40 +00:00

Wrap the fuzzer test in a script to we can set up a per fuzzer temporary directory where the NvChip file is written into. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
35 lines
587 B
Bash
Executable File
35 lines
587 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# For the license, see the LICENSE file in the root directory.
|
|
|
|
DIR=${PWD}/$(dirname "$0")
|
|
ROOT=${DIR}/..
|
|
WORKDIR=$(mktemp -d)
|
|
export LD_LIBRARY_PATH=${ROOT}/src/.libs
|
|
|
|
if ! [ -d ${LD_LIBRARY_PATH} ]; then
|
|
echo "Wrong path to libtpms library: ${LD_LIBRARY_PATH}"
|
|
exit 1
|
|
fi
|
|
|
|
if ! [ -f "$(readlink -f ${LD_LIBRARY_PATH}/libtpms.so)" ]; then
|
|
echo "Cannot find libtpms at ${LD_LIBRARY_PATH}/libtpms.so"
|
|
exit 1
|
|
fi
|
|
|
|
function cleanup()
|
|
{
|
|
rm -rf ${WORKDIR}
|
|
}
|
|
|
|
trap "cleanup" QUIT EXIT
|
|
|
|
pushd $WORKDIR
|
|
|
|
${DIR}/fuzz $@ ${DIR}/corpus-execute-command
|
|
rc=$?
|
|
|
|
popd
|
|
|
|
exit $rc
|