From 60b242cfd58a234727f5d339e2f6fa4e91ffe1fa Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Tue, 30 Jul 2019 16:48:52 -0700 Subject: Simulator: add the argument to keep the updated images Add the command line option to select the work directory and save the updated image files. Because some people might have interested in getting updated images from an ota file. Also, fix a minor issue that the destination of package_extract_file needs to be updated if it's a block device. Otherwise, an unintended file may be extracted in the callers' directory. Test: run simulation, run unit tests Change-Id: Ic6a7db0580bc1748d6e080102e4654da4e41fd8c --- tests/unit/host/update_simulator_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/unit') diff --git a/tests/unit/host/update_simulator_test.cpp b/tests/unit/host/update_simulator_test.cpp index bf89b7859..fb1217877 100644 --- a/tests/unit/host/update_simulator_test.cpp +++ b/tests/unit/host/update_simulator_test.cpp @@ -93,7 +93,7 @@ static void RunSimulation(std::string_view src_tf, std::string_view ota_package, // Run the update simulation and check the result. TemporaryDir work_dir; - BuildInfo build_info(work_dir.path); + BuildInfo build_info(work_dir.path, false); ASSERT_TRUE(build_info.ParseTargetFile(src_tf, false)); Updater updater(std::make_unique(&build_info)); ASSERT_TRUE(updater.Init(cmd_pipe.release(), ota_package, false)); @@ -211,7 +211,7 @@ TEST_F(UpdateSimulatorTest, BuildInfo_ParseTargetFile) { AddZipEntries(zip_file.release(), entries); TemporaryDir temp_dir; - BuildInfo build_info(temp_dir.path); + BuildInfo build_info(temp_dir.path, false); ASSERT_TRUE(build_info.ParseTargetFile(zip_file.path, false)); std::map expected_result = { -- cgit v1.2.3