From 8b7baafee194d83e9fdb29006f3d8e235d4e114b Mon Sep 17 00:00:00 2001 From: Gaurav Shah Date: Tue, 7 Sep 2010 18:19:21 -0700 Subject: [PATCH] Fix autotest Makefile for vboot_reference. Update list of scripts and test binaries - slightly more involved since the test runner scripts and the test binaries themselves reside in different directories. BUG=none TEST=manual (Ran make, went into the tests/ directory and ran the tests) Change-Id: I97bd36d806726f6005e35490173cfcd0300add95 Review URL: http://codereview.chromium.org/3326014 --- autotest/firmware_VbootCrypto/src/Makefile | 59 ++++++++++++++-------- tests/run_cgpt_tests.sh | 2 +- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/autotest/firmware_VbootCrypto/src/Makefile b/autotest/firmware_VbootCrypto/src/Makefile index ae0e3147b1..7c770a5004 100644 --- a/autotest/firmware_VbootCrypto/src/Makefile +++ b/autotest/firmware_VbootCrypto/src/Makefile @@ -2,51 +2,68 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -VBOOT_REFERENCE_DIR = ../../.. -BUILD_TEST_DIR = vboot_reference +VBOOT_SRC_DIR ?= ../../.. +BUILD_TEST_DIR = vboot_tests # Test Binaries. TEST_BINS = \ - common.sh \ - firmware_image_tests \ - firmware_rollback_tests \ - firmware_splicing_tests \ - firmware_verify_benchmark \ - gen_test_cases.sh \ - kernel_image_tests \ - kernel_rollback_tests \ - kernel_splicing_tests \ - kernel_verify_benchmark \ + cgptlib_test \ rsa_padding_test \ rsa_verify_benchmark \ - run_image_verification_tests.sh \ - run_rsa_tests.sh \ sha_benchmark \ sha_tests \ + vboot_common_tests \ + vboot_common2_tests \ + vboot_common3_tests +# Test Runner Scripts. +TEST_SCRIPTS = \ + common.sh \ + gen_test_cases.sh \ + gen_test_keys.sh \ + gen_test_vbpubks.sh \ + run_cgpt_tests.sh \ + run_rsa_tests.sh \ + run_vboot_common_tests.sh \ + run_vbutil_tests.sh \ testcases \ testkeys # Utility Binaries. -UTIL_BINS = verify_data signature_digest_utility +UTIL_BINS = \ + load_kernel_test \ + signature_digest_utility \ + vbutil_firmware \ + vbutil_kernel \ + vbutil_key \ + vbutil_keyblock \ + verify_data all: # Copy test sources into a temporary directory for building. rm -rf $(BUILD_TEST_DIR) - # only copy stuff that's not us + mkdir -p $(BUILD_TEST_DIR) + # Ignore autotest and build directory. sh -c \ - 'for dir in $(VBOOT_REFERENCE_DIR)/*; do \ - [ "$${dir}" != "$(VBOOT_REFERENCE_DIR)/autotest" ] && cp -r $${dir} .; \ + 'for dir in $(VBOOT_SRC_DIR)/*; do \ + [ "$${dir}" != "$(VBOOT_SRC_DIR)/build" ] && \ + [ "$${dir}" != "$(VBOOT_SRC_DIR)/autotest" ] && \ + cp -r "$${dir}" "$(BUILD_TEST_DIR)"; \ done' # Always build from scratch. $(MAKE) -C $(BUILD_TEST_DIR) clean all # Move test binaries for use by the tests. - mkdir -p tests + mkdir -p build/tests set -e; for i in $(TEST_BINS); do \ + mv $(BUILD_TEST_DIR)/build/tests/$$i build/tests/ ;\ + done + # Move test scripts for use by the tests. + mkdir -p tests + set -e; for i in $(TEST_SCRIPTS); do \ mv $(BUILD_TEST_DIR)/tests/$$i tests/ ;\ done # Move utility binaries used by the tests. - mkdir -p utility + mkdir -p build/utility set -e; for i in $(UTIL_BINS); do \ - mv $(BUILD_TEST_DIR)/utility/$$i utility/ ;\ + mv $(BUILD_TEST_DIR)/build/utility/$$i build/utility/ ;\ done # Delete sources. rm -rf $(BUILD_TEST_DIR) diff --git a/tests/run_cgpt_tests.sh b/tests/run_cgpt_tests.sh index 9171a8699d..577d7b1674 100755 --- a/tests/run_cgpt_tests.sh +++ b/tests/run_cgpt_tests.sh @@ -4,7 +4,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # -# Run tests for RSA Signature verification. +# Run tests for CGPT. # Load common constants and variables. . "$(dirname "$0")/common.sh"