51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1836|回复: 1
打印 上一主题 下一主题

CTS入门

[复制链接]
  • TA的每日心情
    奋斗
    2021-8-6 16:14
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]测试小兵

    跳转到指定楼层
    1#
    发表于 2018-4-11 15:48:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    提要

    由于项目的需要,需要跑CTS去验证新加的一些feature能不能工作, 网上搜了一些CTS环境搭建的资料,这
    里再总结一下。


    > The Compatibility Test Suite (CTS) is a free, commercial-grade test suite, available for download. The CTS r
    epresents the "mechanism" of compatibility.

    The CTS runs on a desktop machine and executes test cases directly on attached devices or an emulator. T
    he CTS is a set of unit tests designed to be integrated into the daily workflow (such as via a continuous build
    system) of the engineers building a device. Its intent is to reveal incompatibilities early on, and ensure that
    the software remains compatible throughout the development process.

    The CTS is an automated testing harness that includes two major software components:
        a. The CTS tradefed test harness runs on your desktop machine and manages test execution.
        b. Individual test cases are executed on the Device Under Test (DUT). The test cases are written in Java
    as JUnit tests and packaged as Android .apk files to run on the actual device target.

    The Compatibility Test Suite Verifier (CTS Verifier) is a supplement to the CTS available for download. CTS Ve
    rifier provides tests for APIs and functions that cannot be tested on a stationary device without manual inp
    ut (e.g. audio quality, accelerometer, etc).

    The CTS Verifier is a tool for manual testing and includes the following software components:
        a. The CTS verifier app that is executed on the DUT and collects the results.
        b. The executable(s) or script(s) that are executed on the desktop machine to provide data or additional
    control for some test cases in the CTS Verifier app.

    准备环境

    1.ADB and AAPT
    如果之前你已经编译了Android的image, 可以在out/host/linux-x86/bin/中找到这两个service的文件,要做
    的就是将他们加到环境变量里面:

    export PATH=$PATH:<YOUR_ANDROID_ROOT>/out/host/linux-x86/bin/
    1
    2.JDK 要求
    The master branch of Android in AOSP:
    Ubuntu - OpenJDK 8, Mac OS - jdk 8u45 or newer
    Android 5.x (Lollipop) - Android 6.0 (Marshmallow):
    Ubuntu - OpenJDK 7, Mac OS - jdk-7u71-macosx-x64.dmg

    3.CTS package 要求

    Android        CTS version
    N        cts-7.0
    M        cts-6.0
    Run CTS的常用命令

    cts-7.0 相比 cts-6.0已经做了很大的修改,已知的改动有:
    a. 去掉了–package 选项 (替换为-m module选项)
    b. 去掉了android-cts\repository\testcases*.xml
    (这个改动很confuse, 因为不能再通过xml文件去过滤掉不想跑的cases, 另外也不能知道这个package包含
    多少个test cases,取而代之的是只能跑一遍,通过测试结果才能知道具体的cases)

    N        M        描述
    -m module -t test_name        -c class -m method        run a specific test class and/or method
    So, 如果想单独run android.keystore这个package包含的所有的cases, 在6.0和7.0的cts里要用不同的co
    mmand:
    cts-6.0

    ./cts-tradefed run cts --package android.keystore --disable-reboot --skip-preconditions
    1
    cts-7.0

    #!/bin/sh
    #set -v -x
    ./cts-tradefed run cts -m CtsKeystoreTestCases -disable-reboot --skip-preconditions

    常用命令        描述
    –>l r        list results currently in the repository
    –>l c        list the commands currently in the queue
    cts6.0–>run cts –continue-session [session-id]        run all not executed tests from a previous CTS session
    cts7.0–>run cts –retry [session-id]        run all failed tests from a previous session

    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-9-20 22:21 , Processed in 0.060041 second(s), 22 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表