summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBin Tan <bint@google.com>2021-10-20 21:45:45 +0000
committerAndroid Build Cherrypicker Worker <android-build-cherrypicker-worker@google.com>2023-06-27 21:02:57 +0000
commitd1ca803611c85f228c07f344f26d40130863fc81 (patch)
tree7f71b9124b68cf6e5a5756b3ae734183cb11084d
parente3a23d24b6a39a62119d56392390edff92807b81 (diff)
downloadcts-d1ca803611c85f228c07f344f26d40130863fc81.tar.gz
Integrate Watchdog disabling/enabling for the CTS
integrated the performance monitoring watchdog disableing/enabling shell command into CtsFileSystemTestCases for Android Auto Bug: 202761235 Test: atest CtsFileSystemTestCases atest --instant CtsFileSystemTestCases cts-tradefed -m CtsFileSystemTestCases (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:33afc2b3dd8bb63343040b49486f0a1599856fa6) Merged-In: I422b75fa1637dfa82a92406ec8ee8b77f14968b5 Change-Id: I422b75fa1637dfa82a92406ec8ee8b77f14968b5
-rw-r--r--tests/filesystem/src/android/filesystem/cts/CarTestUtil.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/filesystem/src/android/filesystem/cts/CarTestUtil.java b/tests/filesystem/src/android/filesystem/cts/CarTestUtil.java
index c2290cb1e4c..168d26f127e 100644
--- a/tests/filesystem/src/android/filesystem/cts/CarTestUtil.java
+++ b/tests/filesystem/src/android/filesystem/cts/CarTestUtil.java
@@ -30,10 +30,13 @@ import com.android.compatibility.common.util.SystemUtil;
import java.io.IOException;
final class CarTestUtil {
- //TODO (b/202761235) replace the string with the watchdog service disabling shell command
- private static final String DISABLE_CAR_WATCHDOG_COMMAND = "cmd disable watchdog";
- //TODO (b/202761235) replace the string with the watchdog service enabling shell command
- private static final String ENABLE_CAR_WATCHDOG_COMMAND = "cmd enable watchdog";
+ private static final String ANDROID_FILESYSTEM_CTS_PKG_NAME = "android.filesystem.cts";
+ private static final String SET_CTS_PKG_AS_NOT_KILLABLE_COMMAND =
+ "cmd car_service watchdog-control-package-killable-state false "
+ + ANDROID_FILESYSTEM_CTS_PKG_NAME;
+ private static final String SET_CTS_PKG_AS_KILLABLE_COMMAND =
+ "cmd car_service watchdog-control-package-killable-state true "
+ + ANDROID_FILESYSTEM_CTS_PKG_NAME;
private static final String PERMISSION_USE_CAR_WATCHDOG =
"android.car.permission.USE_CAR_WATCHDOG";
@@ -60,26 +63,23 @@ final class CarTestUtil {
public void setUp() throws Exception {
if (mIsAutomotive) {
assumeFalse("For automotive, instant app is skipped", mIsInstantApp);
- disableWatchdogService();
+ setCtsPackageAsNotKillable();
}
}
public void tearDown() throws Exception {
if (mIsAutomotive) {
- enableWatchdogService();
+ setCtsPackageAsKillable();
}
}
- protected void disableWatchdogService() throws Exception {
- // TODO (b/202761235) remove the assumption after watchdog disabling is implemented.
- assumeFalse("Enable tests over Auto after watchdog is disabled", mIsAutomotive);
-
- executeShellCommandWithPermission(DISABLE_CAR_WATCHDOG_COMMAND,
+ protected void setCtsPackageAsNotKillable() throws Exception {
+ executeShellCommandWithPermission(SET_CTS_PKG_AS_NOT_KILLABLE_COMMAND,
PERMISSION_USE_CAR_WATCHDOG);
}
- protected void enableWatchdogService() throws Exception {
- executeShellCommandWithPermission(ENABLE_CAR_WATCHDOG_COMMAND,
+ protected void setCtsPackageAsKillable() throws Exception {
+ executeShellCommandWithPermission(SET_CTS_PKG_AS_KILLABLE_COMMAND,
PERMISSION_USE_CAR_WATCHDOG);
}