Snap for 4383937 from dade4c691f158d15cbc397a3806da276307ad653 to oc-mr1-release

Change-Id: Ib61eb47f54f2bba71d2c3f336354ba43197a6787
diff --git a/fmq_benchmark/AndroidTest.xml b/fmq_benchmark/AndroidTest.xml
index b3f5b74..023e306 100644
--- a/fmq_benchmark/AndroidTest.xml
+++ b/fmq_benchmark/AndroidTest.xml
@@ -18,11 +18,10 @@
         <option name="abort-on-push-failure" value="false" />
         <option name="push-group" value="HostDrivenTest.push" />
         <option name="cleanup" value="true" />
-        <option name="remount-system" value="true" />
         <option name="push" value="DATA/lib/android.hardware.tests.msgq@1.0.so->/data/local/tmp/32/android.hardware.tests.msgq@1.0.so" />
         <option name="push" value="DATA/lib64/android.hardware.tests.msgq@1.0.so->/data/local/tmp/64/android.hardware.tests.msgq@1.0.so" />
-        <option name="push" value="DATA/vendor/lib/hw/android.hardware.tests.msgq@1.0-impl.so->/vendor/lib/hw/android.hardware.tests.msgq@1.0-impl.so" />
-        <option name="push" value="DATA/vendor/lib64/hw/android.hardware.tests.msgq@1.0-impl.so->/vendor/lib64/hw/android.hardware.tests.msgq@1.0-impl.so" />
+        <option name="push" value="DATA/lib/hw/android.hardware.tests.msgq@1.0-impl.so->/data/local/tmp/system/lib/hw/android.hardware.tests.msgq@1.0-impl.so" />
+        <option name="push" value="DATA/lib64/hw/android.hardware.tests.msgq@1.0-impl.so->/data/local/tmp/system/lib64/hw/android.hardware.tests.msgq@1.0-impl.so" />
         <option name="push" value="DATA/nativetest/android.hardware.tests.msgq@1.0-service-benchmark/android.hardware.tests.msgq@1.0-service-benchmark->/data/local/tmp/32/mq_benchmark_service32" />
         <option name="push" value="DATA/nativetest64/android.hardware.tests.msgq@1.0-service-benchmark/android.hardware.tests.msgq@1.0-service-benchmark->/data/local/tmp/64/mq_benchmark_service64" />
         <option name="push" value="DATA/nativetest/mq_benchmark_client/mq_benchmark_client->/data/local/tmp/32/mq_benchmark_client32" />
@@ -30,6 +29,7 @@
     </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
     <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
-      <option name="test-case-path" value="vts/testcases/performance/fmq_benchmark/FmqPerformanceTest" />
+        <option name="test-case-path" value="vts/testcases/performance/fmq_benchmark/FmqPerformanceTest" />
+        <option name="test-timeout" value="1m"/>
     </test>
 </configuration>
diff --git a/fmq_benchmark/FmqPerformanceTest.py b/fmq_benchmark/FmqPerformanceTest.py
index 3ea35bf..d8032f1 100644
--- a/fmq_benchmark/FmqPerformanceTest.py
+++ b/fmq_benchmark/FmqPerformanceTest.py
@@ -51,7 +51,8 @@
     def setUpClass(self):
         self.dut = self.registerController(android_device)[0]
         self.dut.shell.InvokeTerminal("one")
-        self._cpu_freq = cpu_frequency_scaling.CpuFrequencyScalingController(self.dut)
+        self._cpu_freq = cpu_frequency_scaling.CpuFrequencyScalingController(
+            self.dut)
         self._cpu_freq.DisableCpuScaling()
 
     def tearDownClass(self):
@@ -82,11 +83,14 @@
         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([
-            "chmod 755 %s" % binary, "LD_LIBRARY_PATH=/data/local/tmp/%s:"
+            "chmod 755 %s" % binary,
+            "VTS_ROOT_PATH=/data/local/tmp TREBLE_TESTING_OVERRIDE=true " \
+            "LD_LIBRARY_PATH=/data/local/tmp/%s:"
             "$LD_LIBRARY_PATH %s&" % (bits, binary)
         ])
         asserts.assertEqual(len(results[const.STDOUT]), 2)
