libtpms/tests/common
Stefan Berger eb14174640 tests: Add simple test case reading PCRs and writing state file
Add a simple test case to make sure that reading the PCRs
works as expected and that the state file is written
as expected. This state file (NVChip) is only written because
libtpms doesn't have any callbacks registered.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-12-17 19:52:32 -05:00

14 lines
184 B
Plaintext

# Get the size of a file in bytes
#
# @1: filename
function get_filesize()
{
if [[ "$(uname -s)" =~ (Linux|CYGWIN_NT-) ]]; then
stat -c%s $1
else
# OpenBSD
stat -f%z $1
fi
}