diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-09 20:19:11 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2023-07-09 20:19:11 +0000 |
commit | 76c9a7a16525e70ce581bb78950af896242ae9e2 (patch) | |
tree | 5fff678e4b916841fa0c1a9ecd0fbd4f137cb536 | |
parent | f049fcc65db9fe4f9909c8efd0f1d560421446e0 (diff) | |
parent | b8a1cf22dbe5cd6cd2009b3ec106e83383e10e4d (diff) | |
download | cts-sparse-10469326-L56600000962034925.tar.gz |
Merge "Snap for 10459544 from aa6a03e48a745461973d2cd4e7170e1b8f47b2d0 to android12-tests-release" into android12-tests-releasesparse-10469326-L56600000962034925
3 files changed, 19 insertions, 14 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); } diff --git a/tests/tests/jni/libjnitest/android_jni_cts_LinkerNamespacesTest.cpp b/tests/tests/jni/libjnitest/android_jni_cts_LinkerNamespacesTest.cpp index 45b26830f8a..741037f4bbe 100644 --- a/tests/tests/jni/libjnitest/android_jni_cts_LinkerNamespacesTest.cpp +++ b/tests/tests/jni/libjnitest/android_jni_cts_LinkerNamespacesTest.cpp @@ -91,7 +91,7 @@ static bool is_directory(const char* path) { static bool not_accessible(const std::string& err) { return err.find("dlopen failed: library \"") == 0 && - err.find("is not accessible for the namespace \"classloader-namespace\"") != std::string::npos; + err.find("is not accessible for the namespace \"") != std::string::npos; } static bool not_found(const std::string& err) { diff --git a/tools/cts-tradefed/res/config/cts-common.xml b/tools/cts-tradefed/res/config/cts-common.xml index c1dffd2426f..e7e082a0ba6 100644 --- a/tools/cts-tradefed/res/config/cts-common.xml +++ b/tools/cts-tradefed/res/config/cts-common.xml @@ -36,6 +36,11 @@ <option name="teardown-command" value="settings put global package_verifier_enable 1"/> </target_preparer> + <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer"> + <option name="run-command" value="settings put global verifier_engprod 1" /> + <option name="teardown-command" value="settings put global verifier_engprod 0"/> + </target_preparer> + <target_preparer class="com.android.compatibility.common.tradefed.targetprep.PropertyCheck"> <option name="property-name" value="ro.build.type" /> <option name="expected-value" value="user"/> <!-- Device should have user build --> |