From 4ffbc33b14ad45a225fbca2756891a2db2744c43 Mon Sep 17 00:00:00 2001 From: Akilesh Kailash Date: Tue, 12 Dec 2023 14:12:49 -0800 Subject: [PATCH] libsnapshot: skip connecting to daemon for legacy VAB There is no need to connect to daemon for legacy VAB. Bug: 311900089 Test: treehugger - presubmit Change-Id: I2256cee611431ab2a286730c61092d2c546caf1e Signed-off-by: Akilesh Kailash --- fs_mgr/libsnapshot/snapshot_test.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/fs_mgr/libsnapshot/snapshot_test.cpp b/fs_mgr/libsnapshot/snapshot_test.cpp index 4e6b5e103..c0c3eafa3 100644 --- a/fs_mgr/libsnapshot/snapshot_test.cpp +++ b/fs_mgr/libsnapshot/snapshot_test.cpp @@ -2362,8 +2362,10 @@ TEST_F(SnapshotUpdateTest, AddPartition) { auto init = NewManagerForFirstStageMount("_b"); ASSERT_NE(init, nullptr); - ASSERT_TRUE(init->EnsureSnapuserdConnected()); - init->set_use_first_stage_snapuserd(true); + if (snapuserd_required_) { + ASSERT_TRUE(init->EnsureSnapuserdConnected()); + init->set_use_first_stage_snapuserd(true); + } ASSERT_TRUE(init->NeedSnapshotsInFirstStageMount()); ASSERT_TRUE(init->CreateLogicalAndSnapshotPartitions("super", snapshot_timeout_)); @@ -2374,9 +2376,11 @@ TEST_F(SnapshotUpdateTest, AddPartition) { ASSERT_TRUE(IsPartitionUnchanged(name)); } - ASSERT_TRUE(init->PerformInitTransition(SnapshotManager::InitTransition::SECOND_STAGE)); - for (const auto& name : partitions) { - ASSERT_TRUE(init->snapuserd_client()->WaitForDeviceDelete(name + "-user-cow-init")); + if (snapuserd_required_) { + ASSERT_TRUE(init->PerformInitTransition(SnapshotManager::InitTransition::SECOND_STAGE)); + for (const auto& name : partitions) { + ASSERT_TRUE(init->snapuserd_client()->WaitForDeviceDelete(name + "-user-cow-init")); + } } // Initiate the merge and wait for it to be completed.