diff options
author | 2024-11-15 22:46:31 +0000 | |
---|---|---|
committer | 2024-11-19 16:52:03 +0000 | |
commit | e65b712edc542a1f9c4fec99bc03df783c7c68a1 (patch) | |
tree | ef43149fe7f1e5eb6086a04654bed43a6818b5dc | |
parent | 5e5cbd91497fee640eecb58873e89a008d536658 (diff) |
Clean up dexopt_chroot_setup_test.
Bug: 333994945
Change-Id: I60447fed62fb7f20474b0755c6bfd85835fa3a8a
Test: Presubmit
-rw-r--r-- | dexopt_chroot_setup/Android.bp | 1 | ||||
-rw-r--r-- | dexopt_chroot_setup/art_standalone_dexopt_chroot_setup_tests.xml | 5 | ||||
-rw-r--r-- | dexopt_chroot_setup/dexopt_chroot_setup_test.cc | 19 |
3 files changed, 2 insertions, 23 deletions
diff --git a/dexopt_chroot_setup/Android.bp b/dexopt_chroot_setup/Android.bp index 0b4ce9669d..e51dfc0393 100644 --- a/dexopt_chroot_setup/Android.bp +++ b/dexopt_chroot_setup/Android.bp @@ -84,7 +84,6 @@ art_cc_test { "libarttools", "libbase", "libgmock", - "libselinux", ], test_config_template: "art_standalone_dexopt_chroot_setup_tests.xml", } diff --git a/dexopt_chroot_setup/art_standalone_dexopt_chroot_setup_tests.xml b/dexopt_chroot_setup/art_standalone_dexopt_chroot_setup_tests.xml index e4ba301579..3ec1692abd 100644 --- a/dexopt_chroot_setup/art_standalone_dexopt_chroot_setup_tests.xml +++ b/dexopt_chroot_setup/art_standalone_dexopt_chroot_setup_tests.xml @@ -43,7 +43,6 @@ <option name="mainline-module-package-name" value="com.android.art" /> </object> - <!-- Only run tests if the device under test is SDK version 34 (Android 14) or above. --> - <!-- TODO(jiakaiz): Change it to 35 once the SDK version is bumped. --> - <object type="module_controller" class="com.android.tradefed.testtype.suite.module.Sdk34ModuleController" /> + <!-- Only run tests if the device under test is SDK version 35 (Android 15) or above. --> + <object type="module_controller" class="com.android.tradefed.testtype.suite.module.Sdk35ModuleController" /> </configuration> diff --git a/dexopt_chroot_setup/dexopt_chroot_setup_test.cc b/dexopt_chroot_setup/dexopt_chroot_setup_test.cc index bbe0da352c..aa0eb5e604 100644 --- a/dexopt_chroot_setup/dexopt_chroot_setup_test.cc +++ b/dexopt_chroot_setup/dexopt_chroot_setup_test.cc @@ -35,7 +35,6 @@ #include "exec_utils.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "selinux/selinux.h" #include "tools/binder_utils.h" #include "tools/cmdline_builder.h" @@ -58,24 +57,6 @@ class DexoptChrootSetupTest : public CommonArtTest { CommonArtTest::SetUp(); dexopt_chroot_setup_ = ndk::SharedRefBase::make<DexoptChrootSetup>(); - // TODO(jiakaiz): Delete this one the SDK version is bumped to 35. - char* con; - if (getfilecon(DexoptChrootSetup::PRE_REBOOT_DEXOPT_DIR, &con) < 0) { - ASSERT_EQ(errno, ENOENT) << ART_FORMAT("Failed to getfilecon '{}': {}", - DexoptChrootSetup::PRE_REBOOT_DEXOPT_DIR, - strerror(errno)); - GTEST_SKIP() << ART_FORMAT("This platform is too old and doesn't have directory '{}'", - DexoptChrootSetup::PRE_REBOOT_DEXOPT_DIR); - } - { - auto cleanup = ScopeGuard([&]() { freecon(con); }); - constexpr std::string_view kExpectedCon = "u:object_r:pre_reboot_dexopt_file:s0"; - if (con != kExpectedCon) { - GTEST_SKIP() << ART_FORMAT("This platform is too old and doesn't have SELinux context '{}'", - kExpectedCon); - } - } - // Note that if a real Pre-reboot Dexopt is kicked off after this check, the test will still // fail, but that should be very rare. if (std::filesystem::exists(DexoptChrootSetup::CHROOT_DIR)) { |