summaryrefslogtreecommitdiff
path: root/tests/common.sh
Commit message (Collapse)AuthorAgeFilesLines
* Makefile: Fix and simplify the RUNTEST test wrapperEvan Benn2022-10-251-7/+6
| | | | | | | | | | | | | | | | | | | | | Remove the qemu logic from the Makefile. Document the RUNTEST, BUILD_RUN and SRC_RUN variables. Ensure those variables are used consistently throughout the Makefile and test scripts. BUG=b:231084609 BRANCH=None TEST=FEATURES=test emerge vboot_reference TEST=FEATURES=test emerge-amd64-generic vboot_reference TEST=FEATURES=test emerge-hatch coreboot TEST=(coreboot upstream with this patch) make all TEST=make BUILD=build1 runtests TEST=make BUILD=build2 RUNTEST=env runtests Cq-Depend: chromium:3934904 Change-Id: Ifd18463d681bedbf7464165f2df0181474b36791 Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3831828 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* treewide: Fix copyrights and extra new lines at end of fileJakub Czapiga2022-10-211-1/+1
| | | | | | | | | | | | | BUG=none BRANCH=none TEST=make runtests Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Change-Id: If93a65ba58c4973d4b344229c7ee26685395bbbf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3964274 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Jakub Czapiga <czapiga@google.com> Tested-by: Jakub Czapiga <czapiga@google.com>
* tests: Fix most of errors reported by shellcheckJakub Czapiga2022-06-231-6/+6
| | | | | | | | | | | | BUG=none BRANCH=none TEST=make runtests Signed-off-by: Jakub Czapiga <czapiga@google.com> Change-Id: I364ac6ace35705f1cfdaec71297523d4c2132b75 Disallow-Recycled-Builds: test-failures Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3695417 Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: unify common.sh for testing scriptsstabilize-12881.BJoel Kitching2020-02-031-8/+8
| | | | | | | | | | | | | | | | Use tests/common.sh instead of tests/futility/common.sh. Correct SCRIPT_DIR value to allow running run_test_scripts.sh standalone without using Makefile. BUG=b:124141368, chromium:605348 TEST=make clean && make runfutiltests BRANCH=none Change-Id: I107952826ea9a3a3816d9c13206aa48bee63ac6c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2014236 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: get rid of MINIMAL in MakefileJoel Kitching2020-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Clean up install paths. The ebuild was adding /usr in the MINIMAL=1 case, making it look virtually exactly the same as the non-MINIMAL case. Just unify the two. - Introduce SDK_BUILD variable to take over part of the functionality previously implemented by MINIMAL. - One may now use rununittests for quick test runs instead of setting MINIMAL=1. - runtestscripts is added to the default test set under "runtests". runfutiltests is not yet enabled due to flakiness (see chromium:1048048). - Remove unused LZMA_LIBS and YAML_LIBS. - Stop installing dev-mode-only scripts into /usr/bin for an SDK build (VB_DIR). Presumably this was meant for board builds, but since everyone is used to these scripts living in /usr/share/vboot/bin, we may as well keep them there. - Stop installing crossystem for an SDK build. - Group SIGNING_SCRIPTS into UTIL_SCRIPTS_BOARD. - Have install_for_test depend on test_setup instead of vice versa. Targets which run tests should depend on install_for_test. BUG=b:124141368, chromium:605348, chromium:1048048 TEST=make clean && make runtests TEST=make clean && make rununittests TEST=sudo emerge vboot_reference, check installed files TEST=emerge-eve vboot_reference, check installed files TEST=USE=fuzzer emerge-eve vboot_reference TEST=FEATURES=test USE=fuzzer emerge-eve vboot_reference BRANCH=none Change-Id: I203e69143e40ee42729488bf0ab59f5120649bd1 Cq-Depend: chromium:2012183 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2012182 Reviewed-by: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* tests/vb2_firmware_tests: Improve workbuffer usage testJulius Werner2020-01-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | | This patch changes vb2_firmware_tests to run multiple times with different combinations of signature and hash algorithms. The goal is to have more confidence that our recommended work buffer size is still big enough even if we changed algorithm combinations in an RW update. It also changes the underlying vb20_verify_fw to not just print the amount of work buffer used at the end, but to detect the actual high water mark of work buffer used during the test. Also add some fallback definitions for undefined environment variables to tests/common.sh which helps running individual test scripts without the Makefile harness. BRANCH=None BUG=None TEST=make runtests Change-Id: I14519cd7c76a9886bd11ebf5312458ab658e6f75 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1967976 Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot_reference: Add support for 3072-bit exponent 3 keysNicolas Boichat2017-03-161-1/+1
| | | | | | | | | | | | | | | | This also adds the required tests (keys, testcases), and some additional tests in vb2_rsa_utility_tests.c that were not added when 2048-bit exponent 3 support was added. BRANCH=none BUG=chromium:684354 TEST=make runtests Change-Id: I56d22302c2254ef500b9d2d290a79d8c8bc39942 Reviewed-on: https://chromium-review.googlesource.com/449060 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* vboot_reference: Add support for 2048-bit exponent 3 keysstabilize-9313.Bfirmware-cr50-release-9308.25.Bfirmware-cr50-mp-release-9308.87.Bfirmware-cr50-mp-r86-9311.70.Bfirmware-cr50-mp-9311.Bfirmware-cr50-guc-factory-9308.26.Bfirmware-cr50-9308.Bfirmware-cr50-9308.24.BNicolas Boichat2017-02-181-1/+1
| | | | | | | | | | | | | | This also adds the required tests (keys, testcases). BRANCH=none BUG=chromium:684354 TEST=make runtests Change-Id: I5e148f8792ea325f813d76089271f3c4bcc2935d Reviewed-on: https://chromium-review.googlesource.com/438951 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cleanup: DESTDIR refers to the install root, not the bin/Bill Richardson2014-09-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This doesn't have any visible effect. It just brings the meaning of the where-do-I-put-this variable more in line with common convention. BRANCH=ToT BUG=none CQ-DEPEND=CL:217940 TEST=lots... make runtests make DESTDIR=BAR install make MINIMAL=1 DESTDIR=FOO install emerge-$BOARD vboot_reference sudo emerge vboot_reference trybots: link-tot-paladin, daisy_spring-paladin Change-Id: I8d72664da07535f663d8b2f13c872eece37978b9 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/217930 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* futility: stop using the symlink names in utility scriptsBill Richardson2014-09-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | We still create the symlinks (FOO -> futility), but this change invokes those built-in functions with "futility FOO ..." instead of using the FOO symlink. Note that the scripts/ directory is unchanged. That's a separate CL, since we don't have tests for that. BUG=chromium:231547 BRANCH=ToT TEST=make runtests In addition to running "make runtests", I temporarily modified the Makefile to avoid creating the symlinks at all. The tests still passed. Change-Id: I96863259b9df02a3611f759a7509bf4090ae03e8 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/216717 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Install and use futility when running testsBill Richardson2014-07-171-1/+1
| | | | | | | | | | | | | | As we build features into futility, the standalone executables disappear. Tests that invoke those executables will need to invoke futility instead. BUG=chromium:224734 BRANCH=ToT TEST=make runtests Signed-off-by: Bill Richardson <wfrichar@chromium.org> Change-Id: I75230f6901aab8d978fa5d12505c243e1c90c938 Reviewed-on: https://chromium-review.googlesource.com/207926 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Remove +x permissions from source files.Bill Richardson2013-02-051-0/+0
| | | | | | | | | | | | | | | | There's no need to give execute permissions to files that aren't supposed to executed. BUG=none BRANCH=none TEST=manual make runtests Change-Id: I2480b97b39124e98c2f639d56be54cadfdc17f9b Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42648 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Run some tests under qemu when cross-compilingRandall Spangler2013-01-161-2/+2
| | | | | | | | | | | | | | | BUG=chromium-os:26317 BRANCH=none TEST=manual sudo FEATURES=test emerge vboot_reference FEATURES=test emerge-link vboot_reference chromeos-u-boot chromeos-installer FEATURES=test emerge-daisy vboot_reference chromeos-u-boot chromeos-installer make && make runtests (both inside and outside chroot) Change-Id: Ie829e375736ce0df46ddd5a3345efb0ca7e33aba Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/41317
* Add 'prioritize' command to cgpt tool.Bill Richardson2010-11-291-3/+21
| | | | | | | | | | | | | | | | | | | | | | This lets us reorder the priority of all the kernel partitions with a single command, instead of a bunch of complicated and error-prone shell script logic. Change-Id: I21d39763ec5a748488d5319a987bcfe7c34ce4d0 BUG=chromium-os:9167 TEST=manual In the chroot, do this: cd ~/trunk/src/platform/vboot_reference make make runtests make clean Everything should pass. Review URL: http://codereview.chromium.org/5352005
* Run the cgpt tests in a separate directory.Bill Richardson2010-08-201-9/+1
| | | | | | | | | I'm getting ready to add a bunch more cgpt tests. This is just to clear the way. Change-Id: I5cb781e85938b94da9c59528872ddfd386712726 Review URL: http://codereview.chromium.org/3162023
* Rework the vboot_reference make system.vbendeb2010-06-141-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After this change the generated files are placed in a separate tree (such thet they don't show in the `git status' output anymore) and the dependencies are followed properly (if a .h file changes the appropriate .o files and apps get rebuilt). Tested as follows: > $ make clean > $ make # build succeeds > $ git status # shows clean directory > $ RUNTESTS=1 make # (captured test output matches that of the test run before any changes) > $ touch ./vboot_firmware/include/tlcl.h > $ make # make succeeds > $ find build -type f -newer ./vboot_firmware/include/tlcl.h build/vboot_firmware/lib/rollback_index.o build/vboot_firmware/lib/rollback_index.o.d build/vboot_firmware/a.out build/vboot_fw.a build/utility/vbutil_key build/utility/kernel_utility.d build/utility/vbutil_key.d build/utility/verify_data build/utility/load_kernel_test.d build/utility/vbutil_keyblock.d build/utility/vbutil_kernel build/utility/vbutil_kernel.d build/utility/firmware_utility build/utility/signature_digest_utility.d build/utility/kernel_utility build/utility/verify_data.d build/utility/vbutil_keyblock build/utility/signature_digest_utility build/utility/load_kernel_test build/utility/firmware_utility.d build/tests/vboot_common3_tests build/tests/vboot_common2_tests build/host/a.out $ > Review URL: http://codereview.chromium.org/2845001
* Nearly complete rewrite of cgpt tool.Bill Richardson2010-06-111-5/+16
| | | | | | | | | This fixes a number of bugs, adds a bunch of commands, and essentially makes cgpt ready to use as a replacement for gpt. Still to do is to add commands and options that will let it generated intentionally bad partitions, for use in testing. Review URL: http://codereview.chromium.org/2719008
* VBoot Reference: Refactoring Part 3Gaurav Shah2010-03-311-1/+1
| | | | | | | | | | | | | | | | | | | Refactor and restructure reference code into individual self-contain modules. I have revamped the way the code is structured to make it easy to determine which parts belong in the firmware and which are used by userland tools. common/ - common utilities and stub functions (Firmware) cryptolib/ - crypto library (Firmware) misclibs/ - miscellaneous userland libraries (Userland) sctips/ - Miscellaenous scripts (Userland) tests/ - Tests (Userland) vfirmware/ - Verified Firmware Implementation vfirmware/firmware_image_fw.c (Firmware) vfirmware/firmware_image.c (Userland) vkernel/ - Verified Kernel Implementation vkernel/kernel_image_fw.c (Firmware) vkernel/kernel_image.c (Userland) Review URL: http://codereview.chromium.org/1581005
* Vboot Reference: Spring cleaning of test scripts.Gaurav Shah2010-03-191-0/+39
Moved duplicated code to "common.sh". Make directory detection more robust. Review URL: http://codereview.chromium.org/1101004