From 92cccad89d1c12b39165d5f0ed7ccd2d44965a1a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 23:41:43 +0200 Subject: Adding upstream version 0.9.2. Signed-off-by: Daniel Baumann --- tests/tpm2_createprimary.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 tests/tpm2_createprimary.sh (limited to 'tests/tpm2_createprimary.sh') diff --git a/tests/tpm2_createprimary.sh b/tests/tpm2_createprimary.sh new file mode 100755 index 0000000..a95ce63 --- /dev/null +++ b/tests/tpm2_createprimary.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +# For the license, see the LICENSE file in the root directory. + +ROOT=${abs_top_builddir:-$(pwd)/..} +TESTDIR=${abs_top_testdir:-$(dirname "$0")} +DIR=${PWD} + +WORKDIR=$(mktemp -d) + +. ${TESTDIR}/common + +function cleanup() +{ + rm -rf ${WORKDIR} +} + +trap "cleanup" QUIT EXIT + +pushd $WORKDIR &>/dev/null + +${DIR}/tpm2_createprimary +rc=$? + +fs=$(get_filesize NVChip) +[ $? -ne 0 ] && exit 1 +if [ $fs -ne 176832 ]; then + echo "Error: Unexpected size of NVChip file." + echo "Expected: 131072" + echo "Got : $fs" + rc=1 +fi + +popd &>/dev/null + +exit $rc -- cgit v1.2.3