Fix poc test VTS build rule.
Update PoC tests to use standard VTS build structure instead
of custom build rules to non-standard paths. Update test to
use those directories.
Test: rm -rf out/host/linux-x86/vts; make vts -j60; run vts -m
SecurityPoCKernelTestStaging
Bug: 35269811
Change-Id: I4ec20e4c7297eae21ab9a2922c46d0cc6d5001f5
(cherry picked from commit bfa19fbe426d9f099516b8824317e61233aa7aa2)
diff --git a/poc/host/SecurityPoCKernelTest.py b/poc/host/SecurityPoCKernelTest.py
index 554ebe3..738643a 100644
--- a/poc/host/SecurityPoCKernelTest.py
+++ b/poc/host/SecurityPoCKernelTest.py
@@ -42,6 +42,7 @@
"""Creates device under test instance, and copies data files."""
required_params = [
keys.ConfigKeys.IKEY_DATA_FILE_PATH,
+ keys.ConfigKeys.IKEY_ABI_BITNESS,
config.ConfigKeys.RUN_STAGING
]
self.getUserParams(required_params)
@@ -62,7 +63,11 @@
"""adb pushes related file to target."""
self._dut.adb.shell("mkdir %s -p" % config.POC_TEST_DIR)
- push_src = os.path.join(self.data_file_path, "security", "poc", ".")
+ bitness = getattr(self, keys.ConfigKeys.IKEY_ABI_BITNESS)
+ bitness_suffix = "64" if bitness == "64" else ""
+ native_test_dir = "nativetest{0}".format(bitness_suffix)
+ push_src = os.path.join(self.data_file_path, "DATA", native_test_dir,
+ "security", "poc", ".")
self._dut.adb.push("%s %s" % (push_src, config.POC_TEST_DIR))
def CreateHostInput(self, testcase):
@@ -78,9 +83,10 @@
"""
out = self._dut.adb.shell("getprop ro.product.model")
device_model = out.strip()
-
+ testcase_path = os.path.join(*testcase.split("/"))
test_config_path = os.path.join(
- self.data_file_path, "security", "poc", testcase + ".config")
+ self.data_file_path, "vts", "testcases", "security", "poc",
+ "target", testcase_path, "poc.config")
with open(test_config_path) as test_config_file:
poc_config = json.load(test_config_file)["target_models"]
diff --git a/poc/target/Android.poc_test.mk b/poc/target/Android.poc_test.mk
index 36b7df1..0dc1643 100644
--- a/poc/target/Android.poc_test.mk
+++ b/poc/target/Android.poc_test.mk
@@ -15,7 +15,7 @@
#
# Compiles a PoC test module into an executable and copies it into
-# android-vts/testcases/security/poc/ directory.
+# android-vts/testcases/DATA/nativetest(64)/security/poc/ directory.
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
@@ -49,9 +49,6 @@
include $(BUILD_EXECUTABLE)
-# Copy resulting executable to vts directory.
-include $(poc_target_dir)/Android.vts_testcase.mk
-
module_name :=
module_path :=
vts_src_file :=
diff --git a/poc/target/Android.vts_testcase.mk b/poc/target/Android.vts_testcase.mk
deleted file mode 100644
index dca5cd8..0000000
--- a/poc/target/Android.vts_testcase.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Copyright (C) 2016 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.
-#
-
-VTS_TESTCASES_OUT := $(HOST_OUT)/vts/android-vts/testcases
-
-# Copy test executable.
-vts_src_file := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(module_path)/$(module_name)
-vts_dst_file := $(VTS_TESTCASES_OUT)/$(module_path)/$(module_name)
-
-$(vts_dst_file): $(vts_src_file) | $(ACP)
- $(hide) mkdir -p $(dir $(vts_dst_file))
- $(hide) $(ACP) -fp $< $@
-vts: $(vts_dst_file)
-
-# Copy test config.
-vts_src_file := $(poc_target_dir)/$(dir $(module_testname))/$(module_name)/poc.config
-vts_dst_file := $(VTS_TESTCASES_OUT)/$(module_path)/$(module_name).config
-
-$(vts_dst_file): $(vts_src_file) | $(ACP)
- $(hide) mkdir -p $(dir $(vts_dst_file))
- $(hide) $(ACP) -fp $< $@
-vts: $(vts_dst_file)