日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CTS 测试简介

發(fā)布時(shí)間:2023/12/20 编程问答 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CTS 测试简介 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

?

一、簡介... 3

1.????? CTS介紹... 3

2.????? GTS介紹... 3

3.????? CTS? Verifier 介紹... 3

二、? 測試流程-CTS環(huán)境的搭建... 3

1.????? PC:ubuntu 14.04以上系統(tǒng)... 3

2.????? CTS 環(huán)境... 3

3.????? 環(huán)境搭建... 4

三、測試流程-CTS 測試... 5

1.????? 測試前的準(zhǔn)備工作... 5

2.????? 執(zhí)行CTS過程應(yīng)注意的問題... 7

3.????? O版本測試命令介紹... 8

4.????? 特殊情況的處理... 10

5.????? 生成報(bào)告... 10

四、測試流程-GTS 測試... 11

1.????? 測試前的準(zhǔn)備工作... 11

2.????? 測試命令介紹... 11

3.????? 特殊情況處理... 11

4.????? 生成報(bào)告... 11

五、測試流程-CTS Verifier測試... 11

六、????? 工作總結(jié)... 11

?

?

一、簡介

1.?????? CTSc介紹

CTS:Android的CTS測試,英文為Compatibility Test Suite,意為兼容性測試。只有通過CTS測試的設(shè)備才有可能獲得Android的商標(biāo)和享受Android Market的權(quán)限;Android的CTS目的與意義:用戶在android系統(tǒng)中有更好的用戶體驗(yàn),并且展示android應(yīng)用的優(yōu)越性,使得android開發(fā)者更容易編寫高質(zhì)量的andorid程序。

2.?????? GTS介紹

GMS全稱為Google?MobileService,即谷歌移動(dòng)服務(wù)。GMS是Google開發(fā)并推動(dòng)Android的動(dòng)力,也是Android系統(tǒng)的靈魂所在。GTS主要是對安卓手機(jī)上的GMS應(yīng)用相關(guān)性能測試。

3.?????? CTS? Verifier 介紹

CTS verifier保證應(yīng)用程序的可靠運(yùn)行和用戶有一個(gè)很好的體驗(yàn),相對CTS和GTS 最大的不同是verifier 不能自動(dòng)化測試,只能手工測試。

二、? 測試流程-CTS環(huán)境的搭建

1.?????PC:ubuntu 14.04以上系統(tǒng)

最低要求安裝ubuntu 14.04以上系統(tǒng),目前在用的Ubuntu 16.04、 Ubuntu 14.04系統(tǒng),保證系統(tǒng)和電腦都可以正常使用。

2.?????CTS 環(huán)境

android 8.0的CTS 環(huán)境為

CTS_8.0_r5(4500653)

GTS _5.1_r2(4507047)

Verifier 8.0_r54(0)

下載地址:

http://source.android.com/compatibility/downloads.html

將以上文件下載并拷貝到Ubuntu 系統(tǒng)home的CTS文件夾中并解壓即可,并給可執(zhí)行權(quán)限,具體下載頁面見下圖:

?

3.?????環(huán)境搭建

N的環(huán)境需要SDK為26以上,下載地址:http://www.android-studio.org/

JDK要求在1.8以上,下載地址:https://www.oracle.com/index.html

環(huán)境配置方法:

1. sudo ?gedit /etc/profile

在里面添加如下配置:

///SDK配置

#set path for androidsdk tools
export PATH=$PATH:/your_android-sdk-linux_path/tools

exportPATH=$PATH:/your_android-sdk-linux_path/platform-tools

exportPATH=$PATH:/your_android-sdk-linux_path/ build-tools /26.0.0

//JDK配置

#set path forandroid jdk tools

exportJAVA_HOME= your_ jdk-linux_path

export JRE_HOME=${JAVA_HOME}/jre

exportCLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib

exportPATH=${JAVA_HOME}/bin:$PATH

?

環(huán)境配置好后輸入 java –version 得到

java version"1.8.0_131"

Java(TM) SE RuntimeEnvironment (build 1.8.0_131-b11)

Java HotSpot(TM)64-Bit Server VM (build 25.131-b11, mixed mode)

輸入aapt version得到

Android AssetPackaging Tool, v0.2-4062713

得到上面的結(jié)果,CTS的測試環(huán)境就配置好了,CTS就可以正常執(zhí)行了。

JDK和SDK也有其他配置方法,可以自行學(xué)習(xí)試驗(yàn)。

三、測試流程-CTS 測試

1.???測試前的準(zhǔn)備工作

1.Factory data reset thedevice:?Settings > Backup & reset > Factory data reset,只要在刷機(jī)時(shí)選擇刪除 usrdate

Warning:?Thiswill erase all user data from the device.

