mirror of
https://github.com/stefanberger/swtpm.git
synced 2025-12-29 00:15:17 +00:00
tests: Use regex to compare --print-states sizes output
Older versions of libtpms produced smaller initial state files. Therefore, use a regular expression to compare the sizes. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
76b58d7e09
commit
f756ee8a28
@ -101,7 +101,8 @@ if [ "${SWTPM_IFACE}" = socket ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exp='\{ "type": "swtpm", "states": \[ \{"name": "permall", "size": 1315\} \] \}'
|
||||
# sizes: libtpms v0.7: 1181 ; >= v0.8: 1315
|
||||
exp='^\{ "type": "swtpm", "states": \[ \{"name": "permall", "size": 1[0-9]{3}\} \] \}$'
|
||||
if ! [[ ${msg} =~ ${exp} ]]; then
|
||||
echo "Unexpected response from ${SWTPM_IFACE} TPM to --print-states:"
|
||||
echo "Actual : ${msg}"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user