summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuexi Ma <yuexima@google.com>2018-06-19 03:45:59 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-06-19 03:45:59 -0700
commitd5751e1a5ec25fb8a4b01441fcadb22a4af1c0d0 (patch)
treeeaca1ba82888a43180e4fc66cc7ee6757104c463
parentf9b4ed978a24aa01cb4ed9f41507d035e14260a9 (diff)
parent65f31088e161724f41d2cd39626784a4ffa45716 (diff)
downloadperformance-d5751e1a5ec25fb8a4b01441fcadb22a4af1c0d0.tar.gz
use lazy android device registration
am: 65f31088e1 Change-Id: I6cb0fdad282ae03401be15df4d6df98989c7c3fd
-rw-r--r--audio_loopback_test/AudioLoopbackTest.py13
-rw-r--r--binder_benchmark/BinderPerformanceTest.py11
-rw-r--r--binder_throughput_test/BinderThroughputBenchmark.py5
-rw-r--r--fmq_benchmark/FmqPerformanceTest.py9
-rw-r--r--hwbinder_benchmark/HwBinderPerformanceTest.py11
-rw-r--r--hwbinder_latency_test/HwBinderLatencyTest.py5
-rw-r--r--hwbinder_throughput_test/HwBinderThroughputBenchmark.py5
7 files changed, 26 insertions, 33 deletions
diff --git a/audio_loopback_test/AudioLoopbackTest.py b/audio_loopback_test/AudioLoopbackTest.py
index 10c1b51..358a774 100644
--- a/audio_loopback_test/AudioLoopbackTest.py
+++ b/audio_loopback_test/AudioLoopbackTest.py
@@ -41,8 +41,7 @@ class AudioLoopbackTest(base_test.BaseTestClass):
ITERATION = 100
def setUpClass(self):
- self.dut = self.registerController(android_device)[0]
- self.dut.shell.InvokeTerminal("one")
+ self.dut = self.android_devices[0]
self.dut.adb.shell("mkdir -p %s" % self.FULL_DATA_DIR_PATH)
# install Loopback.apk
self.dut.adb.shell("pm install -r -g /data/local/tmp/Loopback.apk")
@@ -96,23 +95,23 @@ class AudioLoopbackTest(base_test.BaseTestClass):
latencies = []
confidences = []
for i in range(0, self.ITERATION):
- self.dut.shell.one.Execute(
+ self.dut.shell.Execute(
["rm -f %s/*" % self.FULL_DATA_DIR_PATH])
- self.dut.shell.one.Execute([
+ self.dut.shell.Execute([
"am start -n org.drrickorang.loopback/.LoopbackActivity "
"--es FileName %s/%s --ei AudioLevel 11 --ei TestType 222;" %
(self.TEST_DATA_DIR, self.TEST_FILE_PREFIX)
])
# wait until the test finished.
- results = self.dut.shell.one.Execute(
+ results = self.dut.shell.Execute(
["ls %s" % self.TEST_FILE_NAME])
while results[const.EXIT_CODE][0]:
logging.info("Test is running...")
sleep(1)
- results = self.dut.shell.one.Execute(
+ results = self.dut.shell.Execute(
["ls %s" % self.TEST_FILE_NAME])
- results = self.dut.shell.one.Execute(
+ results = self.dut.shell.Execute(
["cat %s" % self.TEST_FILE_NAME])
asserts.assertFalse(results[const.EXIT_CODE][0],
"Fail to get the test output")
diff --git a/binder_benchmark/BinderPerformanceTest.py b/binder_benchmark/BinderPerformanceTest.py
index 8003512..638aa16 100644
--- a/binder_benchmark/BinderPerformanceTest.py
+++ b/binder_benchmark/BinderPerformanceTest.py
@@ -72,10 +72,9 @@ class BinderPerformanceTest(base_test.BaseTestClass):
}
def setUpClass(self):
- self.dut = self.registerController(android_device)[0]
- self.dut.shell.InvokeTerminal("one")
- self.dut.shell.one.Execute("stop")
- self.dut.shell.one.Execute("setprop sys.boot_completed 0")
+ self.dut = self.android_devices[0]
+ self.dut.shell.Execute("stop")
+ self.dut.shell.Execute("setprop sys.boot_completed 0")
self._cpu_freq = cpu_frequency_scaling.CpuFrequencyScalingController(self.dut)
self._cpu_freq.DisableCpuScaling()
@@ -87,7 +86,7 @@ class BinderPerformanceTest(base_test.BaseTestClass):
def tearDownClass(self):
self._cpu_freq.EnableCpuScaling()
- self.dut.shell.one.Execute("start")
+ self.dut.shell.Execute("start")
self.dut.waitForBootCompletion()
def testRunBenchmark32Bit(self):
@@ -109,7 +108,7 @@ class BinderPerformanceTest(base_test.BaseTestClass):
logging.info("Start to run the benchmark (%s bit mode)", bits)
binary = "/data/local/tmp/%s/libbinder_benchmark%s" % (bits, bits)
- results = self.dut.shell.one.Execute([
+ results = self.dut.shell.Execute([
"chmod 755 %s" % binary, "LD_LIBRARY_PATH=/data/local/tmp/%s/hw:"
"/data/local/tmp/%s:$LD_LIBRARY_PATH "
"%s --benchmark_format=json" % (bits, bits, binary)
diff --git a/binder_throughput_test/BinderThroughputBenchmark.py b/binder_throughput_test/BinderThroughputBenchmark.py
index 8402613..3afee54 100644
--- a/binder_throughput_test/BinderThroughputBenchmark.py
+++ b/binder_throughput_test/BinderThroughputBenchmark.py
@@ -39,8 +39,7 @@ class BinderThroughputBenchmark(base_test.BaseTestClass):
"""A test case for the binder throughput benchmarking."""
def setUpClass(self):
- self.dut = self.registerController(android_device)[0]
- self.dut.shell.InvokeTerminal("one")
+ self.dut = self.android_devices[0]
self._cpu_freq = cpu_frequency_scaling.CpuFrequencyScalingController(self.dut)
self._cpu_freq.DisableCpuScaling()
@@ -150,7 +149,7 @@ class BinderThroughputBenchmark(base_test.BaseTestClass):
logging.info("Start to run the benchmark (%s bit mode)", bits)
binary = "/data/local/tmp/%s/binderThroughputTest%s" % (bits, bits)
- results = self.dut.shell.one.Execute(
+ results = self.dut.shell.Execute(
["chmod 755 %s" % binary,
"LD_LIBRARY_PATH=/data/local/tmp/%s/hw:"
"/data/local/tmp/%s:"
diff --git a/fmq_benchmark/FmqPerformanceTest.py b/fmq_benchmark/FmqPerformanceTest.py
index d8032f1..9c86942 100644
--- a/fmq_benchmark/FmqPerformanceTest.py
+++ b/fmq_benchmark/FmqPerformanceTest.py
@@ -49,8 +49,7 @@ class FmqPerformanceTest(base_test.BaseTestClass):
}
def setUpClass(self):
- self.dut = self.registerController(android_device)[0]
- self.dut.shell.InvokeTerminal("one")
+ self.dut = self.android_devices[0]
self._cpu_freq = cpu_frequency_scaling.CpuFrequencyScalingController(
self.dut)
self._cpu_freq.DisableCpuScaling()
@@ -82,7 +81,7 @@ class FmqPerformanceTest(base_test.BaseTestClass):
# Start the benchmark service.
logging.info("Start the benchmark service(%s bit mode)", bits)
binary = "/data/local/tmp/%s/mq_benchmark_service%s" % (bits, bits)
- results = self.dut.shell.one.Execute([
+ results = self.dut.shell.Execute([
"chmod 755 %s" % binary,
"VTS_ROOT_PATH=/data/local/tmp TREBLE_TESTING_OVERRIDE=true " \
"LD_LIBRARY_PATH=/data/local/tmp/%s:"
@@ -97,14 +96,14 @@ class FmqPerformanceTest(base_test.BaseTestClass):
logging.info("Start to run the benchmark (%s bit mode)", bits)
binary = "/data/local/tmp/%s/mq_benchmark_client%s" % (bits, bits)
- results = self.dut.shell.one.Execute([
+ results = self.dut.shell.Execute([
"chmod 755 %s" % binary,
"TREBLE_TESTING_OVERRIDE=true LD_LIBRARY_PATH=/data/local/tmp/%s:"
"$LD_LIBRARY_PATH %s" % (bits, binary)
])
# Stop the benchmark service.
- self.dut.shell.one.Execute("kill -9 `pidof mq_benchmark_service%s`" %
+ self.dut.shell.Execute("kill -9 `pidof mq_benchmark_service%s`" %
bits)
# Parses the result.
diff --git a/hwbinder_benchmark/HwBinderPerformanceTest.py b/hwbinder_benchmark/HwBinderPerformanceTest.py
index 4fc0842..3fa5f9f 100644
--- a/hwbinder_benchmark/HwBinderPerformanceTest.py
+++ b/hwbinder_benchmark/HwBinderPerformanceTest.py
@@ -74,10 +74,9 @@ class HwBinderPerformanceTest(base_test.BaseTestClass):
def setUpClass(self):
required_params = ["hidl_hal_mode"]
self.getUserParams(required_params)
- self.dut = self.registerController(android_device)[0]
- self.dut.shell.InvokeTerminal("one")
- self.dut.shell.one.Execute("stop")
- self.dut.shell.one.Execute("setprop sys.boot_completed 0")
+ self.dut = self.android_devices[0]
+ self.dut.shell.Execute("stop")
+ self.dut.shell.Execute("setprop sys.boot_completed 0")
self._cpu_freq = cpu_frequency_scaling.CpuFrequencyScalingController(self.dut)
self._cpu_freq.DisableCpuScaling()
@@ -89,7 +88,7 @@ class HwBinderPerformanceTest(base_test.BaseTestClass):
def tearDownClass(self):
self._cpu_freq.EnableCpuScaling()
- self.dut.shell.one.Execute("start")
+ self.dut.shell.Execute("start")
self.dut.waitForBootCompletion()
def testRunBenchmark32Bit(self):
@@ -113,7 +112,7 @@ class HwBinderPerformanceTest(base_test.BaseTestClass):
self.hidl_hal_mode, bits)
binary = "/data/local/tmp/%s/libhwbinder_benchmark%s" % (bits, bits)
- results = self.dut.shell.one.Execute([
+ results = self.dut.shell.Execute([
"chmod 755 %s" % binary,
"VTS_ROOT_PATH=/data/local/tmp " \
"LD_LIBRARY_PATH=/system/lib%s:/data/local/tmp/%s/hw:"
diff --git a/hwbinder_latency_test/HwBinderLatencyTest.py b/hwbinder_latency_test/HwBinderLatencyTest.py
index 0cb2f0b..953d2cd 100644
--- a/hwbinder_latency_test/HwBinderLatencyTest.py
+++ b/hwbinder_latency_test/HwBinderLatencyTest.py
@@ -63,8 +63,7 @@ class HwBinderLatencyTest(base_test.BaseTestClass):
def setUpClass(self):
required_params = ["hidl_hal_mode"]
self.getUserParams(required_params)
- self.dut = self.registerController(android_device)[0]
- self.dut.shell.InvokeTerminal("one")
+ self.dut = self.android_devices[0]
self._cpu_freq = cpu_frequency_scaling.CpuFrequencyScalingController(self.dut)
self._cpu_freq.DisableCpuScaling()
@@ -102,7 +101,7 @@ class HwBinderLatencyTest(base_test.BaseTestClass):
binary = "/data/local/tmp/%s/libhwbinder_latency%s" % (bits, bits)
min_cpu, max_cpu = self._cpu_freq.GetMinAndMaxCpuNo()
iterations = 1000 // (max_cpu - min_cpu)
- results = self.dut.shell.one.Execute([
+ results = self.dut.shell.Execute([
"chmod 755 %s" % binary,
"VTS_ROOT_PATH=/data/local/tmp " \
"LD_LIBRARY_PATH=/system/lib%s:/data/local/tmp/%s/hw:"
diff --git a/hwbinder_throughput_test/HwBinderThroughputBenchmark.py b/hwbinder_throughput_test/HwBinderThroughputBenchmark.py
index 588c37f..5fd950e 100644
--- a/hwbinder_throughput_test/HwBinderThroughputBenchmark.py
+++ b/hwbinder_throughput_test/HwBinderThroughputBenchmark.py
@@ -41,8 +41,7 @@ class HwBinderThroughputBenchmark(base_test.BaseTestClass):
def setUpClass(self):
required_params = ["hidl_hal_mode"]
self.getUserParams(required_params)
- self.dut = self.registerController(android_device)[0]
- self.dut.shell.InvokeTerminal("one")
+ self.dut = self.android_devices[0]
self._cpu_freq = cpu_frequency_scaling.CpuFrequencyScalingController(self.dut)
self._cpu_freq.DisableCpuScaling()
@@ -153,7 +152,7 @@ class HwBinderThroughputBenchmark(base_test.BaseTestClass):
self.hidl_hal_mode, bits)
binary = "/data/local/tmp/%s/hwbinderThroughputTest%s" % (bits, bits)
- results = self.dut.shell.one.Execute(
+ results = self.dut.shell.Execute(
["chmod 755 %s" % binary,
"VTS_ROOT_PATH=/data/local/tmp " \
"LD_LIBRARY_PATH=/system/lib%s:/data/local/tmp/%s/hw:"