From c0299edd464708c48d823e7fed0035e5daa557de Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Thu, 24 May 2018 00:16:35 -0700 Subject: tests: Add ResumableUpdaterTest. This is a stress test that instantiates multiple testcases that interrupt a BBOTA update at every transfer command. Each testcase asserts the last_command_file after the interruption, verifies the update resumability, then resumes the update and asserts the updated image. The transfer list in the testcase covers most of the transfer commands (stash/free/move/bsdiff/zero/new), as well as some special pattern like having duplicate stash ids. This CL also addresses one issue in the updater code, by resetting the stash_map before each run. The stash map should be valid only per block_image_verify/block_image_update run. Having leftover may cause issue in subsequent runs, in particular when calling block_image_verify after a previous run of block_image_{update,verify}. Test: Run recovery_component_test on marlin. Change-Id: I6f9a0368d194a754ce41a9c9819c6d5be2657248 --- updater/blockimg.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'updater') diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp index 4adb974cb..bdb64636b 100644 --- a/updater/blockimg.cpp +++ b/updater/blockimg.cpp @@ -1498,6 +1498,7 @@ static Value* PerformBlockImageUpdate(const char* name, State* state, const std::vector>& argv, const CommandMap& command_map, bool dryrun) { CommandParameters params = {}; + stash_map.clear(); params.canwrite = !dryrun; LOG(INFO) << "performing " << (dryrun ? "verification" : "update"); -- cgit v1.2.3