0

在 Androidgts-tradefedxts-tradefed中,perl 或 Python 脚本中的“分片”选项不适用于 2 个或更多设备。

Python代码

import subprocess

p = subprocess.Popen('./gts-tradefed run gts --shards 2', stdout=subprocess.PIPE,stderr=subprocess.PIPE,stdin=subprocess.PIPE)
out, err = p.communicate()
print out

命令的输出:

Android GTS 3.0_r5 build:3028956
Non-interactive mode: Running initial command then exiting.
Using commandline arguments as starting command: [run, xts, --plan, XTS, --shards, 2]
08-16 16:07:44 I/DeviceManager: Detected new device 100fb56f
08-16 16:07:44 I/DeviceManager: Detected new device 20bf34cc
08-16 16:07:44 I/unknown_device: Created result dir 2016.08.16_16.07.44
Saved log to /tmp/tradefed_global_log_6249175650313503897.txt
08-16 16:07:45 I/CommandScheduler: All done

如果"run gts --shards 2"输入命令gts-tradefed将按预期工作。

请建议如何"./gts-tradefed run gts --shards 2"从 Python 或 perl 脚本调用和执行它。

4

1 回答 1

0

我不确定尝试

subprocess.check_output('./gts-tradefed run gts --shards 2',shell=True)
(or) subprocess.call('./gts-tradefed run gts --shards 2',shell=True)
于 2017-02-04T07:59:44.163 回答