Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: src/platform/vboot_reference/tests/run_rsa_tests.sh

Issue 596080: VBoot Reference: Make RSA verification test script return the right error code. (Closed)
Patch Set: Remove debug comment. Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/vboot_reference/tests/run_rsa_tests.sh
diff --git a/src/platform/vboot_reference/tests/run_tests.sh b/src/platform/vboot_reference/tests/run_rsa_tests.sh
similarity index 81%
rename from src/platform/vboot_reference/tests/run_tests.sh
rename to src/platform/vboot_reference/tests/run_rsa_tests.sh
index f728dd07219692449e5ecc0167037b9ed71dcd2b..3abadb6b0734b7514fe7991a8e65841a2b7c69df 100755
--- a/src/platform/vboot_reference/tests/run_tests.sh
+++ b/src/platform/vboot_reference/tests/run_rsa_tests.sh
@@ -7,12 +7,11 @@
# Run tests for cryptographic routine implementations - Message digests
# and RSA Signature verification.
+return_code=0
hash_algos=( sha1 sha256 sha512 )
key_lengths=( 1024 2048 4096 8192 )
TEST_FILE=test_file
TEST_FILE_SIZE=1000000
-UTIL_DIR=../utils/
-KEY_DIR=testkeys
# Generate public key signatures on an input file for various combinations
# of message digest algorithms and RSA key sizes.
@@ -40,6 +39,10 @@ function test_signatures {
${UTIL_DIR}/verify_data $algorithmcounter \
${KEY_DIR}/key_rsa${keylen}.keyb \
${TEST_FILE}.rsa${keylen}_${hashalgo}.sig ${TEST_FILE}
+ if [ $? -ne 0 ]
+ then
+ return_code=255
+ fi
let algorithmcounter=algorithmcounter+1
done
done
@@ -57,16 +60,29 @@ function cleanup {
rm ${TEST_FILE} ${TEST_FILE}.*.sig
}
-echo "Testing message digests..."
-./sha_tests
+# Determine script directory.
+if [[ $0 == '/'* ]];
+then
+ SCRIPT_DIR="`dirname $0`"
+elif [[ $0 == './'* ]];
+then
+ SCRIPT_DIR="`pwd`"
+else
+ SCRIPT_DIR="`pwd`"/"`dirname $0`"
+fi
+UTIL_DIR=`dirname ${SCRIPT_DIR}`/utils
+KEY_DIR=${SCRIPT_DIR}/testkeys
+
+echo "Generating test cases..."
+pre_work
echo
echo "Testing signature verification..."
-pre_work
test_signatures
echo
echo "Cleaning up..."
cleanup
+exit $return_code
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698