A partire dal 27 marzo 2025, ti consigliamo di utilizzare android-latest-release anziché aosp-main per compilare e contribuire ad AOSP. Per ulteriori informazioni, vedi Modifiche ad AOSP.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
La suite di test del fornitore Android (VTS) fornisce test approfonditi su quanto segue:
Scoppiettio
Hardware Abstraction Layer (HAL)
VTS viene eseguito su un computer esegue gli scenari di test direttamente sui dispositivi collegati o sugli emulatori. Analogamente alla CTS, la VTS è una suite di test automatica che utilizza i seguenti componenti software principali:
L'ambiente di test Trade Federation
di VTS viene eseguito sulla macchina host e gestisce l'esecuzione dei test. Offre la possibilità di
configurare lo sharding
su più dispositivi di test (DUT). Puoi anche utilizzare la funzionalità Riprova suite per riprovare solo i casi di errore anziché l'intera suite di test, il che riduce notevolmente il tempo di esecuzione.
I singoli casi di test vengono eseguiti sul DUT. Gli scenari di test possono essere test in stile GTest, test del kernel o test in stile JUnit scritti in Java.
Tipi di test
I vari tipi di test VTS sono descritti nelle sezioni seguenti.
Test in stile GTest
La maggior parte dei test in VTS sono test in stile GTest che controllano l'implementazione dell'HAL. Il test è scritto in C++ e viene eseguito sul dispositivo. Un tipico GTest VTS esegue un'iterazione su ogni istanza di una determinata interfaccia ed esegue tutti gli scenari di test al suo interno. Per un esempio, consulta VtsHalHealthStorageV1_0TargetTest.
Test del kernel Linux
Kselftest (external/linux-kselftest) è una raccolta di test inclusi nel repository del kernel Linux al seguente indirizzo: tools/testing/selftests, di cui 23 sono inclusi in VTS per l'esecuzione su ARM.
I test del progetto di test di Linux (external/ltp) verificano l'affidabilità, la robustezza e la stabilità del kernel di Linux.
Test in stile JUnit
Un piccolo insieme di test basati sull'host in VTS sono test in stile JUnit, ad esempio
KernelApiSysfsTest.
I test Java sono implementati come
BaseHostJUnit4Test,
che è associato a un dispositivo di test e può eseguire comandi shell
per eseguire la convalida.
Test Python 3 autonomi
Alcuni test VTS, come
vts_treble_sys_prop_test
sono scritti in Python3. I test basati su Python sono implementati come unittest.TestCase e ogni test case può interagire con il dispositivo tramite i comandi della shell.
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-07-27 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-27 UTC."],[],[],null,["# Vendor Test Suite (VTS) and infrastructure\n\nThe Android Vendor Test Suite (VTS) provides\nextensive testing on the following:\n\n- Kernel\n- Hardware abstraction layer (HAL)\n\nVTS runs on a\ndesktop machine and executes test cases directly on attached devices or\non the emulators. Similar to [CTS](/docs/compatibility/cts), VTS is\nan automated test suite that uses the following major software components:\n\n- The VTS [Trade Federation](/docs/core/tests/tradefed) test harness runs on your host machine and manages test execution. It offers the ability to [Configure sharding](/docs/core/tests/tradefed/testing/through-suite/android-test-tuning) across multiple devices under test (DUTs). You can also use the [Suite Retry](/devices/tech/test_infra/tradefed/testing/through-suite/suite-retry) feature to retry only the failures rather than the entire test suites, which greatly reduces the re-run time.\n- Individual test cases are executed on the DUT. The test cases can be GTest-style tests, kernel tests, or JUnit-style tests written in Java.\n\nTypes of tests\n--------------\n\nThe various types of VTS tests are described in the following sections.\n\n### GTest-style tests\n\nMost tests in VTS are GTest-style tests that check the HAL\nimplementation. The test is\nwritten in C++ and runs on the device. A typical VTS GTest iterates through\neach instance of a given interface, and runs all the test cases\nagainst it. Refer to [`VtsHalHealthStorageV1_0TargetTest`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/health/storage/1.0/vts/functional/)\nfor an example.\n\n### Linux kernel tests\n\n- Kselftest ([external/linux-kselftest](https://github.com/torvalds/linux/tree/master/tools/testing/selftests/kselftest))\n is a collection of tests included within the Linux kernel repository\n at `tools/testing/selftests`, of which 23 are included in VTS to run on ARM.\n\n- Linux Test Project ([external/ltp](https://cs.android.com/android/platform/superproject/+/android-latest-release:external/ltp/))\n tests validate the reliability, robustness, and stability of the Linux kernel.\n\n### JUnit-style tests\n\nA small set of host-driven tests in VTS are JUnit-style tests, for example,\n[`KernelApiSysfsTest`](https://cs.android.com/android/platform/superproject/+/android-latest-release:test/vts-testcase/kernel/api/sysfs/src/com/android/tests/sysfs/KernelApiSysfsTest.java).\nThe Java tests are implemented as\n[`BaseHostJUnit4Test`](https://cs.android.com/android/platform/superproject/+/android-latest-release:tools/tradefederation/core/test_framework/com/android/tradefed/testtype/junit4/BaseHostJUnit4Test.java),\nwhich is associated with a test device and can run shell\ncommands to perform validation.\n\n### Standalone Python3 tests\n\nSome VTS tests, such as\n[`vts_treble_sys_prop_test`](https://cs.android.com/android/platform/superproject/+/android-latest-release:test/vts-testcase/security/system_property/vts_treble_sys_prop_test.py)\nare written in Python3. The\nPython-based tests are implemented as `unittest.TestCase` and each test\ncase can interact with the device through shell commands.\n| **Caution:** The Python tests aren't recommended due to limited support in the Android tree. We highly recommend writing the VTS tests as GTest, or at least as JUnit-style tests."]]