summaryrefslogtreecommitdiffstats
path: root/verifier_test.sh
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2013-04-10 20:32:17 +0200
committerDoug Zongker <dougz@android.com>2013-04-10 20:32:17 +0200
commitbac7fba02763ae5e78e8e4ba0bea727330ad953e (patch)
tree6056acf572fb45b4ff1ef2874b1d6373776a56c7 /verifier_test.sh
parentam b5bd4fb7: (-s ours) am 2f50df00: am c09444eb: am f91bd41c: am 1c302caf: (-s ours) am c14a7fbd: (-s ours) Reconcile with jb-mr1-release - do not merge (diff)
downloadandroid_bootable_recovery-bac7fba02763ae5e78e8e4ba0bea727330ad953e.tar
android_bootable_recovery-bac7fba02763ae5e78e8e4ba0bea727330ad953e.tar.gz
android_bootable_recovery-bac7fba02763ae5e78e8e4ba0bea727330ad953e.tar.bz2
android_bootable_recovery-bac7fba02763ae5e78e8e4ba0bea727330ad953e.tar.lz
android_bootable_recovery-bac7fba02763ae5e78e8e4ba0bea727330ad953e.tar.xz
android_bootable_recovery-bac7fba02763ae5e78e8e4ba0bea727330ad953e.tar.zst
android_bootable_recovery-bac7fba02763ae5e78e8e4ba0bea727330ad953e.zip
Diffstat (limited to '')
-rwxr-xr-xverifier_test.sh38
1 files changed, 22 insertions, 16 deletions
diff --git a/verifier_test.sh b/verifier_test.sh
index 378b0e5ff..65f77f401 100755
--- a/verifier_test.sh
+++ b/verifier_test.sh
@@ -64,33 +64,39 @@ $ADB push $ANDROID_PRODUCT_OUT/system/bin/verifier_test \
expect_succeed() {
testname "$1 (should succeed)"
$ADB push $DATA_DIR/$1 $WORK_DIR/package.zip
- run_command $WORK_DIR/verifier_test $WORK_DIR/package.zip || fail
+ shift
+ run_command $WORK_DIR/verifier_test "$@" $WORK_DIR/package.zip || fail
}
expect_fail() {
testname "$1 (should fail)"
$ADB push $DATA_DIR/$1 $WORK_DIR/package.zip
- run_command $WORK_DIR/verifier_test $WORK_DIR/package.zip && fail
-}
-
-expect_succeed_f4() {
- testname "$1 (should succeed)"
- $ADB push $DATA_DIR/$1 $WORK_DIR/package.zip
- run_command $WORK_DIR/verifier_test -f4 $WORK_DIR/package.zip || fail
-}
-
-expect_fail_f4() {
- testname "$1 (should fail)"
- $ADB push $DATA_DIR/$1 $WORK_DIR/package.zip
- run_command $WORK_DIR/verifier_test -f4 $WORK_DIR/package.zip && fail
+ shift
+ run_command $WORK_DIR/verifier_test "$@" $WORK_DIR/package.zip && fail
}
+# not signed at all
expect_fail unsigned.zip
+# signed in the pre-donut way
expect_fail jarsigned.zip
+
+# success cases
expect_succeed otasigned.zip
-expect_fail_f4 otasigned.zip
-expect_succeed_f4 otasigned_f4.zip
+expect_succeed otasigned_f4.zip -f4
+expect_succeed otasigned_sha256.zip -sha256
+expect_succeed otasigned_f4_sha256.zip -sha256 -f4
+
+# verified against different key
+expect_fail otasigned.zip -f4
expect_fail otasigned_f4.zip
+
+# verified against right key but wrong hash algorithm
+expect_fail otasigned.zip -sha256
+expect_fail otasigned_f4.zip -sha256 -f4
+expect_fail otasigned_sha256.zip
+expect_fail otasigned_f4_sha256.zip -f4
+
+# various other cases
expect_fail random.zip
expect_fail fake-eocd.zip
expect_fail alter-metadata.zip