【问题标题】:How to run vts for specific device when multiple devices are connected连接多个设备时如何为特定设备运行 vts
【发布时间】:2019-11-08 21:36:15
【问题描述】:

我有一个 AOSP VTS(版本 9)设置,当连接一个设备时,它在 Linux 上运行良好。但是,当两个设备连接到计算机时,是否有一个选项让我们选择运行 VTS 的设备?

我注意到在运行 vts-tradefed 应用程序时出现“I/DeviceManager: Detected new device”。

VTS 应仅在特定设备上运行,而不应在两个设备上运行。我们可以假设另一个设备正在执行一些其他操作并且不应该受到干扰。 这可能吗?

提前致谢

【问题讨论】:

    标签: android-source android-vts


    【解决方案1】:

    VTS 帮助:

    vts-tf > help run
    r(?:un)? help:
        command <config> [options]        Run the specified command
        <config> [options]                Shortcut for the above: run specified command
        cmdfile <cmdfile.txt>             Run the specified commandfile
        commandAndExit <config> [options] Run the specified command, and run 'exit -c' immediately afterward
        cmdfileAndExit <cmdfile.txt>      Run the specified commandfile, and run 'exit -c' immediately afterward
    
        ----- Vendor Test Suite specific options ----- 
        <plan> --module/-m <module>       Run a test module
        <plan> --module/-m <module> --test/-t <test_name>    Run a specific test from the module. Test name can be <package>.<class>, <package>.<class>#<method> or <native_binary_name>
            Available Options:
                --serial/-s <device_id>: The device to run the test on
                --abi/-a <abi>         : The ABI to run the test against
                --logcat-on-failure    : Capture logcat when a test fails
                --bugreport-on-failure : Capture a bugreport when a test fails
                --screenshot-on-failure: Capture a screenshot when a test fails
                --shard-count <shards>: Shards a run into the given number of independent chunks, to run on multiple devices in parallel.
         ----- In order to retry a previous run -----
        retry --retry <session id to retry> [--retry-type <FAILED | NOT_EXECUTED>]
            Without --retry-type, retry will run both FAIL and NOT_EXECUTED tests
    

    可以使用 --serial 指定运行测试的设备

    【讨论】:

    • 为特定的测试用例尝试了这个选项,最初它显示测试是针对预期的 device_id 运行的。但是,一旦测试开始,它会在以下情况下失败:“W/NativeDevice:未检测到设备
    • 在只连接一台设备的情况下运行上述相同的测试,它有效。那么我可能会错过什么?谢谢!
    • 不检查 vts tradefed 源代码,暂时不知道,我目前没有太多时间。我有一个解决方法的想法。将 adb 二进制文件重命名为 adb1 之类的名称,然后定义: function adb () { adb1 -s YOUR_SERIAL $@ } 希望这将使 vts_tf 始终使用该设备。您可以在启动测试的脚本中执行此操作,以免发生全局更改
    猜你喜欢
    • 1970-01-01
    • 2018-12-17
    • 2016-11-22
    • 1970-01-01
    • 1970-01-01
    • 2020-05-24
    • 2015-07-13
    • 2014-09-14
    • 2018-11-25
    相关资源
    最近更新 更多