안드로이드 cts 테스트
(1) cts 실행하기 위한 선행조건
Setting up your device
CTS can be executed only on consumer devices. This section is important as not following these instructions will lead to test timeouts/ failures:
Your device should be running a user build (Android 4.0 and later)from source.android.com
1. Please refer to this linkon the Android developer site and set up your device accordingly.
2. Make sure that your device has been flashed with a user build (Android 4.0 and later) before you run CTS.
3. You need to ensure the Text To Speech files are installed on the device. You can check via Settings > Speech synthesis > Install voice data before running CTS tests. (Note that this assumes you have Android Market installed on the device, if not you will need to install the files manually via adb)
4. Make sure the device has a SD card plugged in and the card is empty. Warning: CTS may modify/erase data on the SD card plugged in to the device.
5. Do a factory data reset on the device (Settings > storage > Factory data reset). Warning: This will erase all user data from the device.
6. Make sure no lock pattern is set on the device (Settings > Security > Screen Lock should be 'None').
7. Make sure the "USB Debugging" development option is checked (Settings > Developer options > USB debugging). Google Confidential
8. Make sure Settings > Developer options > Stay Awake is checked
9. Make sure Settings > Developer options > Allow mock locations is checked
10. Make sure device is connected to a functioning Wi-Fi network (Settings > Wi-Fi)
11. Make sure the device is at the home screen at the start of CTS (Press the home button).
12. While a device is running tests, it must not be used for any other tasks.
13. Do not press any keys on the device while CTS is running. Pressing keys or touching the screen of a test device will interfere with the running tests and may lead to test failures.
14. Set up accessibility tests: 1. adb install android-cts/repository/testcases/ CtsDelegatingAccessibilityService.apk
15. On the device, enable Settings > Accessibility > Delegating Accessibility Service
1. Set up device administration tests: 1. adb install android-cts/repository/testcasesrun cts --plan CTS/CtsDeviceAdmin.apk
16. On the device, enable Settings > Security > Device Administrators > android.deviceadmin.cts.CtsDeviceAdmin* settings
1. Copy the CTS media files to your device using ADB with the instructions below:
17.
The CTS media stress tests require video clips to be on external storage (/sdcard). Most of the clips are from Big Buck Bunny which is copyrighted by the Blender Foundation under the Creative Commons Attribution 3.0license. The required space depends on the maximum video playback resolution supported by the device. By default, 176x144 and 480x360 SHOULD be supported. Note that the video playback capabilities of the device under test will be checked via the android.media.CamcorderProfile APIs.
Here are the storage requirements by maximum video playback resolution:
● 480x360: 91.4MB
● 720x480: 151.9MB
● 1280x720: 401.6MB
● 920x1080: 1008.2MB
Instructions to copy the media files to a device:
Download the android-cts-media-X.Y.zip file compatibility/downloads.html and unzip it.
1. Connect the device to the computer and check that adb can connect to it.
2. cd to the unzipped folder.
3. chmod 544 copy_media.sh
4. Run copy_media.sh ○ To copy clips for just the default resolutions, run ./copy_media.sh. Google Confidential ○ To copy clips up to a resolution of 720x480, run ./copy_media.sh 720x480. ○ If you are not sure about the maximum resolution, try 1920x1080 so that all files are copied. ○ If there are multiple devices under adb, add -s serial option to the end. For example, to copy up to 720x480 to device with serial 1234567, run copy_media.sh 720x480 -s 1234567.
5.
Using the CTS To run a test plan:
Make sure you have at least one device connected. Launch the CTS console by running the cts-tradefedscript e.g. $ ./android-cts/tools/cts-tradefed
1. You may start the default test plan (containing all of the test packages) by typingrun cts --plan CTS. This will kick off all the CTS tests required for compatibility. Type list plansto see a list of test plans in the repository.Type list packages to see a list of test packages in the repository. See the CTS command reference or type helpfor a complete list of supported commands.
2. Alternately, you can just run a CTS plan from the command line using cts-tradefed run cts --plan
3. You should test progress and results reported on the console.
(2) 빌드 후 cts 실행 방법
make cts 해서 빌드한다.
/out/host/linux-86폴더에 cts관련 폴더가 생긴다.
out/host/linux-x86/cts폴더에 android-cts폴더와 zip파일이 생긴다.
android-cts/tools폴더가 있다
./cts-tradefed를 실행한다.
help를 치면 관련 명령어 옵션이 나온다.
run cts --plan CTS 실행하기...
run cts
run cts -c 클래스명
run cts -p 패키지명
등등
run cts --plan test_plan_name: run a test plan
run cts --package/-p : run a CTS test package
run cts --class/-c [--method/-m] : run a specific test class and/ormethod
run cts --continue-session session_ID: run all not executed tests from a previous CTS session
run cts [options] --serial/s device_ID: run CTS on specified device
run cts [options] --shards number_of_shards: shard a CTS run into given number of independent chunks, to run on multiple devices inparallel
run cts --help/--help-all: get more help on running CTS
(3) 관련 cts 자료 글
정의
CTS(Compatiblity Test Suite)는 안드로이드
디바이스의 호환성을 테스트 하는 도구입니다. CTS를 하는 이유는 개발자가 표준 SDK의 개발 가이드에 따라서 만든 응용 프로그램들이, CTS 인증을
받은 안드로이드 호환 디바이스에서 정상적으로 동작함을 보장하기 위함입니다. 즉 다시 말하자면, CTS 테스트의 통과와 기타 CDD(Compatibility Definition Document)에 기재되어 있는 하드웨어 요구치를 충족해야만 구글의 인증을 통과하고 마켓 및 구글의 서비스를 탑재할 수 있는 것입니다. |
구성
리눅스에서 실행되는 CTS엔진과 타겟디바이스에 설치 및 실행되는 개별 테스트 케이스들로 구성되어 있습니다. Android 2.1(Éclair)버전은 총 23,107개의 시험 테스트 케이스로 구성되어 있으며, 테스트를 완료하는데도 상당한 시간이 걸립니다. |
원리
Android 가 설치된 장치 와 Test 수행 PC 간에 연결이 되어 있으면 자동으로 Test App 등을 장치에서 실행하고, 그 결과를 Pass, Fail, Timeout 등으로 표시하게 됩니다. |
테스트 과정
1.
CTS 다운로드(http://source.android.com/compatibility/downloads.html) 2. 테스트할 기기를 PC에 연결. 3.
기기 설정. 4.
CTS 실행
|
테스트 이후의 작업
1.
테스트 결과 확인 2.
시험 결과 분석 및 디버깅 3.
결과 등록 및 구글 CTS 인증
|
CTS 테스트 종류
Software |
문서정리