2.Set your device's language toEnglish (United States) from:?Settings > Language & input> Language

3.Turn on the location setting ifthere is a GPS or Wi-Fi / Cellular network feature on the device:?Settings> Location > On

4.Connect to a Wi-Fi network thatsupports IPv6, can treat the Device Under Test (DUT) as an?isolatedclient?(see the?Physical Environment?sectionabove), and has an internet connection:?Settings > Wi-Fi

5.Make sure no lock pattern orpassword is set on the device:?Settings > Security > Screen lock> None

6.Enable?USB debugging?onyour device:?Settings > Developer options > USB debugging.

Note:?OnAndroid 4.2 and later,?Developer options?is hidden by default.To make them available, go to?Settings > About phone?andtap?Build number?seven times. Return to the previous screen tofind?Developer options. See?EnablingOn-device Developer Options?for additional details.

7.Make sure the time is set to12-hour format:?Settings > Date & time > Use 24-hour format> Off

8.Select:?Settings >Developer options > Stay Awake > On

9.Select:?Settings >Developer options > Allow mock locations > On

Note:?Thismock locations setting is applicable only in Android 5.x and 4.4.x.

10.Select:?Settings >Developer options > Verify apps over USB > Off

Note:?Thisverify apps step became required in Android 4.2.

11.Launch the browser and dismissany startup/setup screen.

12.Connect the desktop machinethat will be used to test the device with a USB cable

Note:?Whenyou connect a device running Android 4.2.2 or later to your computer, thesystem shows a dialog asking whether to accept an RSA key that allows debuggingthrough this computer. Select?Allow USB debugging.

13.Install and configure helperapps on the device.

Note:?For CTSversions 2.1 R2 through 4.2 R4, set up your device (or emulator) to run theaccessibility tests with:
adbinstall -randroid-cts/repository/testcases/CtsDelegatingAccessibilityService.apk
On the device, enable:?Settings > Accessibility > Accessibility> Delegating Accessibility Service

Note:?For CTSversions prior to 7.0, on devices that declare?android.software.device_admin, set up yourdevice to run the device administration test using:
adbinstall -r android-cts/repository/testcases/CtsDeviceAdmin.apk

In Settings > Security > Select device administrators,enable the twoandroid.deviceadmin.cts.CtsDeviceAdminReceiver*?device administrators. Ensure theandroid.deviceadmin.cts.CtsDeviceAdminDeactivatedReceiver?and any other preloaded device administrators remaindisabled.

14.Copy the CTS media files to thedevice as follows:

Note:?For CTS2.3 R12 and later, if the device supports video codecs, the CTS media filesmust be copied to the device.

·????????????????????????????Navigate (cd) to the path themedia files are downloaded and unzipped to.

·????????????????????????????Change the file permissions:?chmod u+xcopy_media.sh

·????????????????????????????Run?copy_media.sh:

·????????????????????????????????????????????????????To copy clips up to aresolution of 720x480, run:?./copy_media.sh 720x480

·????????????????????????????????????????????????????If you are not sure about themaximum resolution, try?./copy_media.sh all?sothat all files are copied.

·????????????????????????????????????????????????????If there are multiple devicesunder adb, add the -s (serial) option to the end. For example, to copy up to720x480 to the device with serial 1234567, run:?./copy_media.sh720x480 -s 1234567

15.?If the DUT supports the Bluetooth LEfeature, then at least three Bluetooth LE beacons should be placed within fivemeters of the DUT for Bluetooth LE scan testing.

詳細(xì)說明參見:https://source.android.com/compatibility/cts/setup

2.???執(zhí)行CTS過程應(yīng)注意的問題

1.每次測試最少連接一臺手機(jī),目前androidO要求至少4

2.開始測試前需要點(diǎn)擊home鍵,將手機(jī)屏幕放到home界面進(jìn)行測試。

3.測試中的設(shè)備需要放置在一個(gè)平穩(wěn)的桌面上,不允許測試cts的同時(shí),測試其他任務(wù),在測試過程中不允許碰動(dòng),防止senor相關(guān)的casefailcamera要指向一個(gè)物體,用于聚焦。

4.在測試過程中不允許點(diǎn)擊任何按鍵和屏幕,否則可能會(huì)導(dǎo)致測試fail

5.通過啟動(dòng)解壓包下的/android-cts/tools/cts-tradefed,啟動(dòng)cts環(huán)境。

6.如果設(shè)備同時(shí)支持armx86,需要同時(shí)測相關(guān)的cts測試包。

詳細(xì)說明參見:https://source.android.com/compatibility/cts/run

3.???O版本測試命令介紹

?

