summaryrefslogtreecommitdiff
path: root/files/vts_vndk_files_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'files/vts_vndk_files_test.py')
-rw-r--r--files/vts_vndk_files_test.py42
1 files changed, 17 insertions, 25 deletions
diff --git a/files/vts_vndk_files_test.py b/files/vts_vndk_files_test.py
index 1563d24..17539e7 100644
--- a/files/vts_vndk_files_test.py
+++ b/files/vts_vndk_files_test.py
@@ -101,28 +101,24 @@ class VtsVndkFilesTest(unittest.TestCase):
"The above libraries are not %s." %
", ".join(vndk_list_names))
- def _TestNotInVndkDirecotory(self, vndk_dir, vndk_list_names, except_libs):
- """Verifies that VNDK directory doesn't contain specific files.
+ def _TestNoLlndkInDirectory(self, lib_dir):
+ """Verifies that the vendor directory doesn't contain LLNDK libraries.
Args:
- vndk_dir, The path to the VNDK directory on device.
- vndk_list_names: A list of strings, the categories of the VNDK
- libraries that should not be in the directory.
- except_libs: A set of strings, the file names of the libraries that
- are exceptions to this test.
+ lib_dir: The path to the directory on device.
"""
- vndk_lists = vndk_data.LoadVndkLibraryListsFromResources(
- self._vndk_version, *vndk_list_names)
- self.assertTrue(vndk_lists, "Cannot load VNDK library lists.")
- vndk_set = set().union(*vndk_lists)
- vndk_set.difference_update(except_libs)
- logging.debug("vndk set: %s", vndk_set)
- unexpected = [x for x in self._ListFiles(vndk_dir) if
- target_path_module.basename(x) in vndk_set]
+ if vndk_utils.IsVndkRequired(self._dut):
+ llndk_list = vndk_data.LoadVndkLibraryListsFromResources(
+ self._vndk_version, vndk_data.LL_NDK)[0]
+ else:
+ llndk_list = self._dut.GetLlndkList()
+ llndk_set = set(llndk_list).difference(self._LL_NDK_COLLIDING_NAMES)
+ logging.debug("llndk set: %s", llndk_set)
+ unexpected = [x for x in self._ListFiles(lib_dir) if
+ target_path_module.basename(x) in llndk_set]
if unexpected:
self._Fail(unexpected,
- "%s must not contain %s libraries." %
- (vndk_dir, ", ".join(vndk_list_names)))
+ lib_dir + " must not contain LLNDK libraries.")
def _TestVndkCoreDirectory(self, bitness):
"""Verifies that VNDK directory doesn't contain extra files."""
@@ -159,10 +155,8 @@ class VtsVndkFilesTest(unittest.TestCase):
def _TestNoLlndkInVendor(self, bitness):
"""Verifies that vendor partition has no LL-NDK libraries."""
- self._TestNotInVndkDirecotory(
- vndk_utils.FormatVndkPath(self._TARGET_VENDOR_LIB, bitness),
- (vndk_data.LL_NDK,),
- self._LL_NDK_COLLIDING_NAMES)
+ self._TestNoLlndkInDirectory(
+ vndk_utils.FormatVndkPath(self._TARGET_VENDOR_LIB, bitness))
def testNoLlndkInVendor32(self):
"""Runs _TestNoLlndkInVendor for 32-bit libraries."""
@@ -178,10 +172,8 @@ class VtsVndkFilesTest(unittest.TestCase):
def _TestNoLlndkInOdm(self, bitness):
"""Verifies that odm partition has no LL-NDK libraries."""
- self._TestNotInVndkDirecotory(
- vndk_utils.FormatVndkPath(self._TARGET_ODM_LIB, bitness),
- (vndk_data.LL_NDK,),
- self._LL_NDK_COLLIDING_NAMES)
+ self._TestNoLlndkInDirectory(
+ vndk_utils.FormatVndkPath(self._TARGET_ODM_LIB, bitness))
def testNoLlndkInOdm32(self):
"""Runs _TestNoLlndkInOdm for 32-bit libraries."""