xref: /aosp_15_r20/external/vboot_reference/tests/futility/test_read.sh (revision 8617a60d3594060b7ecbd21bc622a7c14f3cf2bc)
1*8617a60dSAndroid Build Coastguard Worker#!/usr/bin/env bash
2*8617a60dSAndroid Build Coastguard Worker# Copyright 2022 The ChromiumOS Authors
3*8617a60dSAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be
4*8617a60dSAndroid Build Coastguard Worker# found in the LICENSE file.
5*8617a60dSAndroid Build Coastguard Worker
6*8617a60dSAndroid Build Coastguard Workerset -eux
7*8617a60dSAndroid Build Coastguard Worker
8*8617a60dSAndroid Build Coastguard Workerme=${0##*/}
9*8617a60dSAndroid Build Coastguard WorkerTMP="${me}.tmp"
10*8617a60dSAndroid Build Coastguard Worker
11*8617a60dSAndroid Build Coastguard Worker# Work in scratch directory
12*8617a60dSAndroid Build Coastguard Workercd "${OUTDIR}"
13*8617a60dSAndroid Build Coastguard Worker
14*8617a60dSAndroid Build Coastguard WorkerPEPPY_BIOS="${SCRIPT_DIR}/futility/data/bios_peppy_mp.bin"
15*8617a60dSAndroid Build Coastguard Worker
16*8617a60dSAndroid Build Coastguard Worker"${FUTILITY}" read --emulate="${PEPPY_BIOS}" "${TMP}"
17*8617a60dSAndroid Build Coastguard Workercmp "${PEPPY_BIOS}" "${TMP}"
18*8617a60dSAndroid Build Coastguard Worker
19*8617a60dSAndroid Build Coastguard Worker"${FUTILITY}" read --emulate="${PEPPY_BIOS}" --region="GBB,RO_VPD" "${TMP}"
20*8617a60dSAndroid Build Coastguard Worker! cmp --silent "${PEPPY_BIOS}" "${TMP}_GBB"
21*8617a60dSAndroid Build Coastguard Worker! cmp --silent "${PEPPY_BIOS}" "${TMP}_RO_VPD"
22*8617a60dSAndroid Build Coastguard Worker
23*8617a60dSAndroid Build Coastguard Worker# cleanup
24*8617a60dSAndroid Build Coastguard Workerrm -f "${TMP}"*
25*8617a60dSAndroid Build Coastguard Workerexit 0
26