summaryrefslogtreecommitdiff
path: root/tests/futility/test_dump_fmap.sh
blob: e4d35d08b2dd66c908fd954abffce350d558d4ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash -eu
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

me=${0##*/}

if [ -e "$OLDDIR/dump_fmap" ] ; then
  echo old dump_fmap binary still exists 1>&2
  exit 1
fi

TMP="$OUTDIR/$me.tmp"

"$FUTILITY" dump_fmap -f "${SCRIPTDIR}/data_fmap.bin"  > "$TMP"
cmp "${SCRIPTDIR}/data_fmap_expect_f.txt" "$TMP"

"$FUTILITY" dump_fmap -p "${SCRIPTDIR}/data_fmap.bin"  > "$TMP"
cmp "${SCRIPTDIR}/data_fmap_expect_p.txt" "$TMP"

"$FUTILITY" dump_fmap -h "${SCRIPTDIR}/data_fmap.bin"  > "$TMP"
cmp "${SCRIPTDIR}/data_fmap_expect_h.txt" "$TMP"

# This should fail because the input file is truncated and doesn't really
# contain the stuff that the FMAP claims it does.
cd "$OUTDIR"  # TODO: we really need a directory argument for dump_fmap.
if "$FUTILITY" dump_fmap -x "${SCRIPTDIR}/data_fmap.bin" FMAP ; then
  echo Wait, that was supposed to fail. 1>&2
  exit 1
fi