AU: Handle moving of sparse block extents correctly in DeltaPerformer.

Rather than reading from sparse holes, just reset the buffer with zeros. Drop
writes to sparse holes (and DCHECK that the data to be written is all zeros).

This patch also adds the following tests:

- Move a file of zeros into a sparse file.
- Move a sparse file into a file of zeros.
- Move a partially sparse file.

BUG=chromium:196378
TEST=unit tests

Change-Id: Idab8d44b391fbe7714c7fd53f7f383c9bf81edc1
Reviewed-on: https://gerrit.chromium.org/gerrit/49172
Commit-Queue: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
2 files changed
tree: a055c93def5a0cccf436a735ec25f436a27143ea
  1. .gitignore
  2. 99-gpio-dutflag.rules
  3. action.h
  4. action_mock.h
  5. action_pipe.h
  6. action_pipe_unittest.cc
  7. action_processor.cc
  8. action_processor.h
  9. action_processor_mock.h
  10. action_processor_unittest.cc
  11. action_unittest.cc
  12. build
  13. bzip.cc
  14. bzip.h
  15. bzip_extent_writer.cc
  16. bzip_extent_writer.h
  17. bzip_extent_writer_unittest.cc
  18. certificate_checker.cc
  19. certificate_checker.h
  20. certificate_checker_mock.h
  21. certificate_checker_unittest.cc
  22. chrome_browser_proxy_resolver.cc
  23. chrome_browser_proxy_resolver.h
  24. chrome_browser_proxy_resolver_unittest.cc
  25. chrome_proxy_resolver.cc
  26. chrome_proxy_resolver.h
  27. chrome_proxy_resolver_unittest.cc
  28. clock.cc
  29. clock.h
  30. clock_interface.h
  31. connection_manager.cc
  32. connection_manager.h
  33. connection_manager_unittest.cc
  34. constants.cc
  35. constants.h
  36. cycle_breaker.cc
  37. cycle_breaker.h
  38. cycle_breaker_unittest.cc
  39. dbus_constants.h
  40. dbus_interface.h
  41. dbus_service.cc
  42. dbus_service.h
  43. delta_diff_generator.cc
  44. delta_diff_generator.h
  45. delta_diff_generator_unittest.cc
  46. delta_performer.cc
  47. delta_performer.h
  48. delta_performer_unittest.cc
  49. download_action.cc
  50. download_action.h
  51. download_action_unittest.cc
  52. extent_mapper.cc
  53. extent_mapper.h
  54. extent_mapper_unittest.cc
  55. extent_ranges.cc
  56. extent_ranges.h
  57. extent_ranges_unittest.cc
  58. extent_writer.cc
  59. extent_writer.h
  60. extent_writer_unittest.cc
  61. fake_clock.h
  62. file_descriptor.cc
  63. file_descriptor.h
  64. file_writer.cc
  65. file_writer.h
  66. file_writer_mock.h
  67. file_writer_unittest.cc
  68. filesystem_copier_action.cc
  69. filesystem_copier_action.h
  70. filesystem_copier_action_unittest.cc
  71. filesystem_iterator.cc
  72. filesystem_iterator.h
  73. filesystem_iterator_unittest.cc
  74. full_update_generator.cc
  75. full_update_generator.h
  76. full_update_generator_unittest.cc
  77. gen_coverage_html
  78. generate_delta_main.cc
  79. gpio_handler.cc
  80. gpio_handler.h
  81. gpio_handler_unittest.cc
  82. gpio_handler_unittest.h
  83. gpio_mock_file_descriptor.cc
  84. gpio_mock_file_descriptor.h
  85. gpio_mock_udev_interface.cc
  86. gpio_mock_udev_interface.h
  87. graph_types.h
  88. graph_utils.cc
  89. graph_utils.h
  90. graph_utils_unittest.cc
  91. http_common.cc
  92. http_common.h
  93. http_fetcher.cc
  94. http_fetcher.h
  95. http_fetcher_unittest.cc
  96. http_fetcher_unittest.h
  97. inherit-review-settings-ok
  98. install_plan.cc
  99. install_plan.h
  100. integration_unittest.cc
  101. libcurl_http_fetcher.cc
  102. libcurl_http_fetcher.h
  103. LICENSE
  104. local_coverage_rate
  105. main.cc
  106. marshal.list
  107. metadata.cc
  108. metadata.h
  109. metadata_unittest.cc
  110. mock_connection_manager.h
  111. mock_dbus_interface.h
  112. mock_file_writer.h
  113. mock_gpio_handler.h
  114. mock_http_fetcher.cc
  115. mock_http_fetcher.h
  116. mock_payload_state.h
  117. mock_system_state.cc
  118. mock_system_state.h
  119. multi_range_http_fetcher.cc
  120. multi_range_http_fetcher.h
  121. omaha_hash_calculator.cc
  122. omaha_hash_calculator.h
  123. omaha_hash_calculator_unittest.cc
  124. omaha_request_action.cc
  125. omaha_request_action.h
  126. omaha_request_action_unittest.cc
  127. omaha_request_params.cc
  128. omaha_request_params.h
  129. omaha_request_params_unittest.cc
  130. omaha_response.h
  131. omaha_response_handler_action.cc
  132. omaha_response_handler_action.h
  133. omaha_response_handler_action_unittest.cc
  134. org.chromium.UpdateEngine.service
  135. payload_signer.cc
  136. payload_signer.h
  137. payload_signer_unittest.cc
  138. payload_state.cc
  139. payload_state.h
  140. payload_state_interface.h
  141. payload_state_unittest.cc
  142. postinstall_runner_action.cc
  143. postinstall_runner_action.h
  144. postinstall_runner_action_unittest.cc
  145. prefs.cc
  146. prefs.h
  147. prefs_interface.h
  148. prefs_mock.h
  149. prefs_unittest.cc
  150. proxy_resolver.cc
  151. proxy_resolver.h
  152. real_system_state.h
  153. run_unittests
  154. sample_omaha_v3_response.xml
  155. SConstruct
  156. setup_dev_packages
  157. simple_key_value_store.cc
  158. simple_key_value_store.h
  159. simple_key_value_store_unittest.cc
  160. subprocess.cc
  161. subprocess.h
  162. subprocess_unittest.cc
  163. system_state.cc
  164. system_state.h
  165. tarjan.cc
  166. tarjan.h
  167. tarjan_unittest.cc
  168. terminator.cc
  169. terminator.h
  170. terminator_unittest.cc
  171. test_http_server.cc
  172. test_utils.cc
  173. test_utils.h
  174. testrunner.cc
  175. topological_sort.cc
  176. topological_sort.h
  177. topological_sort_unittest.cc
  178. udev_interface.h
  179. unittest_key.pem
  180. unittest_key2.pem
  181. update_attempter.cc
  182. update_attempter.h
  183. update_attempter_mock.h
  184. update_attempter_unittest.cc
  185. update_check_scheduler.cc
  186. update_check_scheduler.h
  187. update_check_scheduler_unittest.cc
  188. update_engine.xml
  189. update_engine_client.cc
  190. update_metadata.proto
  191. UpdateEngine.conf
  192. utils.cc
  193. utils.h
  194. utils_unittest.cc
  195. WATCHLISTS
  196. zip_unittest.cc