diff options
author | Charles Baylis <charles.baylis@linaro.org> | 2016-09-06 13:01:21 +0100 |
---|---|---|
committer | Ryan Arnold <ryan.arnold@linaro.org> | 2016-10-14 18:19:45 +0000 |
commit | 5c65b858e7ba36db638fd3092fab8166d4121640 (patch) | |
tree | 4865874de96095d74238dfac5038ed79ff355e2f /testsuite | |
parent | 9c61d0af63687b4c6e997eb0059ab6f16a280bad (diff) |
Add *_md5sum field to manifests. (bug 1986)
This patch implements the following:
. Output the md5sum field in the manifest.
. If there is an md5sum in the manifest check that it matches the *.asc
file.
. Bump manifest version to 1.2.
. simple test cases for extract() to test md5sum checking
The additional md5sum checking is performed in extract(). This differs
from the validation of *.asc files which happens during fetch(). This
is to ensure that the md5sum is validated when the snapshots dir
already contains the tarball.
Change-Id: I5d8b69cab9f91aae5f446d1aa8166113263543a9
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/test.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/test.sh b/testsuite/test.sh index 9219215a..fc812515 100755 --- a/testsuite/test.sh +++ b/testsuite/test.sh @@ -406,6 +406,29 @@ fi mv ${local_snapshots}/gmp-6.1.0.tar.xz.back ${local_snapshots}/gmp-6.1.0.tar.xz +echo "============= extract() tests ================" + +# use correct md5sum +set_component_md5sum gmp a9868ef2556ad6a2909babcd1428f3c7 + +if extract gmp 2>/dev/null; then + pass "extract passed with valid md5sum" +else + fail "extract failed with valid md5sum" +fi + +# use incorrect md5sum +set_component_md5sum gmp aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +if extract gmp 2>/dev/null; then + fail "extract succeeded, but should have failed due to incorrect md5sum" +else + pass "extract failed as expected due to incorrect md5sum" +fi + +# unset md5sum so that the remainder of the testsuite is unaffected +set_component_md5sum gmp "" + # ---------------------------------------------------------------------------------- # # Test package building |