From 4e5dffc08a2ff26742921c1f5af3d6836bd3d1cf Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Tue, 12 Jul 2022 09:45:49 -0400 Subject: [PATCH] tests: Fix outdated output of expected file size in case of error Signed-off-by: Stefan Berger --- tests/tpm2_createprimary.sh | 5 +++-- tests/tpm2_pcr_read.sh | 5 +++-- tests/tpm2_selftest.sh | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/tpm2_createprimary.sh b/tests/tpm2_createprimary.sh index a95ce63a..029a9091 100755 --- a/tests/tpm2_createprimary.sh +++ b/tests/tpm2_createprimary.sh @@ -24,9 +24,10 @@ rc=$? fs=$(get_filesize NVChip) [ $? -ne 0 ] && exit 1 -if [ $fs -ne 176832 ]; then +exp=176832 +if [ $fs -ne $exp ]; then echo "Error: Unexpected size of NVChip file." - echo "Expected: 131072" + echo "Expected: $exp" echo "Got : $fs" rc=1 fi diff --git a/tests/tpm2_pcr_read.sh b/tests/tpm2_pcr_read.sh index f2dbe6e3..a584a1be 100755 --- a/tests/tpm2_pcr_read.sh +++ b/tests/tpm2_pcr_read.sh @@ -24,9 +24,10 @@ rc=$? fs=$(get_filesize NVChip) [ $? -ne 0 ] && exit 1 -if [ $fs -ne 176832 ]; then +exp=176832 +if [ $fs -ne $exp ]; then echo "Error: Unexpected size of NVChip file." - echo "Expected: 131072" + echo "Expected: $exp" echo "Got : $fs" rc=1 fi diff --git a/tests/tpm2_selftest.sh b/tests/tpm2_selftest.sh index c06d7655..98e710fe 100755 --- a/tests/tpm2_selftest.sh +++ b/tests/tpm2_selftest.sh @@ -24,9 +24,10 @@ rc=$? fs=$(get_filesize NVChip) [ $? -ne 0 ] && exit 1 -if [ $fs -ne 176832 ]; then +exp=176832 +if [ $fs -ne $exp ]; then echo "Error: Unexpected size of NVChip file." - echo "Expected: 131072" + echo "Expected: $exp" echo "Got : $fs" rc=1 fi