summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--minadbd/Android.mk1
-rw-r--r--minadbd/AndroidTest.xml26
-rw-r--r--tests/Android.mk6
-rw-r--r--tests/AndroidTest.xml31
-rw-r--r--update_verifier/Android.mk2
-rw-r--r--update_verifier/update_verifier.rc11
-rw-r--r--updater/blockimg.cpp3
-rw-r--r--updater/install.cpp16
8 files changed, 83 insertions, 13 deletions
diff --git a/minadbd/Android.mk b/minadbd/Android.mk
index 7eef13ee0..de0b0c890 100644
--- a/minadbd/Android.mk
+++ b/minadbd/Android.mk
@@ -29,6 +29,7 @@ include $(CLEAR_VARS)
LOCAL_CLANG := true
LOCAL_MODULE := minadbd_test
+LOCAL_COMPATIBILITY_SUITE := device-tests
LOCAL_SRC_FILES := fuse_adb_provider_test.cpp
LOCAL_CFLAGS := $(minadbd_cflags)
LOCAL_C_INCLUDES := $(LOCAL_PATH) system/core/adb
diff --git a/minadbd/AndroidTest.xml b/minadbd/AndroidTest.xml
new file mode 100644
index 000000000..7ea235b7c
--- /dev/null
+++ b/minadbd/AndroidTest.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for minadbd_test">
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+ <option name="cleanup" value="true" />
+ <option name="push" value="minadbd_test->/data/local/tmp/minadbd_test" />
+ </target_preparer>
+ <option name="test-suite-tag" value="apct" />
+ <test class="com.android.tradefed.testtype.GTest" >
+ <option name="native-test-device-path" value="/data/local/tmp" />
+ <option name="module-name" value="minadbd_test" />
+ </test>
+</configuration> \ No newline at end of file
diff --git a/tests/Android.mk b/tests/Android.mk
index ff6e14c9b..80eae8f37 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -20,7 +20,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CFLAGS := -Werror
LOCAL_MODULE := recovery_unit_test
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_COMPATIBILITY_SUITE := device-tests
LOCAL_STATIC_LIBRARIES := \
libverifier \
libminui \
@@ -45,10 +45,8 @@ include $(BUILD_NATIVE_TEST)
# Manual tests
include $(CLEAR_VARS)
-LOCAL_CLANG := true
LOCAL_CFLAGS := -Werror
LOCAL_MODULE := recovery_manual_test
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_STATIC_LIBRARIES := \
libminui \
libbase
@@ -85,8 +83,8 @@ LOCAL_CFLAGS := \
-Werror \
-D_FILE_OFFSET_BITS=64
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE := recovery_component_test
+LOCAL_COMPATIBILITY_SUITE := device-tests
LOCAL_C_INCLUDES := bootable/recovery
LOCAL_SRC_FILES := \
component/applypatch_test.cpp \
diff --git a/tests/AndroidTest.xml b/tests/AndroidTest.xml
new file mode 100644
index 000000000..3999aa57d
--- /dev/null
+++ b/tests/AndroidTest.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for recovery_component_test and recovery_unit_test">
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+ <option name="cleanup" value="true" />
+ <option name="push" value="recovery_component_test->/data/local/tmp/recovery_component_test" />
+ <option name="push" value="recovery_unit_test->/data/local/tmp/recovery_unit_test" />
+ </target_preparer>
+ <option name="test-suite-tag" value="apct" />
+ <test class="com.android.tradefed.testtype.GTest" >
+ <option name="native-test-device-path" value="/data/local/tmp" />
+ <option name="module-name" value="recovery_component_test" />
+ </test>
+ <test class="com.android.tradefed.testtype.GTest" >
+ <option name="native-test-device-path" value="/data/local/tmp" />
+ <option name="module-name" value="recovery_unit_test" />
+ </test>
+</configuration>
diff --git a/update_verifier/Android.mk b/update_verifier/Android.mk
index c1051a54a..1acd5eca0 100644
--- a/update_verifier/Android.mk
+++ b/update_verifier/Android.mk
@@ -32,6 +32,8 @@ LOCAL_SHARED_LIBRARIES := \
LOCAL_CFLAGS := -Werror
LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
+LOCAL_INIT_RC := update_verifier.rc
+
ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true)
LOCAL_CFLAGS += -DPRODUCT_SUPPORTS_VERITY=1
endif
diff --git a/update_verifier/update_verifier.rc b/update_verifier/update_verifier.rc
new file mode 100644
index 000000000..fc8a64dee
--- /dev/null
+++ b/update_verifier/update_verifier.rc
@@ -0,0 +1,11 @@
+service update_verifier_nonencrypted /system/bin/update_verifier nonencrypted
+ user root
+ class cache
+ priority -20
+ ioprio rt 1
+
+service update_verifier /system/bin/update_verifier ${vold.decrypt}
+ user root
+ class cache
+ priority -20
+ ioprio rt 1 \ No newline at end of file
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index e39fac30d..a1a5773d4 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -18,6 +18,7 @@
#include <errno.h>
#include <dirent.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <linux/fs.h>
#include <pthread.h>
#include <stdarg.h>
@@ -1813,7 +1814,7 @@ Value* CheckFirstBlockFn(const char* name, State* state,
uint16_t mount_count = *reinterpret_cast<uint16_t*>(&block0_buffer[0x400+0x34]);
if (mount_count > 0) {
- uiPrintf(state, "Device was remounted R/W %d times\n", mount_count);
+ uiPrintf(state, "Device was remounted R/W %" PRIu16 " times", mount_count);
uiPrintf(state, "Last remount happened on %s", ctime(&mount_time));
}
diff --git a/updater/install.cpp b/updater/install.cpp
index f91f3fc9f..857d7f1e0 100644
--- a/updater/install.cpp
+++ b/updater/install.cpp
@@ -181,8 +181,8 @@ Value* MountFn(const char* name, State* state, const std::vector<std::unique_ptr
if (mount(location.c_str(), mount_point.c_str(), fs_type.c_str(),
MS_NOATIME | MS_NODEV | MS_NODIRATIME, mount_options.c_str()) < 0) {
- uiPrintf(state, "%s: failed to mount %s at %s: %s\n", name, location.c_str(),
- mount_point.c_str(), strerror(errno));
+ uiPrintf(state, "%s: Failed to mount %s at %s: %s", name, location.c_str(), mount_point.c_str(),
+ strerror(errno));
return StringValue("");
}
@@ -231,12 +231,12 @@ Value* UnmountFn(const char* name, State* state, const std::vector<std::unique_p
scan_mounted_volumes();
MountedVolume* vol = find_mounted_volume_by_mount_point(mount_point.c_str());
if (vol == nullptr) {
- uiPrintf(state, "unmount of %s failed; no such volume\n", mount_point.c_str());
+ uiPrintf(state, "Failed to unmount %s: No such volume", mount_point.c_str());
return nullptr;
} else {
int ret = unmount_mounted_volume(vol);
if (ret != 0) {
- uiPrintf(state, "unmount of %s failed (%d): %s\n", mount_point.c_str(), ret, strerror(errno));
+ uiPrintf(state, "Failed to unmount %s: %s", mount_point.c_str(), strerror(errno));
}
}
@@ -699,15 +699,15 @@ Value* ApplyPatchCheckFn(const char* name, State* state, const std::vector<std::
return StringValue(result == 0 ? "t" : "");
}
-// This is the updater side handler for ui_print() in edify script. Contents
-// will be sent over to the recovery side for on-screen display.
+// This is the updater side handler for ui_print() in edify script. Contents will be sent over to
+// the recovery side for on-screen display.
Value* UIPrintFn(const char* name, State* state, const std::vector<std::unique_ptr<Expr>>& argv) {
std::vector<std::string> args;
if (!ReadArgs(state, argv, &args)) {
- return ErrorAbort(state, kArgsParsingFailure, "%s() Failed to parse the argument(s)", name);
+ return ErrorAbort(state, kArgsParsingFailure, "%s(): Failed to parse the argument(s)", name);
}
- std::string buffer = android::base::Join(args, "") + "\n";
+ std::string buffer = android::base::Join(args, "");
uiPrint(state, buffer);
return StringValue(buffer);
}