summaryrefslogtreecommitdiff
path: root/tests/futility/test_dump_fmap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/futility/test_dump_fmap.sh')
-rwxr-xr-xtests/futility/test_dump_fmap.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/futility/test_dump_fmap.sh b/tests/futility/test_dump_fmap.sh
new file mode 100755
index 00000000..e4d35d08
--- /dev/null
+++ b/tests/futility/test_dump_fmap.sh
@@ -0,0 +1,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