diff options
Diffstat (limited to 'tests/futility')
-rw-r--r-- | tests/futility/data/bdb.bin | bin | 3716 -> 0 bytes | |||
-rwxr-xr-x | tests/futility/run_test_scripts.sh | 1 | ||||
-rwxr-xr-x | tests/futility/test_bdb.sh | 100 | ||||
-rw-r--r-- | tests/futility/test_file_types.c | 1 | ||||
-rwxr-xr-x | tests/futility/test_file_types.sh | 1 |
5 files changed, 0 insertions, 103 deletions
diff --git a/tests/futility/data/bdb.bin b/tests/futility/data/bdb.bin Binary files differdeleted file mode 100644 index 1fe84463..00000000 --- a/tests/futility/data/bdb.bin +++ /dev/null diff --git a/tests/futility/run_test_scripts.sh b/tests/futility/run_test_scripts.sh index 7171b483..8ccbab6e 100755 --- a/tests/futility/run_test_scripts.sh +++ b/tests/futility/run_test_scripts.sh @@ -40,7 +40,6 @@ export OUTDIR # These are the scripts to run. Binaries are invoked directly by the Makefile. TESTS=" -${SCRIPTDIR}/test_bdb.sh ${SCRIPTDIR}/test_create.sh ${SCRIPTDIR}/test_dump_fmap.sh ${SCRIPTDIR}/test_gbb_utility.sh diff --git a/tests/futility/test_bdb.sh b/tests/futility/test_bdb.sh deleted file mode 100755 index 0f0c0249..00000000 --- a/tests/futility/test_bdb.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash -eux -# Copyright 2015 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##*/} -TMP="$me.tmp" - -# Work in scratch directory -cd "$OUTDIR" -BDB_FILE=bdb.bin - -TESTKEY_DIR=${SRCDIR}/tests/testkeys -TESTDATA_DIR=${SRCDIR}/tests/testdata - -BDBKEY_PUB=${TESTKEY_DIR}/bdbkey.keyb -BDBKEY_PRI=${TESTKEY_DIR}/bdbkey.pem -DATAKEY_PUB=${TESTKEY_DIR}/datakey.keyb -DATAKEY_PRI=${TESTKEY_DIR}/datakey.pem -BDBKEY_DIGEST=${TESTDATA_DIR}/bdbkey_digest.bin -DATAKEY_DIGEST=${TESTDATA_DIR}/datakey_digest.bin -DATA_FILE=${TESTDATA_DIR}/sp-rw.bin - -declare -i num_hash - -# Verify a BDB -# -# $1: Key digest file -# $2: Any remaining option passed to futility bdb --verify -verify() { - local key_digest=${1:-${BDBKEY_DIGEST}} - local extra_option=${2:-} - ${FUTILITY} bdb --verify ${BDB_FILE} --key_digest ${key_digest} \ - ${extra_option} -} - -get_num_hash() { - printf "%d" \ - $(${FUTILITY} show ${BDB_FILE} \ - | grep '# of Hashes' | cut -d':' -f 2) -} - -# Tests field matches a specified value in a BDB -# e.g. check_field 'Data Version:' 2 returns error if the data version isn't 2. -check_field() { - # Find the field - x=$(${FUTILITY} show ${BDB_FILE} | grep "${1}") - [ "${x}" ] || return 1 - # Remove the field name - x=${x##*:} - [ "${x}" ] || return 1 - # Remove the leading and trailing spaces - x=${x//[[:blank:]]/} - [ "${x}" == "${2}" ] || return 1 -} - -# Demonstrate bdb --create can create a valid BDB -load_address=0x60061ec0de -${FUTILITY} bdb --create ${BDB_FILE} \ - --bdbkey_pri ${BDBKEY_PRI} --bdbkey_pub ${BDBKEY_PUB} \ - --datakey_pub ${DATAKEY_PUB} --datakey_pri ${DATAKEY_PRI} \ - --load_address ${load_address} -verify -check_field "Load Address:" ${load_address} - -# Demonstrate bdb --add can add a new hash -num_hash=$(get_num_hash) -${FUTILITY} bdb --add ${BDB_FILE} \ - --data ${DATA_FILE} --partition 1 --type 2 --offset 3 --load_address 4 -# Use futility show command to verify the hash is added -num_hash+=1 -[ $(get_num_hash) -eq $num_hash ] -# TODO: verify partition, type, offset, and load_address - -# Demonstrate futility bdb --resign can resign the BDB -data_version=2 -${FUTILITY} bdb --resign ${BDB_FILE} --datakey_pri ${DATAKEY_PRI} \ - --data_version $data_version -verify -check_field "Data Version:" $data_version - -# Demonstrate futility bdb --resign can resign with a new data key -# Note resigning with a new data key requires a private BDB key as well -${FUTILITY} bdb --resign ${BDB_FILE} \ - --bdbkey_pri ${BDBKEY_PRI} \ - --datakey_pri ${BDBKEY_PRI} --datakey_pub ${BDBKEY_PUB} -verify - -# Demonstrate futility bdb --resign can resign with a new BDB key -${FUTILITY} bdb --resign ${BDB_FILE} \ - --bdbkey_pri ${DATAKEY_PRI} --bdbkey_pub ${DATAKEY_PUB} -verify ${DATAKEY_DIGEST} - -# Demonstrate futility bdb --verify can return success when key digest doesn't -# match but --ignore_key_digest is specified. -verify ${BDBKEY_DIGEST} --ignore_key_digest - -# cleanup -rm -rf ${TMP}* -exit 0 diff --git a/tests/futility/test_file_types.c b/tests/futility/test_file_types.c index c77802bd..9999223d 100644 --- a/tests/futility/test_file_types.c +++ b/tests/futility/test_file_types.c @@ -37,7 +37,6 @@ static struct { {FILE_TYPE_VB2_PRIVKEY, "tests/futility/data/sample.vbprik2"}, {FILE_TYPE_PEM, "tests/testkeys/key_rsa2048.pem"}, {FILE_TYPE_USBPD1, "tests/futility/data/zinger_mp_image.bin"}, - {FILE_TYPE_BDB, "tests/futility/data/bdb.bin"}, {FILE_TYPE_RWSIG, }, /* need a test for this */ }; BUILD_ASSERT(ARRAY_SIZE(test_case) == NUM_FILE_TYPES); diff --git a/tests/futility/test_file_types.sh b/tests/futility/test_file_types.sh index b0248a94..4b7a9fb6 100755 --- a/tests/futility/test_file_types.sh +++ b/tests/futility/test_file_types.sh @@ -44,7 +44,6 @@ test_case "pubkey21" "tests/futility/data/sample.vbpubk2" test_case "prikey21" "tests/futility/data/sample.vbprik2" test_case "pem" "tests/testkeys/key_rsa2048.pem" test_case "pem" "tests/testkeys/key_rsa8192.pub.pem" -test_case "bdb" "tests/futility/data/bdb.bin" # Expect failure here. fail_case "/Sir/Not/Appearing/In/This/Film" |