summaryrefslogtreecommitdiff
path: root/aosp/dynamic_partition_control_android_unittest.cc
diff options
context:
space:
mode:
authorTianjie <xunchang@google.com>2021-03-27 08:35:39 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-03-27 08:35:39 +0000
commit99a2cb81a822735274d45af08d245fa25f9a5dd0 (patch)
tree8afc2debd07e169b2664c404bdacd6b0022aa5f5 /aosp/dynamic_partition_control_android_unittest.cc
parent2a1b105801f19502a449ad012654aa573d7072fa (diff)
parent7a82a9634c8f2727f0b8e049c0ee274d24e5f39b (diff)
Check the super partiton size in VAB case am: 9f4dc7f49d am: f08a8e72f8 am: 7a82a9634c
Original change: https://android-review.googlesource.com/c/platform/system/update_engine/+/1638182 Change-Id: I47d4beb4c223a7a79ed276371de221864a82dc80
Diffstat (limited to 'aosp/dynamic_partition_control_android_unittest.cc')
-rw-r--r--aosp/dynamic_partition_control_android_unittest.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/aosp/dynamic_partition_control_android_unittest.cc b/aosp/dynamic_partition_control_android_unittest.cc
index eb3f60cc..0bb8df7a 100644
--- a/aosp/dynamic_partition_control_android_unittest.cc
+++ b/aosp/dynamic_partition_control_android_unittest.cc
@@ -1051,6 +1051,7 @@ class SnapshotPartitionTestP : public DynamicPartitionControlAndroidTestP {
// Test happy path of PreparePartitionsForUpdate on a Virtual A/B device.
TEST_P(SnapshotPartitionTestP, PreparePartitions) {
ExpectCreateUpdateSnapshots(android::snapshot::Return::Ok());
+ SetMetadata(source(), {});
uint64_t required_size = 0;
EXPECT_TRUE(PreparePartitionsForUpdate(&required_size));
EXPECT_EQ(0u, required_size);
@@ -1061,6 +1062,8 @@ TEST_P(SnapshotPartitionTestP, PreparePartitions) {
TEST_P(SnapshotPartitionTestP, PreparePartitionsNoSpace) {
ExpectCreateUpdateSnapshots(android::snapshot::Return::NoSpace(1_GiB));
uint64_t required_size = 0;
+
+ SetMetadata(source(), {});
EXPECT_FALSE(PreparePartitionsForUpdate(&required_size));
EXPECT_EQ(1_GiB, required_size);
}
@@ -1070,6 +1073,10 @@ TEST_P(SnapshotPartitionTestP, PreparePartitionsNoSpace) {
TEST_P(SnapshotPartitionTestP, RecoveryUseSuperEmpty) {
ExpectCreateUpdateSnapshots(android::snapshot::Return::Ok());
EXPECT_CALL(dynamicControl(), IsRecovery()).WillRepeatedly(Return(true));
+
+ // Metadata is needed to perform super partition size check.
+ SetMetadata(source(), {});
+
// Must not call PrepareDynamicPartitionsForUpdate if
// PrepareSnapshotPartitionsForUpdate succeeds.
EXPECT_CALL(dynamicControl(), PrepareDynamicPartitionsForUpdate(_, _, _, _))