-        asserts.assertFalse(any(results[const.EXIT_CODE]),
+        asserts.assertFalse(
+            any(results[const.EXIT_CODE]),
             "Failed to start the benchmark service.")
 
         # Runs the benchmark.
@@ -94,17 +98,19 @@
         binary = "/data/local/tmp/%s/mq_benchmark_client%s" % (bits, bits)
 
         results = self.dut.shell.one.Execute([
-            "chmod 755 %s" % binary, "TREBLE_TESTING_OVERRIDE=true LD_LIBRARY_PATH=/data/local/tmp/%s:"
+            "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`" % bits)
+        self.dut.shell.one.Execute("kill -9 `pidof mq_benchmark_service%s`" %
+                                   bits)
 
         # Parses the result.
         asserts.assertEqual(len(results[const.STDOUT]), 2)
-        asserts.assertFalse(any(results[const.EXIT_CODE]),
-            "FmqPerformanceTest failed.")
+        asserts.assertFalse(
+            any(results[const.EXIT_CODE]), "FmqPerformanceTest failed.")
         read_label = []
         read_latency = []
         write_label = []
@@ -112,16 +118,15 @@
         stdout_lines = results[const.STDOUT][1].split("\n")
         for line in stdout_lines:
             if line.startswith("Average time to read"):
-                read_result = line.replace(
-                    "Average time to read", "").replace(
+                read_result = line.replace("Average time to read", "").replace(
                     "bytes", "").replace("ns", "")
                 (label, value) = read_result.split(": ")
                 read_label.append(label)
                 read_latency.append(int(value))
             if line.startswith("Average time to write"):
-                write_result = line.replace(
-                    "Average time to write ", "").replace(
-                    "bytes", "").replace("ns", "")
+                write_result = line.replace("Average time to write ",
+                                            "").replace("bytes",
+                                                        "").replace("ns", "")
                 (label, value) = write_result.split(": ")
                 write_label.append(label)
                 write_latency.append(int(value))
@@ -156,5 +161,6 @@
                     "%s ns for %s is longer than the threshold %s ns" % (
                         value, label, self.THRESHOLD[bits][label]))
 
+
 if __name__ == "__main__":
     test_runner.main()
diff --git a/hwbinder_benchmark/binderize/AndroidTest.xml b/hwbinder_benchmark/binderize/AndroidTest.xml
index 98b17e7..97bf4a8 100644
--- a/hwbinder_benchmark/binderize/AndroidTest.xml
+++ b/hwbinder_benchmark/binderize/AndroidTest.xml
@@ -31,5 +31,6 @@
         <option name="test-module-name" value="HwBinderBinderizePerformanceTest" />
         <option name="test-case-path" value="vts/testcases/performance/hwbinder_benchmark/HwBinderPerformanceTest" />
         <option name="test-config-path" value="vts/testcases/performance/hwbinder_benchmark/binderize/HwBinderBinderizePerformanceTest.config" />
+        <option name="test-timeout" value="5m"/>
     </test>
 </configuration>
diff --git a/hwbinder_benchmark/binderize_systrace/AndroidTest.xml b/hwbinder_benchmark/binderize_systrace/AndroidTest.xml
index 5445b34..b01f742 100644
--- a/hwbinder_benchmark/binderize_systrace/AndroidTest.xml
+++ b/hwbinder_benchmark/binderize_systrace/AndroidTest.xml
@@ -32,5 +32,6 @@
         <option name="test-case-path" value="vts/testcases/performance/hwbinder_benchmark/HwBinderPerformanceTest" />
         <option name="test-config-path" value="vts/testcases/performance/hwbinder_benchmark/binderize/HwBinderBinderizePerformanceTest.config" />
         <option name="enable-systrace" value="true" />
+        <option name="test-timeout" value="5m"/>
     </test>
 </configuration>
diff --git a/hwbinder_benchmark/passthrough/AndroidTest.xml b/hwbinder_benchmark/passthrough/AndroidTest.xml
index b830778..51fb589 100644
--- a/hwbinder_benchmark/passthrough/AndroidTest.xml
+++ b/hwbinder_benchmark/passthrough/AndroidTest.xml
@@ -31,5 +31,6 @@
         <option name="test-module-name" value="HwBinderPassthroughPerformanceTest" />
         <option name="test-case-path" value="vts/testcases/performance/hwbinder_benchmark/HwBinderPerformanceTest" />
         <option name="test-config-path" value="vts/testcases/performance/hwbinder_benchmark/passthrough/HwBinderPassthroughPerformanceTest.config" />
+        <option name="test-timeout" value="5m"/>
     </test>
 </configuration>
diff --git a/hwbinder_benchmark/passthrough_systrace/AndroidTest.xml b/hwbinder_benchmark/passthrough_systrace/AndroidTest.xml
index d2c1696..28f3cee 100644
--- a/hwbinder_benchmark/passthrough_systrace/AndroidTest.xml
+++ b/hwbinder_benchmark/passthrough_systrace/AndroidTest.xml
@@ -32,5 +32,6 @@
         <option name="test-case-path" value="vts/testcases/performance/hwbinder_benchmark/HwBinderPerformanceTest" />
         <option name="test-config-path" value="vts/testcases/performance/hwbinder_benchmark/passthrough/HwBinderPassthroughPerformanceTest.config" />
         <option name="enable-systrace" value="true" />
+        <option name="test-timeout" value="5m"/>
     </test>
 </configuration>
diff --git a/hwbinder_latency_test/binderize/AndroidTest.xml b/hwbinder_latency_test/binderize/AndroidTest.xml
index f8beb40..6e5e5db 100644
--- a/hwbinder_latency_test/binderize/AndroidTest.xml
+++ b/hwbinder_latency_test/binderize/AndroidTest.xml
@@ -31,5 +31,6 @@
         <option name="test-module-name" value="HwBinderBinderizeLatencyTest" />
         <option name="test-case-path" value="vts/testcases/performance/hwbinder_latency_test/HwBinderLatencyTest" />
         <option name="test-config-path" value="vts/testcases/performance/hwbinder_latency_test/binderize/HwBinderBinderizeLatencyTest.config" />
+        <option name="test-timeout" value="5m"/>
     </test>
 </configuration>
diff --git a/hwbinder_latency_test/binderize_systrace/AndroidTest.xml b/hwbinder_latency_test/binderize_systrace/AndroidTest.xml
index c733f4a..dd3c4b8 100644
--- a/hwbinder_latency_test/binderize_systrace/AndroidTest.xml
+++ b/hwbinder_latency_test/binderize_systrace/AndroidTest.xml
@@ -32,5 +32,6 @@
         <option name="test-case-path" value="vts/testcases/performance/hwbinder_latency_test/HwBinderLatencyTest" />
         <option name="test-config-path" value="vts/testcases/performance/hwbinder_latency_test/binderize/HwBinderBinderizeLatencyTest.config" />
         <option name="enable-systrace" value="true" />
+        <option name="test-timeout" value="5m"/>
     </test>
 </configuration>
diff --git a/hwbinder_latency_test/passthrough/AndroidTest.xml b/hwbinder_latency_test/passthrough/AndroidTest.xml
index 9f99758..4078bf0 100644
--- a/hwbinder_latency_test/passthrough/AndroidTest.xml
+++ b/hwbinder_latency_test/passthrough/AndroidTest.xml
@@ -31,5 +31,6 @@
         <option name="test-module-name" value="HwBinderPassthroughLatencyTest" />
         <option name="test-case-path" value="vts/testcases/performance/hwbinder_latency_test/HwBinderLatencyTest" />
         <option name="test-config-path" value="vts/testcases/performance/hwbinder_latency_test/passthrough/HwBinderPassthroughLatencyTest.config" />
+        <option name="test-timeout" value="5m"/>
     </test>
 </configuration>
diff --git a/hwbinder_latency_test/passthrough_systrace/AndroidTest.xml b/hwbinder_latency_test/passthrough_systrace/AndroidTest.xml
index 86bf365..e8075bd 100644
--- a/hwbinder_latency_test/passthrough_systrace/AndroidTest.xml
+++ b/hwbinder_latency_test/passthrough_systrace/AndroidTest.xml
@@ -32,5 +32,6 @@
         <option name="test-case-path" value="vts/testcases/performance/hwbinder_latency_test/HwBinderLatencyTest" />
         <option name="test-config-path" value="vts/testcases/performance/hwbinder_latency_test/passthrough/HwBinderPassthroughLatencyTest.config" />
         <option name="enable-systrace" value="true" />
+        <option name="test-timeout" value="5m"/>
     </test>
 </configuration>
diff --git a/hwbinder_throughput_test/binderize/AndroidTest.xml b/hwbinder_throughput_test/binderize/AndroidTest.xml
index 895b88d..156511f 100644
--- a/hwbinder_throughput_test/binderize/AndroidTest.xml
+++ b/hwbinder_throughput_test/binderize/AndroidTest.xml
@@ -31,5 +31,6 @@
         <option name="test-module-name" value="HwBinderBinderizeThroughputTest" />
         <option name="test-case-path" value="vts/testcases/performance/hwbinder_throughput_test/HwBinderThroughputBenchmark" />
         <option name="test-config-path" value="vts/testcases/performance/hwbinder_throughput_test/binderize/HwBinderBinderizeThroughputTest.config" />
+        <option name="test-timeout" value="5m"/>
     </test>
 </configuration>
diff --git a/hwbinder_throughput_test/binderize_systrace/AndroidTest.xml b/hwbinder_throughput_test/binderize_systrace/AndroidTest.xml
index 29cc3ed..6f42f98 100644
--- a/hwbinder_throughput_test/binderize_systrace/AndroidTest.xml
+++ b/hwbinder_throughput_test/binderize_systrace/AndroidTest.xml
@@ -32,5 +32,6 @@
         <option name="test-case-path" value="vts/testcases/performance/hwbinder_throughput_test/HwBinderThroughputBenchmark" />
         <option name="test-config-path" value="vts/testcases/performance/hwbinder_throughput_test/binderize/HwBinderBinderizeThroughputTest.config" />
         <option name="enable-systrace" value="true" />
+        <option name="test-timeout" value="5m"/>
     </test>
 </configuration>
diff --git a/hwbinder_throughput_test/passthrough/AndroidTest.xml b/hwbinder_throughput_test/passthrough/AndroidTest.xml
index b22479d..2f75156 100644
--- a/hwbinder_throughput_test/passthrough/AndroidTest.xml
+++ b/hwbinder_throughput_test/passthrough/AndroidTest.xml
@@ -31,5 +31,6 @@
         <option name="test-module-name" value="HwBinderPassthroughThroughputTest" />
         <option name="test-case-path" value="vts/testcases/performance/hwbinder_throughput_test/HwBinderThroughputBenchmark" />
         <option name="test-config-path" value="vts/testcases/performance/hwbinder_throughput_test/passthrough/HwBinderPassthroughThroughputTest.config" />
+        <option name="test-timeout" value="5m"/>
     </test>
 </configuration>
diff --git a/hwbinder_throughput_test/passthrough_systrace/AndroidTest.xml b/hwbinder_throughput_test/passthrough_systrace/AndroidTest.xml
index 41c92f2..09aa535 100644
--- a/hwbinder_throughput_test/passthrough_systrace/AndroidTest.xml
+++ b/hwbinder_throughput_test/passthrough_systrace/AndroidTest.xml
@@ -32,5 +32,6 @@
         <option name="test-case-path" value="vts/testcases/performance/hwbinder_throughput_test/HwBinderThroughputBenchmark" />
         <option name="test-config-path" value="vts/testcases/performance/hwbinder_throughput_test/passthrough/HwBinderPassthroughThroughputTest.config" />
         <option name="enable-systrace" value="true" />
+        <option name="test-timeout" value="5m"/>
     </test>
 </configuration>