diff options
| author | Yifan Hong <elsk@google.com> | 2020-03-11 13:20:52 -0700 |
|---|---|---|
| committer | Yifan Hong <elsk@google.com> | 2020-03-17 15:54:19 -0700 |
| commit | 3a3d0c121fd904ce8440260ee2f5d12ea09d12e2 (patch) | |
| tree | d4d1079ef8bdaa8f50ec7cbdc38576c1c8e6b114 /dynamic_partition_control_android_unittest.cc | |
| parent | c0fa08aa7cc0cc218ae21978b801e88bf72b1626 (diff) | |
ResetStatus deletes snapshots for VAB.
When ResetStatus() is called, delete snapshots to free up space on
VAB devices.
On regular A/B, there is no need to cancel the update completely so that
the update may be resumed next time. However, on VAB devices, a
cancelled update should not occupy previously allocated space.
Test: manually call update_engine_client --cancel when an update is in progress, then
call update_engine_client --reset_status, then
call snapshotctl dump to check that snapshots are deleted.
Then, re-apply the update.
Test: manually kill update_engine when an update is in progress, then
call update_engine_client --reset_status, then
call snapshotctl dump to check that snapshots are deleted.
Then, re-apply the update.
Test: manually apply an update until UPDATED_NEED_REBOOT, then
call update_engine_client --reset_status, then
call snapshotctl dump to check that snapshots are deleted.
Then, re-apply the update.
Test: manually apply an update until UPDATED_NEED_REBOOT, then
kill update_engine, then
call update_engine_client --reset_status, then
call snapshotctl dump to check that snapshots are deleted.
Then, re-apply the update.
Bug: 147696014
Change-Id: Ic7049772091a34e0e666fd7ae361ef474d5a28aa
Merged-In: Ic7049772091a34e0e666fd7ae361ef474d5a28aa
Diffstat (limited to 'dynamic_partition_control_android_unittest.cc')
| -rw-r--r-- | dynamic_partition_control_android_unittest.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/dynamic_partition_control_android_unittest.cc b/dynamic_partition_control_android_unittest.cc index 4b1870dc..457ea108 100644 --- a/dynamic_partition_control_android_unittest.cc +++ b/dynamic_partition_control_android_unittest.cc @@ -24,6 +24,7 @@ #include <gmock/gmock.h> #include <gtest/gtest.h> +#include "update_engine/common/mock_prefs.h" #include "update_engine/dynamic_partition_test_utils.h" #include "update_engine/mock_dynamic_partition_control.h" @@ -751,4 +752,9 @@ TEST_P(DynamicPartitionControlAndroidTestP, OptimizeOperationTest) { EXPECT_FALSE(dynamicControl().OptimizeOperation("bar", iop, &optimized)); } +TEST_F(DynamicPartitionControlAndroidTest, ResetUpdate) { + MockPrefs prefs; + ASSERT_TRUE(dynamicControl().ResetUpdate(&prefs)); +} + } // namespace chromeos_update_engine |
