From a2aa83c5a5433a6d081cbd9e7ce8305f98df5ea3 Mon Sep 17 00:00:00 2001 From: Akilesh Kailash Date: Wed, 27 Mar 2024 06:55:10 -0700 Subject: [PATCH] libsnapshot: don't kill the daemon for legacy vab snapshots If partitions are mounted off the daemon, there is no need to kill if the tests are being run for legacy vab snapshots. This also removes vabc_legacy_test as it is no longer required. Bug: 331053511 Test: vab_legacy_test, vts_libsnapshot_test on Pixel - No flake observed with 10 iterations Change-Id: Ie8b29fef77948d23d920c19d816376290cf2fed9 Signed-off-by: Akilesh Kailash --- fs_mgr/TEST_MAPPING | 4 ---- fs_mgr/libsnapshot/snapshot_test.cpp | 18 +++++++++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/fs_mgr/TEST_MAPPING b/fs_mgr/TEST_MAPPING index 1989a5c9d..32e8b88e1 100644 --- a/fs_mgr/TEST_MAPPING +++ b/fs_mgr/TEST_MAPPING @@ -25,8 +25,6 @@ { "name": "vab_legacy_tests" }, - // TODO(b/279009697): - //{"name": "vabc_legacy_tests"}, { "name": "cow_api_test" }, @@ -44,8 +42,6 @@ { "name": "vab_legacy_tests" }, - // TODO(b/279009697): - //{"name": "vabc_legacy_tests"} { "name": "snapuserd_test" } diff --git a/fs_mgr/libsnapshot/snapshot_test.cpp b/fs_mgr/libsnapshot/snapshot_test.cpp index 8d0c898c7..80dad17cc 100644 --- a/fs_mgr/libsnapshot/snapshot_test.cpp +++ b/fs_mgr/libsnapshot/snapshot_test.cpp @@ -2883,7 +2883,16 @@ int main(int argc, char** argv) { ::testing::AddGlobalTestEnvironment(new ::android::snapshot::SnapshotTestEnvironment()); gflags::ParseCommandLineFlags(&argc, &argv, false); - android::base::SetProperty("ctl.stop", "snapuserd"); + bool vab_legacy = false; + if (FLAGS_force_mode == "vab-legacy") { + vab_legacy = true; + } + + if (!vab_legacy) { + // This is necessary if the configuration we're testing doesn't match the device. + android::base::SetProperty("ctl.stop", "snapuserd"); + android::snapshot::KillSnapuserd(); + } std::unordered_set modes = {"", "vab-legacy"}; if (modes.count(FLAGS_force_mode) == 0) { @@ -2891,13 +2900,12 @@ int main(int argc, char** argv) { return 1; } - // This is necessary if the configuration we're testing doesn't match the device. - android::snapshot::KillSnapuserd(); - int ret = RUN_ALL_TESTS(); android::base::SetProperty("snapuserd.test.io_uring.force_disable", "0"); - android::snapshot::KillSnapuserd(); + if (!vab_legacy) { + android::snapshot::KillSnapuserd(); + } return ret; }