CTS Training
CTS Training
CTS Training
Agenda
ProcesstogetGooglescertification
requirement in CDD
CTS History
download CTS
binary: http://source.android.com/compatibility/downloads.html source: 1, git ls-remote --heads git://192.168.1.250/android-mirror/platform/manifest.git ... refs/heads/android-cts-2.1_r4 refs/heads/android-cts-2.2_r1 refs/heads/android-cts-2.2_r2
...
2, repo init -u git://192.168.1.250/android-mirror/platform/manifest.git -b android-cts-2.2_r2 3, repo sync cts
build CTS
if from svn://192.168.1.250/oms/branches/horse make BUILD_CTS=true cts if from git://android.git.kernel.org/platform/manifest.git make cts
install CTS
1. install Android SDK tool(http://androidappdocs.appspot.com/sdk/index.html) 2. unzip CTS package(e.g, android-cts-2.1_r3-x86.zip)
android-cts
|-- docs
|-- repository | |-- host_config.xml
run CTS
1. connect phone/emulator to PC. 2. close eclipse otherwise CTS will report can't bind port 8700 3. android-cts/tools/startcts to enter CTS shell.
three modes to run case: plan mode package mode case mode
tricky in host_config.xml
inplanmode,setmaxTestCountto0 will avoid restart phone from time to time.
incasemode,mustsetmaxTestCounttononezero.
test report
firefox repository/results/20xx.../testResult.xml
Fail Cases
parsects.py
parsects.py wvga/testresult.xml a8188/testresult.xml
typical bugs
root process(security)
case: no error: the test report will list all root process except kernel process. CTS get root process by read /proc. in /proc, if it is a folder, and its uid or gid is root, then CTS report the process is root.
solution: change privilege of all the process to normal user, except netd which Google gave waiver.
TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
TTS
case: android.speech.tts.cts.TextToSpeechTest#testSynthesizeToFile error: junit.framework.AssertionFailedError at android.speech.tts.cts.TextToSpeechTest.setUp(TextToSpeechTest.java:110) solution: need install TtsService.apk and PicoTts.apk. it will also fail if no voice data, need install com.svox.langpack.installer.apk
refer to http://code.google.com/p/android/issues/detail?id=8816
root cause:byrunbusyboxnetstat-l -pinadbshell,youcanfindwhichappusethe port. e.g, tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1094/dnsmasq. (53 is the decimal value of 0035). solution: app should use local socket instead of internet socket.
solution: Chinese input method may eat some characters. so set default input language to English will work.
send/receive message
case: android.telephony.cts.SmsManagerTest#testSendMessage error: java.lang.IllegalArgumentException: Invalid destinationAddress at android.telephony.SmsManager.sendTextMessage(SmsManager.java:77) solution: use valid SIM card and set valid phone number in Settings->Call settings->My caller number->number before test.
INJECT_EVENT (performance)
case: android.widget.cts.GridViewTest#testPressKey error: java.lang.SecurityException: Injecting to another application requires INJECT_EVENT permission at android.os.Parcel.readException(Parcel.java:1219) solution: run case in single mode
test_delete
case: tests.api.java.io.FileTest#test_delete error: Directory Should Not Have Been Deleted. at tests.api.java.io.FileTest.test_delete(FileTest.java:706) rootcause: the folder should not be deleted if it contain files. can't reproduce by adb shell. solution: need kernel team fix issue in function mkdir()
sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
assertEquals(Sensor.TYPE_MAGNETIC_FIELD, sensor.getType());
bug of CTS
camera case
case: android.hardware.cts.CameraTest#testAccessParameters
comments According to CTA, we need to set sys.min.match.digits to 11. These 4 cases will pass if set the value to 7.
WebHistory
case: android.webkit.cts.WebHistoryItemTest#testWebHistoryItem error: expected:<1> but was:<0> at android.webkit.cts.WebHistoryItemTest.testWebHistoryItem(WebHistoryItemTest.java:84 )
rootcause: the case check history list without wait sufficient time after invoke WebView.loadUrl(), so get wrong result. froyo emulator and Nexus One also get the same error.
StoreAudio
case: android.provider.cts.MediaStore_Audio_Genres_MembersTest#testStoreAudioGenresM embersExternal error: Should throw SQLException because there is no column with name "Members.AUDIO_ID" in the table at android.provider.cts.MediaStore_Audio_Genres_MembersTest.testStoreAudioGenresM embersExternal(MediaStore_Audio_Genres_MembersTest.java:183) rootcause: it is marked as @ToBeFixed in CTS source code: The result cursor of query for all columns does not contain the column Members.ALBUM_ART, Members.GENRE_ID and Members.AUDIO_ID.
ddmlib error
case: any case error: Failed to execute shell command am ..., com.android.ddmlib.ShellCommandUnresponsiveException rootcause: ddmlib.jar changed when Google release android sdk tools r7. solution: use ddmlib.jar from android sdk tools r6.
any questions?