aboutsummaryrefslogtreecommitdiffstats
path: root/verifier_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'verifier_test.sh')
-rwxr-xr-xverifier_test.sh23
1 files changed, 17 insertions, 6 deletions
diff --git a/verifier_test.sh b/verifier_test.sh
index 6350e80..378b0e5 100755
--- a/verifier_test.sh
+++ b/verifier_test.sh
@@ -1,11 +1,7 @@
#!/bin/bash
#
-# A test suite for applypatch. Run in a client where you have done
-# envsetup, choosecombo, etc.
-#
-# DO NOT RUN THIS ON A DEVICE YOU CARE ABOUT. It will mess up your
-# system partition.
-#
+# A test suite for recovery's package signature verifier. Run in a
+# client where you have done envsetup, lunch, etc.
#
# TODO: find some way to get this run regularly along with the rest of
# the tests.
@@ -77,9 +73,24 @@ expect_fail() {
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
+}
+
expect_fail unsigned.zip
expect_fail jarsigned.zip
expect_succeed otasigned.zip
+expect_fail_f4 otasigned.zip
+expect_succeed_f4 otasigned_f4.zip
+expect_fail otasigned_f4.zip
expect_fail random.zip
expect_fail fake-eocd.zip
expect_fail alter-metadata.zip