GTS 环境搭建及注意事项

如下內容來自官方文档:

(干货在最下方)

GTS 5.0 User Guide

Google Mobile Services Test Suite


Overview

Google Mobile Services (GMS ) is a collection of applications and services provided by Google that runs on top of the Android Application Framework.
The GMS test suite (GTS) is an automated test suite that validates whether GMS applications are integrated properly and other device configurations are aligned with the contractual terms the partner companies agreed to with Google.
GTS uses the Tradefed test harness, just as the Compatibility Test Suite (CTS) does.

The GTS is an automated test suite that includes two major software components:
● Test harness
The gts-tradefed test harness is a customized version of Tradefed (the same test
harness used by Android Compatibility Test Suite) that runs on your host machine and
manages the test execution.
● Test cases
The GTS test cases execute on the attached mobile devices. Most of the test cases are
written in Java as JUnit tests and packaged as a Android .apk file to run on the actual
device target.


Running the GTS


Before you begin

Before you run the GTS, make sure that you have the following items:
● A host machine to run the test harness from.
○ For JDK requirements, see the CTS setup instructions .
● A device under test (DUT), that is, an Android consumer device to run the testing suite
on.
● A stable, high data rate network connection to the DUT (critical for media test).
● A dedicated Wi-Fi connection, to avoid congestion (recommended).


Running the test suite

To run the GMS Test Suite, complete the following steps:

1. Set up the Android Debug Bridge (adb) on the host machine (if needed).

○ Make sure you have a recent copy of adb installed on your machine.
To install ADB, download the Android SDK Tools package for your operating
system, open it, and follow the instructions in the included README file.
○ Ensure ‘adb’ is in your system path. For example:
export PATH= PATH: HOME/android-sdk-linux/platform-tools/

2. Set up your testing device (DUT).

○ Make sure that your device is suitable for running GTS. GTS can be executed
only on consumer devices and your phone must be running a user release-key
signed build.
○ Insert a SIM card (if the device has the telephony feature flag enabled).
○ Go through the Setup Wizard flow:
■ Connect to a Wi-Fi network that has unrestricted access to the internet.
■ Do not add a Google account during the setup flow.
■ Agree to the location terms & conditions.
○ Remove all settings that require user intervention.
The test harness (gts-tradefed) needs to access your device through an ADB
connection and also take screenshots & reboot the device during the test

■ Disable SIM PIN lock (if any).
■ If device supports a ‘screen lock’, turn it off ( Settings > Security &
location > Screen lock > “none” ).
■ Adjust screen brightness to lowest level ( Settings > Display > Brightness
level ).
■ Turn on ‘Developer options’ ( Settings > System > About > tap “Build
Number” 7 times ).
■ Enable “Stay Awake” ( Settings > System > Developer options > Stay
awake ).
■ Enable “USB debugging” ( Settings > System > Developer options > USB
debugging ).
■ Disable “Verify apps over USB” ( Settings > System > Developer options >
Verify apps over USB ).
■ Launch the browser and dismiss any startup/setup screen.

3. Run the test suite on the DUT.

○ Connect the device to the host machine with a USB cable (or over Wi-Fi if your
device does not support peripheral USB mode).
■ Always authenticate the host machine for USB debugging (a popup will be
shown, turn on the checkbox)
○ Start the test harness and run the test.
■ Make sure you have at least one device connected to the host machine.
■ Launch the GTS console by running the gts-tradefed script, for example:
android-gts user$ ./tools/gts-tradefed
■ Start the GTS test plan (containing all of the test packages). This will kick
off all the GTS tests required.

run gts –plan GTS

■ Alternately, you can just run GTS from the command line.

$ ./android-gts/tools/gts-tradefed run gts –plan GTS

You should see test progress and results reported on the console.

4. View the test results.

○ The test harness executes the GTS tests on the device, including video test, and
saves the test results in a zip file.
○ Once all the tests are executed, you can view the test results in your browser.
○ To upload test results, sign into a Google account and upload the test result to
Android Partner Frontend ( http://partner.android.com ). Ensure that the Google
account used for testing is allowed access to Android Partner Frontend. Upload
GTS test result into Android Partner Frontend using the web interface or upload
test results using Android Partner API.


Interpreting the test results

The test results are placed in the file: $GTS_ROOT/results/.zip Inside the
zip, the testResult.xml or test_result_failures.html files contain the actual results.
Either of the files contains the following sections:
● Test Summary
The Summary section provides executed test plan details, like the test plan name and
execution start and end times. It also presents an aggregate summary of the number of
tests that passed, failed, etc. In addition, it provides details about the device including
make, model, and Android platform version.
● Test Report
The next section, the test report, provides a summary of tests passed per module.
This is followed by details of the actual tests that were executed. The report lists the test
module, test case, and the executed tests. It shows the result of the test
execution—pass, fail, etc. In the event of a test failure, details are provided to help
diagnose the cause.
Further, the stack trace of the failure is available in either the HTML file or the XML file.
Incomplete Modules
The test_result_failures.html file includes an Incomplete Modules section,
which provides a summary of incomplete test modules.
The Incomplete Modules info is also available in the XML file testResult.xml but not
included to ensure brevity. Open the file and read the value of the “done” attribute for
each module in the result report. Modules with value done = “false” are incomplete.

注意事项:

跑GTS最重要是:要有稳定,独占,高速的网络
如何得到这样的网络环境呢?
下面提供几个参考方法:
1. 路由器使用的网络的带宽 > 20M;
2. 路由器的传输速率 > 500M;
3. 测试时一台路由器对应一台测试机使用;
4. 进行GTS测试时,尽量不做其他消耗带宽的测试;
5. 进行GTS测试之前,可以用SpeedTest对网速进行测试,确保下载速度稳定在1M/S以上;
6. 测试过程中,可以使用“网速监测apk”或者抓包工具,对网速进行实时监控。评估通过测试需要的网速和带宽。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值