1 | #!/usr/bin/env bash
|
---|
2 |
|
---|
3 | # For the license, see the LICENSE file in the root directory.
|
---|
4 |
|
---|
5 | ROOT=${abs_top_builddir:-$(pwd)/..}
|
---|
6 | TESTDIR=${abs_top_testdir:-$(dirname "$0")}
|
---|
7 | DIR=${PWD}
|
---|
8 |
|
---|
9 | WORKDIR=$(mktemp -d)
|
---|
10 |
|
---|
11 | . ${TESTDIR}/common
|
---|
12 |
|
---|
13 | function cleanup()
|
---|
14 | {
|
---|
15 | rm -rf ${WORKDIR}
|
---|
16 | }
|
---|
17 |
|
---|
18 | trap "cleanup" QUIT EXIT
|
---|
19 |
|
---|
20 | pushd $WORKDIR &>/dev/null
|
---|
21 |
|
---|
22 | ${DIR}/tpm2_createprimary
|
---|
23 | rc=$?
|
---|
24 |
|
---|
25 | fs=$(get_filesize NVChip)
|
---|
26 | [ $? -ne 0 ] && exit 1
|
---|
27 | if [ $fs -ne 176832 ]; then
|
---|
28 | echo "Error: Unexpected size of NVChip file."
|
---|
29 | echo "Expected: 131072"
|
---|
30 | echo "Got : $fs"
|
---|
31 | rc=1
|
---|
32 | fi
|
---|
33 |
|
---|
34 | popd &>/dev/null
|
---|
35 |
|
---|
36 | exit $rc
|
---|