在控制臺輸入“?”,會(huì)顯示我們常用的android O版本cts命令,如上圖。和N版本相比,在我們常用的CTS命令中,O的命令幾乎沒有變化。

1)CTS全包執(zhí)行命令:runcts --shards? 手機(jī)數(shù)量

2)單跑module:runcts -m <module>: run a test module.

3)單跑某條case:runcts -m <module> ?-t <test_name>:run a specific test from the module. Test name can be<package>.<class>, <package>.<class>#<method> or<native_name>.

?

如上圖,單跑caes的命令可以為:

run cts –m CtsAccelerationTestCases? -t android.acceleration.cts.HardwareAccelerationTest#testIsHardwareAccelerated

4)處理fail項(xiàng)或者continue命令:run cts –retry/-r <session_id>: run all failed tests from aprevious session.

5)List命令不變:l d查看設(shè)備狀態(tài);l r查看報(bào)告

6)其他可選條件:-s+設(shè)備SN號;--abi+arm64-v8a/armeabi-v7a;--shards+手機(jī)數(shù)量(暫時(shí)和手機(jī)數(shù)量一致);--skip-preconditions/-o

--serial/-s <device_id>: The device to run the test on.

? --abi/-a <abi>: The ABI torun the test against.

? --shards <shards>: Shards arun into the given number of independant chunks, to run on multiple devices inparallel.

7)新增3條抓log的命令,作為可選項(xiàng),可以放在執(zhí)行命令的后面。

--logcat-on-failure: Capture logcat when a test fails.

? --bugreport-on-failure: Capture abugreport when a test fails.

? --screenshot-on-failure: Capture ascreenshot when a test fails.、

8)有時(shí)為了加快retry的速度,可以過濾一些特殊的測試Module,命令為在cts的run命令后加--exclude-filter 例如:run cts –r 0 --exclude-filterCtsDeqpTestCases。

AOSP版本run cts的命令為:run cts-reference-aosp 其他和正常版本CTS一樣。

其他具體命令可以在CTS環(huán)境輸入:run cts--help-all查看

其他用法參見谷歌文檔:《CTS V2 - Best Practices》

?

4.???特殊情況的處理

詳見給大家發(fā)的Excel文檔

5.???生成報(bào)告

正常測試過程中最好不要手動(dòng)生成報(bào)告,容易引起測試異常,在需要的情況下,可以用下列方式生成報(bào)告:

1.從PC端斷掉所有設(shè)備,等待測試環(huán)境自動(dòng)生成報(bào)告。

2.在控制臺輸入q或者exit,然后再輸入kill,這樣可以快速生成報(bào)告。

3.AOSP版本生成報(bào)告和正常版本一樣,最后提交google需要制作processed報(bào)告,具體命令如下:

./process_report.py -fingerprint FP信息 ProductID CTS_Report_path/2017.08.02_10.02.30.zip?

這樣就會(huì)在相關(guān)的路徑生成processed壓縮包,CTS_Report_path/2017.08.02_10.02.30_processed.zip

其中,process_report.py為VTS/bin目錄下的python腳本。(*8.0_R1由于VTS自帶的該腳本有問題,所以需要暫時(shí)用Google指定的process_report.py)

FP 必須和測試報(bào)告里的fingerprint一樣。

四、測試流程-GTS 測試

1.?????測試前的準(zhǔn)備工作

和CTS相比GTS設(shè)置唯一的不同就是不需要將“android-cts-media-1.3”中的test文件夾拷貝到手機(jī)根目錄下。

2.??????測試命令介紹

GTS命令和CTS命令大致相同,androidO版本的GTS命令為:

run gts –s 設(shè)備SN號。其他和CTS類似。

3.?????特殊情況處理

詳見給大家發(fā)的Excel文檔。

4.?????生成報(bào)告

和CTS類似。

五、測試流程-CTS Verifier測試

詳見CTSVerifier_8.0測試文檔。

六、 工作總結(jié)

1.?????? CTS 測試盡量在晚上執(zhí)行,因?yàn)楹臅r(shí)比較長,避免耽誤白天的時(shí)間;在測試前務(wù)必確認(rèn)清楚電池的電量、USB的連接等。

2.?????? GTS 和verifier盡量在白天執(zhí)行,特別測試GTS 的時(shí)候,一定要在網(wǎng)絡(luò)狀況比較好的情況下測試,避免因網(wǎng)絡(luò)問題導(dǎo)致測試fail,需要多次測試。

3.?????? Result中的測試結(jié)果盡量及時(shí)清理,避免報(bào)告太多影響CTS 測試。

4.?????? 電腦在長時(shí)間測試CTS 后,盡量的規(guī)律性的重啟下電腦,避免因PC性能影響CTS測試。

總結(jié)

以上是生活随笔為你收集整理的CTS 测试简介的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。