For the boards already have DB directories, remove the default DB.

The default DB is an all-pass DB. If no DB found, the hardware_Components test
falls back to the all-pass one and skip the real check. In order to prevent
skipping the check, remove the default DB in the boards already have DB
directories.

TEST=run "image_to_usb.sh --factory" and check the default DB removed
BUG=chrome-os-partner:1737

Change-Id: Ia25f2551a5eba3a95fe736e86bfe52c340f329a8

Review URL: http://codereview.chromium.org/5339011
This commit is contained in:
Tom Wai-Hong Tam 2010-11-30 11:22:50 +08:00
parent 53698c3865
commit fb5ce169ee

View File

@ -13,10 +13,14 @@ if [ -d "${TEST_DIR}" ]; then
KEEPDB="data_${BOARD}"
ls -d data_* 2>/dev/null | grep -v "${KEEPDB}" | xargs rm -fr
# Ensure there is DB directory in x86-agz and x86-mario.
if [ ! -d "${KEEPDB}" ] &&
[ "${BOARD}" = "x86-agz" -o "${BOARD}" = "x86-mario" ]; then
echo "No component DB directory found at: ${KEEPDB}"
if [ "${BOARD}" = "x86-agz" -o "${BOARD}" = "x86-mario" ]; then
# Ensure there is a DB directory in x86-agz or x86-mario.
if [ ! -d "${KEEPDB}" ]; then
echo "No component DB directory found at: ${KEEPDB}"
fi
# Remove the default DB since it is unnecessary.
DEFAULTDB="approved_components.default"
rm -f "${DEFAULTDB}"
fi
popd >/dev/null