From 4102b281324eca22cd4ef0922a79949ec6cf846e Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 2 Nov 2016 16:17:17 -0700 Subject: tests: Set up testdata path for continuous native tests. continuous_native_tests expects the testdata under DATA/ in continuous_native_tests.zip. This CL packs a copy of the testdata into continuous_native_tests.zip as DATA/nativetest/recovery/testdata (via LOCAL_PICKUP_FILES). This CL also removes the extra copy for nativetest64. Testdata will always stay at /data/nativetest/recovery/testdata, even for 64-bit version. Otherwise we will unnecessarily get four copies (two for data/ and another two for DATA/). Bug: 32123241 Test: mmma bootable/recovery && adb sync data. On bullhead, /data/nativetest/recovery_component_test/recovery_component_test works; /data/nativetest64/recovery_component_test/recovery_component_test works. Test: m continuous_native_test; DATA/nativetest/recovery/testdata exists. Change-Id: Ifefa0309de7af23c77654e8e450848ca2da218c2 --- tests/component/verifier_test.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'tests/component/verifier_test.cpp') diff --git a/tests/component/verifier_test.cpp b/tests/component/verifier_test.cpp index 7f9a71408..60a78f5c3 100644 --- a/tests/component/verifier_test.cpp +++ b/tests/component/verifier_test.cpp @@ -37,9 +37,6 @@ #include "ui.h" #include "verifier.h" -static const char* DATA_PATH = getenv("ANDROID_DATA"); -static const char* TESTDATA_PATH = "/recovery/testdata/"; - RecoveryUI* ui = NULL; class MockUI : public RecoveryUI { @@ -92,17 +89,13 @@ class VerifierTest : public testing::TestWithParam> { virtual void SetUp() { std::vector args = GetParam(); - std::string package = - android::base::StringPrintf("%s%s%s%s", DATA_PATH, NATIVE_TEST_PATH, - TESTDATA_PATH, args[0].c_str()); + std::string package = from_testdata_base(args[0]); if (sysMapFile(package.c_str(), &memmap) != 0) { FAIL() << "Failed to mmap " << package << ": " << strerror(errno) << "\n"; } for (auto it = ++(args.cbegin()); it != args.cend(); ++it) { - std::string public_key_file = android::base::StringPrintf( - "%s%s%stestkey_%s.txt", DATA_PATH, NATIVE_TEST_PATH, - TESTDATA_PATH, it->c_str()); + std::string public_key_file = from_testdata_base("testkey_" + *it + ".txt"); ASSERT_TRUE(load_keys(public_key_file.c_str(), certs)); } } -- cgit v1.2.3