• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2set -e
3
4function 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
15function oem_lock_vts_tests() {
16    atest VtsHalOemLockV1_0TargetTest || return 1
17}
18
19function keymaster_cts_tests() {
20    return 0
21}
22
23function keymaster_vts_tests() {
24    return 0
25}
26
27function 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
34function weaver_vts_tests() {
35    atest VtsHalWeaverV1_0TargetTest || return 1
36}
37
38function auth_secret_vts_tests() {
39    atest VtsHalAuthSecretV1_0TargetTest || return 1
40}
41
42function 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
51if [ -z "${TARGET_PRODUCT:-}" ]; then
52  echo "You need to run the Android setup stuff first"
53  exit 1
54fi
55
56for 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
70done
71