1 #!/bin/bash 2 set -e 3 4 function integration_tests() { 5 m -j citadel_integration_tests || return 1 6 adb shell stop || return 1 7 adb sync || return 1 8 adb shell start || return 1 9 adb exec-out \ 10 '/vendor/bin/hw/citadel_integration_tests --release-tests' || return 1 11 } 12 13 # TODO: add AVB / Weaver / Keymaster VTS / CTS tests with filters here. 14 15 function oem_lock_vts_tests() { 16 atest VtsHalOemLockV1_0TargetTest || return 1 17 } 18 19 function keymaster_cts_tests() { 20 return 0 21 } 22 23 function keymaster_vts_tests() { 24 return 0 25 } 26 27 function weaver_cts_tests() { 28 # These CTS tests make a lot of use of Weaver by enrolling and changing 29 # credentials. Add omre if you come across them. 30 atest com.android.cts.devicepolicy.ManagedProfileTest\#testLockNowWithKeyEviction || return 1 31 atest com.android.cts.devicepolicy.DeviceAdminHostSideTestApi24 || return 1 32 } 33 34 function weaver_vts_tests() { 35 atest VtsHalWeaverV1_0TargetTest || return 1 36 } 37 38 function auth_secret_vts_tests() { 39 atest VtsHalAuthSecretV1_0TargetTest || return 1 40 } 41 42 function pay_cts_tests() { 43 : 44 # TODO(ngm): uncomment once these are working. 45 # runtest --path \ 46 # cts/tests/tests/keystore/src/android/keystore/cts/ImportWrappedKeyTest.java || return 1 47 } 48 49 # TODO: add any other tests 50 51 if [ -z "${TARGET_PRODUCT:-}" ]; then 52 echo "You need to run the Android setup stuff first" 53 exit 1 54 fi 55 56 for t in integration_tests \ 57 oem_lock_vts_tests \ 58 keymaster_cts_tests \ 59 keymaster_vts_tests \ 60 weaver_cts_tests \ 61 weaver_vts_tests \ 62 auth_secret_vts_tests \ 63 pay_cts_tests; do 64 if eval "${t}"; then 65 echo "PASS: ${t}" 66 else 67 echo "FAIL: ${t}" 68 exit 1 69 fi 70 done 71