Select AshmemTest tests from libcutils tests

Change-Id: I2fb733ef03fa401352da853667d4254c46ce2924
Fix: 37168337
Bug: 36902435
Test: local vts-tradefed
diff --git a/api/libcutils/AndroidTest.xml b/api/libcutils/AndroidTest.xml
index da75eec..0eaea07 100644
--- a/api/libcutils/AndroidTest.xml
+++ b/api/libcutils/AndroidTest.xml
@@ -24,6 +24,7 @@
         <option name="binary-test-source" value="_32bit::DATA/nativetest/libcutils_test/libcutils_test32" />
         <option name="binary-test-source" value="_64bit::DATA/nativetest64/libcutils_test/libcutils_test64" />
         <option name="binary-test-type" value="gtest"/>
+        <option name="test-case-path" value="vts/testcases/kernel/api/libcutils/VtsKernelLibcutilsTest" />
         <option name="test-timeout" value="10m"/>
     </test>
 </configuration>
diff --git a/api/libcutils/VtsKernelLibcutilsTest.py b/api/libcutils/VtsKernelLibcutilsTest.py
new file mode 100644
index 0000000..ef56eb0
--- /dev/null
+++ b/api/libcutils/VtsKernelLibcutilsTest.py
@@ -0,0 +1,65 @@
+#
+# 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
+
+from vts.runners.host import asserts
+from vts.runners.host import test_runner
+
+from vts.testcases.template.gtest_binary_test import gtest_binary_test
+
+
+class VtsKernelLibcutilsTest(gtest_binary_test.GtestBinaryTest):
+    '''Test runner script for kernel libctils test.
+
+    Attributes:
+        include_test_suite: list of string, gtest test suite names to include.
+    '''
+
+    include_test_suite = ["AshmemTest"]
+
+    # Override
+    def filterOneTest(self, test_name):
+        """Check test filters for a test name.
+
+        The first layer of filter is user defined test filters:
+        if a include filter is not empty, only tests in include filter will
+        be executed regardless whether they are also in exclude filter. Else
+        if include filter is empty, only tests not in exclude filter will be
+        executed.
+
+        The second layer of filter is checking abi bitness:
+        if a test has a suffix indicating the intended architecture bitness,
+        and the current abi bitness information is available, non matching tests
+        will be skipped. By our convention, this function will look for bitness in suffix
+        formated as "32bit", "32Bit", "32BIT", or 64 bit equivalents.
+
+        This method assumes  const.SUFFIX_32BIT and const.SUFFIX_64BIT are in lower cases.
+
+        Args:
+            test_name: string, name of a test
+
+        Raises:
+            signals.TestSilent if a test should not be executed
+        """
+        super(VtsKernelLibcutilsTest, self).filterOneTest(test_name)
+        asserts.skipIf(
+            test_name.split('.')[0] not in self.include_test_suite,
+            'Test case not selected.')
+
+
+if __name__ == "__main__":
+    test_runner.main()
diff --git a/api/libcutils/__init__.py b/api/libcutils/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/api/libcutils/__init__.py