我问有关 Android VTS 的问题。
我目前正在使用 ubuntu 18.04,目标设备正在使用 AVD。首先,我设置的环境如下。
$ sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig
$ mkdir android && cd android
$ repo init -u https://android.googlesource.com/platform/manifest -b android-11.0.0_r28
$ repo sync -c -j $(($(nproc) - 2)) --no-tags --no-clone-bundle
$ repo start android-11.0.0_r28 --all
$ . build/envsetup.sh
$ lunch sdk_phone_x86_64-userdebug
$ m
我已经成功构建并确认模拟器运行良好。
$ emulator -no-window -writable-system
$ adb root remount
$ adb device
List of devices attached
emulator-5554 device
之后,我构建了以下 vts 来分析 Android keymaster 的行为。
$ cd hardware\interfaces\keymaster\3.0\vts\functional
$ mm
成功构建模块后,我运行模拟器并按如下方式推送二进制文件。
$ emulator -no-window -writable-system
$ adb root remount
$ adb push out\soong\.intermediates\hardware\interfaces\keymaster\3.0\vts\functional\VtsHalKeymasterV3_0TargetTest\android_x86_64\VtsHalKeymasterV3_0TargetTest /data/tmp
我成功地完成了上述操作,并且运行了二进制文件,它看起来像这样:
$ adb shell /data/tmp/VtsHalKeymasterV3_0TargetTest
[==========] Running 12 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 12 tests from GoogleTestVerification
[ RUN ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<KeymasterVersionTest>
Paramaterized test suite KeymasterVersionTest is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.
Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)
[ OK ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<KeymasterVersionTest> (0 ms)
[ RUN ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<NewKeyGenerationTest>
Paramaterized test suite NewKeyGenerationTest is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.
Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)
[ OK ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<NewKeyGenerationTest> (0 ms)
[ RUN ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<GetKeyCharacteristicsTest>
Paramaterized test suite GetKeyCharacteristicsTest is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.
Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)
[ OK ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<GetKeyCharacteristicsTest> (0 ms)
[ RUN ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<SigningOperationsTest>
Paramaterized test suite SigningOperationsTest is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.
Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)
[ OK ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<SigningOperationsTest> (0 ms)
[ RUN ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<VerificationOperationsTest>
Paramaterized test suite VerificationOperationsTest is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.
Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)
[ OK ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<VerificationOperationsTest> (0 ms)
[ RUN ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<ExportKeyTest>
Paramaterized test suite ExportKeyTest is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.
Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)
[ OK ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<ExportKeyTest> (0 ms)
[ RUN ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<ImportKeyTest>
Paramaterized test suite ImportKeyTest is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.
Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)
[ OK ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<ImportKeyTest> (0 ms)
[ RUN ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<EncryptionOperationsTest>
Paramaterized test suite EncryptionOperationsTest is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.
Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)
[ OK ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<EncryptionOperationsTest> (1 ms)
[ RUN ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<MaxOperationsTest>
Paramaterized test suite MaxOperationsTest is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.
Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)
[ OK ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<MaxOperationsTest> (0 ms)
[ RUN ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<AddEntropyTest>
Paramaterized test suite AddEntropyTest is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.
Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)
[ OK ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<AddEntropyTest> (0 ms)
[ RUN ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<AttestationTest>
Paramaterized test suite AttestationTest is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.
Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)
[ OK ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<AttestationTest> (0 ms)
[ RUN ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<KeyDeletionTest>
Paramaterized test suite KeyDeletionTest is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.
Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)
[ OK ] GoogleTestVerification.UninstantiatedParamaterizedTestSuite<KeyDeletionTest> (0 ms)
[----------] 12 tests from GoogleTestVerification (2 ms total)
[----------] Global test environment tear-down
[==========] 12 tests from 1 test suite ran. (3 ms total)
[ PASSED ] 12 tests.
只需 3ms 即可完成以下操作。当我仔细检查时,测试本身似乎没有进行。我没有对来源或其他细节进行任何额外的更改。任何知道我还需要做什么才能运行 keymaster vts 的人将不胜感激。