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