blob: 16eab17451d1743b8c6a53d21229aeb2a399753d [file] [log] [blame]
Manish V Badarkheb87f37b2021-11-10 18:53:05 +00001#
2# Copyright (c) 2021, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6# Expect script for Linux/Buildroot using Measured Boot & fTPM
7# It is a copy of linux-tpm.exp which doesn't check PCR0 value,
8# as that doesn't apply to this config
9#
10
11# Parse the event log from the debug logs and store the digests
12# so they can be matched later with what the fTPM read.
13expect_string+=('m;Booting Trusted Firmware;Booting BL31;Digest(\s|\w)*:\s(\w{2}\s){16}@: (\w{2}\s){16}@Event(\s|\w)*:\s\w+\s')
14
15# Wait for the login prompt
16expect_string+=("i;buildroot login:")
17
18# Login then load the fTPM driver
19# Note: Do not check sanity of PCR0
20expect_string+=("i;#;;;root")
21expect_string+=("i;;;;ftpm")
22
23# Iterate over the rest of PCRs and check that they all are zeros.
24zero_pcr="(\s00){16}\s+(00\s){16}"
25for i in $(seq 1 11); do
26 expect_string+=("i;#")
27 expect_string+=("i;${zero_pcr};;;pcrread -ha $i")
28done