Merge "AuthSecret: schedule target VTS tests."
diff --git a/broadcastradio/V1_2/build/Android.bp b/broadcastradio/V1_2/build/Android.bp
deleted file mode 100644
index ad029c6..0000000
--- a/broadcastradio/V1_2/build/Android.bp
+++ /dev/null
@@ -1,113 +0,0 @@
-// This file was auto-generated. Do not edit manually.
-// Use test/vts-testcase/hal/script/update_makefiles.py to generate this file.
-
-// Generate .vts spec files.
-hal2vts {
-    name: "android.hardware.broadcastradio@1.2-vts.spec",
-    srcs: [
-        ":android.hardware.broadcastradio@1.2_hal",
-    ],
-    out: [
-        "android/hardware/broadcastradio/1.2/BroadcastRadioFactory.vts",
-        "android/hardware/broadcastradio/1.2/Tuner.vts",
-        "android/hardware/broadcastradio/1.2/TunerCallback.vts",
-        "android/hardware/broadcastradio/1.2/types.vts",
-    ],
-}
-
-// Build VTS driver.
-genrule {
-    name: "android.hardware.broadcastradio@1.2-vts.driver_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.broadcastradio@1.2 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/broadcastradio/1.2/ $(genDir)/android/hardware/broadcastradio/1.2/",
-    srcs: [
-        ":android.hardware.broadcastradio@1.2_hal",
-    ],
-    out: [
-        "android/hardware/broadcastradio/1.2/BroadcastRadioFactory.vts.cpp",
-        "android/hardware/broadcastradio/1.2/Tuner.vts.cpp",
-        "android/hardware/broadcastradio/1.2/TunerCallback.vts.cpp",
-        "android/hardware/broadcastradio/1.2/types.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.broadcastradio@1.2-vts.driver_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.broadcastradio@1.2 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/broadcastradio/1.2/ $(genDir)/android/hardware/broadcastradio/1.2/",
-    srcs: [
-        ":android.hardware.broadcastradio@1.2_hal",
-    ],
-    out: [
-        "android/hardware/broadcastradio/1.2/BroadcastRadioFactory.vts.h",
-        "android/hardware/broadcastradio/1.2/Tuner.vts.h",
-        "android/hardware/broadcastradio/1.2/TunerCallback.vts.h",
-        "android/hardware/broadcastradio/1.2/types.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.broadcastradio@1.2-vts.driver",
-    generated_sources: ["android.hardware.broadcastradio@1.2-vts.driver_genc++"],
-    generated_headers: ["android.hardware.broadcastradio@1.2-vts.driver_genc++_headers"],
-    export_generated_headers: ["android.hardware.broadcastradio@1.2-vts.driver_genc++_headers"],
-    defaults: ["VtsHalDriverDefaults"],
-    shared_libs: [
-        "android.hardware.broadcastradio@1.0-vts.driver",
-        "android.hardware.broadcastradio@1.1-vts.driver",
-    ],
-    static_libs: [
-        "android.hardware.broadcastradio@1.0",
-        "android.hardware.broadcastradio@1.1",
-        "android.hardware.broadcastradio@1.2",
-    ],
-}
-
-// Build VTS profiler.
-genrule {
-    name: "android.hardware.broadcastradio@1.2-vts.profiler_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.broadcastradio@1.2 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/broadcastradio/1.2/ $(genDir)/android/hardware/broadcastradio/1.2/",
-    srcs: [
-        ":android.hardware.broadcastradio@1.2_hal",
-    ],
-    out: [
-        "android/hardware/broadcastradio/1.2/BroadcastRadioFactory.vts.cpp",
-        "android/hardware/broadcastradio/1.2/Tuner.vts.cpp",
-        "android/hardware/broadcastradio/1.2/TunerCallback.vts.cpp",
-        "android/hardware/broadcastradio/1.2/types.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.broadcastradio@1.2-vts.profiler_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.broadcastradio@1.2 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/broadcastradio/1.2/ $(genDir)/android/hardware/broadcastradio/1.2/",
-    srcs: [
-        ":android.hardware.broadcastradio@1.2_hal",
-    ],
-    out: [
-        "android/hardware/broadcastradio/1.2/BroadcastRadioFactory.vts.h",
-        "android/hardware/broadcastradio/1.2/Tuner.vts.h",
-        "android/hardware/broadcastradio/1.2/TunerCallback.vts.h",
-        "android/hardware/broadcastradio/1.2/types.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.broadcastradio@1.2-vts.profiler",
-    generated_sources: ["android.hardware.broadcastradio@1.2-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.broadcastradio@1.2-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.broadcastradio@1.2-vts.profiler_genc++_headers"],
-    defaults: ["VtsHalProfilerDefaults"],
-    shared_libs: [
-        "android.hardware.broadcastradio@1.0-vts.profiler",
-        "android.hardware.broadcastradio@1.1-vts.profiler",
-    ],
-    static_libs: [
-        "android.hardware.broadcastradio@1.0",
-        "android.hardware.broadcastradio@1.1",
-        "android.hardware.broadcastradio@1.2",
-    ],
-}
-
diff --git a/media/omx/V1_0/host/VtsHalMediaOmxV1_0HostTest.py b/media/omx/V1_0/host/VtsHalMediaOmxV1_0HostTest.py
index 338c1d9..c59f582 100644
--- a/media/omx/V1_0/host/VtsHalMediaOmxV1_0HostTest.py
+++ b/media/omx/V1_0/host/VtsHalMediaOmxV1_0HostTest.py
@@ -15,6 +15,7 @@
 # limitations under the License.
 #
 
+import copy
 import logging
 import time
 
@@ -22,7 +23,6 @@
 from vts.runners.host import keys
 from vts.runners.host import test_runner
 from vts.testcases.template.hal_hidl_gtest import hal_hidl_gtest
-import VtsHalMediaOmxV1_0TestCase as omx_test_case
 
 
 class VtsHalMediaOmxV1_0Host(hal_hidl_gtest.HidlHalGTest):
@@ -116,12 +116,11 @@
                         continue
                     if self.VIDEO_DEC_TEST in test_suite and not "video_decoder" in role:
                         continue
-                    test_name = component + '_' + role
-                    # TODO (zhuoyao): get instance name using lshal.
-                    instance_name = "default"
-                    test_case = omx_test_case.VtsHalMediaOmxV1_0TestCase(
-                        component, role, instance_name, test_suite, test_name,
-                        path, tag)
+
+                    test_case = copy.copy(gtest_case)
+                    test_case.args += " -C " + component
+                    test_case.args += " -R " + role
+                    test_case.tag = component + '_' + role + test_case.tag
                     test_cases.append(test_case)
         logging.info("num of test_testcases: %s", len(test_cases))
         return test_cases
diff --git a/media/omx/V1_0/host/VtsHalMediaOmxV1_0TestCase.py b/media/omx/V1_0/host/VtsHalMediaOmxV1_0TestCase.py
deleted file mode 100644
index 53b2189..0000000
--- a/media/omx/V1_0/host/VtsHalMediaOmxV1_0TestCase.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-import logging
-import os
-
-from vts.testcases.template.gtest_binary_test import gtest_test_case
-
-class VtsHalMediaOmxV1_0TestCase(gtest_test_case.GtestTestCase):
-    """A class to represent a media_omx test case.
-
-    Attributes:
-        component: string, name of a IOmxNode component.
-        role: string, role of a IOmxNode component.
-        instance: string, name of the binderized hal server instance.
-    """
-
-    def __init__(self, component, role, instance, *args, **kwargs):
-        super(VtsHalMediaOmxV1_0TestCase, self).__init__(*args, **kwargs)
-        self._component = component
-        self._role = role
-        self._instance = instance
-
-    # @Override
-    def GetRunCommand(self):
-        """Get the command to run the test. """
-
-        orig_cmds = super(VtsHalMediaOmxV1_0TestCase,
-                          self).GetRunCommand(test_name=self.test_suite),
-
-        new_cmd = [('{cmd} -I {instance} -C {component} -R {role}').format(
-            cmd=orig_cmds[0][0],
-            instance=self._instance,
-            component=self._component,
-            role=self._role), orig_cmds[0][1]]
-
-        return new_cmd
diff --git a/wifi/V1_0/host/VtsHalWifiV1_0HostTest.py b/wifi/V1_0/host/VtsHalWifiV1_0HostTest.py
index c2c313d..61f8461 100644
--- a/wifi/V1_0/host/VtsHalWifiV1_0HostTest.py
+++ b/wifi/V1_0/host/VtsHalWifiV1_0HostTest.py
@@ -20,7 +20,6 @@
 from vts.runners.host import const
 from vts.runners.host import test_runner
 from vts.testcases.template.hal_hidl_gtest import hal_hidl_gtest
-from vts.testcases.hal.wifi.V1_0.host import VtsHalWifiV1_0TestCase as wifi_test_case
 
 
 class VtsHalWifiV1_0Host(hal_hidl_gtest.HidlHalGTest):
@@ -47,13 +46,10 @@
             A list of VtsHalWifiV1_0TestCase objects
         """
         gtest_cases = super(VtsHalWifiV1_0Host, self).CreateTestCase(path, tag)
-        test_cases = []
         for gtest_case in gtest_cases:
-            test_case = wifi_test_case.VtsHalWifiV1_0TestCase(
-                self._nan_on, gtest_case.full_name, gtest_case.test_name, path)
-            test_cases.append(test_case)
-        logging.info("num of test_testcases: %s", len(test_cases))
-        return test_cases
+            if self._nan_on:
+                gtest_cases.args += "--nan_on"
+        return gtest_cases
 
 
 if __name__ == "__main__":
diff --git a/wifi/V1_0/host/VtsHalWifiV1_0TestCase.py b/wifi/V1_0/host/VtsHalWifiV1_0TestCase.py
deleted file mode 100644
index bc8af65..0000000
--- a/wifi/V1_0/host/VtsHalWifiV1_0TestCase.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-from vts.testcases.template.gtest_binary_test import gtest_test_case
-
-class VtsHalWifiV1_0TestCase(gtest_test_case.GtestTestCase):
-    """A class to represent a WiFi HAL VTS test case.
-
-    Attributes:
-        _nan: boolean, whether WiFi NAN feature is supported on the device.
-    """
-
-    def __init__(self, nan, *args, **kwargs):
-        super(VtsHalWifiV1_0TestCase, self).__init__(*args, **kwargs)
-        self._nan = nan
-
-    # @Override
-    def GetRunCommand(self):
-        """Get the command to run the test. """
-        orig_cmds = super(VtsHalWifiV1_0TestCase,
-                          self).GetRunCommand(test_name=self.test_suite),
-        new_cmd = [('{cmd}{nan_on}').format(
-            cmd=orig_cmds[0][0], nan_on=" --nan_on" if self._nan else ""),
-            orig_cmds[0][1]]
-        return new_cmd