flatcar-scripts/mod_for_factory_scripts/500populateQualDbs
Tom Wai-Hong Tam fb5ce169ee 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
2010-11-30 11:22:50 +08:00

28 lines
848 B
Bash
Executable File

#!/bin/bash
# Copyright (c) 2010 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.
TEST_DIR="${ROOT_FS_DIR}/usr/local/autotest/site_tests/hardware_Components"
if [ -d "${TEST_DIR}" ]; then
pushd "${TEST_DIR}" >/dev/null
# Remove the DB directories belonging to other boards.
KEEPDB="data_${BOARD}"
ls -d data_* 2>/dev/null | grep -v "${KEEPDB}" | xargs rm -fr
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
fi