Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2019 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
Amin Hassani | 165d4b4 | 2019-06-27 11:04:14 -0700 | [diff] [blame] | 17 | # Stop linter from complaining XXX_unittest.cc naming. |
| 18 | # gnlint: disable=GnLintSourceFileNames |
| 19 | |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 20 | import("//common-mk/generate-dbus-adaptors.gni") |
| 21 | import("//common-mk/generate-dbus-proxies.gni") |
| 22 | import("//common-mk/openssl_pem.gni") |
| 23 | import("//common-mk/pkg_config.gni") |
| 24 | import("//common-mk/proto_library.gni") |
| 25 | import("//update_engine/tar_bunzip2.gni") |
| 26 | |
| 27 | group("all") { |
| 28 | deps = [ |
| 29 | ":delta_generator", |
| 30 | ":libpayload_consumer", |
| 31 | ":libpayload_generator", |
| 32 | ":libupdate_engine", |
| 33 | ":libupdate_engine_client", |
| 34 | ":update_engine", |
| 35 | ":update_engine-dbus-adaptor", |
| 36 | ":update_engine-dbus-kiosk-app-client", |
| 37 | ":update_engine_client", |
| 38 | ":update_metadata-protos", |
| 39 | ] |
| 40 | |
| 41 | if (use.test) { |
| 42 | deps += [ |
| 43 | ":test_http_server", |
| 44 | ":test_subprocess", |
| 45 | ":update_engine-test_images", |
| 46 | ":update_engine-testkeys", |
| 47 | ":update_engine_test_libs", |
| 48 | ":update_engine_unittests", |
| 49 | ] |
| 50 | } |
| 51 | |
| 52 | if (use.fuzzer) { |
Amin Hassani | 6f0366d | 2019-10-14 14:56:43 -0700 | [diff] [blame] | 53 | deps += [ |
| 54 | ":update_engine_delta_performer_fuzzer", |
| 55 | ":update_engine_omaha_request_action_fuzzer", |
| 56 | ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 57 | } |
| 58 | } |
| 59 | |
| 60 | pkg_config("target_defaults") { |
| 61 | cflags_cc = [ |
| 62 | "-fno-strict-aliasing", |
| 63 | "-Wnon-virtual-dtor", |
| 64 | ] |
| 65 | cflags = [ |
| 66 | "-g", |
| 67 | "-ffunction-sections", |
| 68 | "-Wall", |
| 69 | "-Wextra", |
| 70 | "-Werror", |
| 71 | "-Wno-unused-parameter", |
| 72 | ] |
| 73 | ldflags = [ "-Wl,--gc-sections" ] |
| 74 | defines = [ |
| 75 | "__CHROMEOS__", |
| 76 | "_FILE_OFFSET_BITS=64", |
| 77 | "_POSIX_C_SOURCE=199309L", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 78 | "USE_DBUS=${use.dbus}", |
| 79 | "USE_FEC=0", |
| 80 | "USE_HWID_OVERRIDE=${use.hwid_override}", |
| 81 | "USE_CHROME_KIOSK_APP=${use.chrome_kiosk_app}", |
| 82 | "USE_CHROME_NETWORK_PROXY=${use.chrome_network_proxy}", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 83 | "USE_SHILL=1", |
| 84 | ] |
| 85 | include_dirs = [ |
| 86 | # We need this include dir because we include all the local code as |
| 87 | # "update_engine/...". |
| 88 | "${platform2_root}", |
| 89 | "${platform2_root}/update_engine/client_library/include", |
| 90 | ] |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 91 | |
| 92 | # NOSORT |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 93 | pkg_deps = [ |
Grace Cham | b6d1b41 | 2019-10-31 14:53:42 +0900 | [diff] [blame] | 94 | "libbrillo", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 95 | "libchrome-${libbase_ver}", |
| 96 | |
| 97 | # system_api depends on protobuf (or protobuf-lite). It must appear |
| 98 | # before protobuf here or the linker flags won't be in the right |
| 99 | # order. |
| 100 | "system_api", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 101 | ] |
Allen Webb | 816193f | 2019-10-25 10:06:46 -0700 | [diff] [blame] | 102 | if (use.fuzzer) { |
| 103 | pkg_deps += [ "protobuf" ] |
| 104 | } else { |
| 105 | pkg_deps += [ "protobuf-lite" ] |
| 106 | } |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | # Protobufs. |
| 110 | proto_library("update_metadata-protos") { |
| 111 | proto_in_dir = "." |
| 112 | proto_out_dir = "include/update_engine" |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 113 | sources = [ "update_metadata.proto" ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 114 | } |
| 115 | |
| 116 | # Chrome D-Bus bindings. |
| 117 | generate_dbus_adaptors("update_engine-dbus-adaptor") { |
| 118 | dbus_adaptors_out_dir = "include/dbus_bindings" |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 119 | sources = [ "dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml" ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 120 | } |
| 121 | |
| 122 | generate_dbus_proxies("update_engine-dbus-kiosk-app-client") { |
| 123 | mock_output_file = "include/kiosk-app/dbus-proxy-mocks.h" |
| 124 | proxy_output_file = "include/kiosk-app/dbus-proxies.h" |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 125 | sources = [ "dbus_bindings/org.chromium.KioskAppService.dbus-xml" ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | # The payload application component and common dependencies. |
| 129 | static_library("libpayload_consumer") { |
| 130 | sources = [ |
| 131 | "common/action_processor.cc", |
| 132 | "common/boot_control_stub.cc", |
| 133 | "common/clock.cc", |
| 134 | "common/constants.cc", |
| 135 | "common/cpu_limiter.cc", |
| 136 | "common/error_code_utils.cc", |
| 137 | "common/hash_calculator.cc", |
| 138 | "common/http_common.cc", |
| 139 | "common/http_fetcher.cc", |
| 140 | "common/hwid_override.cc", |
| 141 | "common/multi_range_http_fetcher.cc", |
| 142 | "common/platform_constants_chromeos.cc", |
| 143 | "common/prefs.cc", |
| 144 | "common/proxy_resolver.cc", |
| 145 | "common/subprocess.cc", |
| 146 | "common/terminator.cc", |
| 147 | "common/utils.cc", |
| 148 | "payload_consumer/bzip_extent_writer.cc", |
| 149 | "payload_consumer/cached_file_descriptor.cc", |
| 150 | "payload_consumer/delta_performer.cc", |
| 151 | "payload_consumer/download_action.cc", |
| 152 | "payload_consumer/extent_reader.cc", |
| 153 | "payload_consumer/extent_writer.cc", |
| 154 | "payload_consumer/file_descriptor.cc", |
| 155 | "payload_consumer/file_descriptor_utils.cc", |
| 156 | "payload_consumer/file_writer.cc", |
| 157 | "payload_consumer/filesystem_verifier_action.cc", |
| 158 | "payload_consumer/install_plan.cc", |
| 159 | "payload_consumer/mount_history.cc", |
| 160 | "payload_consumer/payload_constants.cc", |
| 161 | "payload_consumer/payload_metadata.cc", |
| 162 | "payload_consumer/payload_verifier.cc", |
| 163 | "payload_consumer/postinstall_runner_action.cc", |
| 164 | "payload_consumer/verity_writer_stub.cc", |
| 165 | "payload_consumer/xz_extent_writer.cc", |
| 166 | ] |
| 167 | configs += [ ":target_defaults" ] |
| 168 | libs = [ |
| 169 | "bz2", |
| 170 | "rt", |
| 171 | ] |
| 172 | |
Allen Webb | 975e866 | 2020-05-14 14:33:13 -0700 | [diff] [blame^] | 173 | # TODO(crbug.com/1082873): Remove after fixing usage of deprecated |
| 174 | # declarations. |
| 175 | cflags_cc = [ "-Wno-error=deprecated-declarations" ] |
| 176 | |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 177 | # TODO(deymo): Remove unused dependencies once we stop including files |
| 178 | # from the root directory. |
| 179 | all_dependent_pkg_deps = [ |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 180 | "libbspatch", |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 181 | "libcrypto", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 182 | "libpuffpatch", |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 183 | "xz-embedded", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 184 | ] |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 185 | deps = [ ":update_metadata-protos" ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 186 | } |
| 187 | |
| 188 | # The main daemon static_library with all the code used to check for updates |
| 189 | # with Omaha and expose a DBus daemon. |
| 190 | static_library("libupdate_engine") { |
| 191 | sources = [ |
| 192 | "boot_control_chromeos.cc", |
| 193 | "certificate_checker.cc", |
| 194 | "common_service.cc", |
| 195 | "connection_manager.cc", |
| 196 | "connection_utils.cc", |
Amin Hassani | 565331e | 2019-06-24 14:11:29 -0700 | [diff] [blame] | 197 | "daemon_chromeos.cc", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 198 | "dbus_connection.cc", |
| 199 | "dbus_service.cc", |
| 200 | "hardware_chromeos.cc", |
| 201 | "image_properties_chromeos.cc", |
| 202 | "libcurl_http_fetcher.cc", |
| 203 | "metrics_reporter_omaha.cc", |
| 204 | "metrics_utils.cc", |
| 205 | "omaha_request_action.cc", |
| 206 | "omaha_request_builder_xml.cc", |
| 207 | "omaha_request_params.cc", |
| 208 | "omaha_response_handler_action.cc", |
| 209 | "omaha_utils.cc", |
| 210 | "p2p_manager.cc", |
| 211 | "payload_state.cc", |
| 212 | "power_manager_chromeos.cc", |
| 213 | "real_system_state.cc", |
| 214 | "shill_proxy.cc", |
| 215 | "update_attempter.cc", |
| 216 | "update_boot_flags_action.cc", |
| 217 | "update_manager/boxed_value.cc", |
| 218 | "update_manager/chromeos_policy.cc", |
| 219 | "update_manager/default_policy.cc", |
| 220 | "update_manager/enough_slots_ab_updates_policy_impl.cc", |
| 221 | "update_manager/enterprise_device_policy_impl.cc", |
| 222 | "update_manager/evaluation_context.cc", |
| 223 | "update_manager/interactive_update_policy_impl.cc", |
| 224 | "update_manager/next_update_check_policy_impl.cc", |
| 225 | "update_manager/official_build_check_policy_impl.cc", |
| 226 | "update_manager/out_of_box_experience_policy_impl.cc", |
| 227 | "update_manager/policy.cc", |
| 228 | "update_manager/policy_test_utils.cc", |
| 229 | "update_manager/real_config_provider.cc", |
| 230 | "update_manager/real_device_policy_provider.cc", |
| 231 | "update_manager/real_random_provider.cc", |
| 232 | "update_manager/real_shill_provider.cc", |
| 233 | "update_manager/real_system_provider.cc", |
| 234 | "update_manager/real_time_provider.cc", |
| 235 | "update_manager/real_updater_provider.cc", |
| 236 | "update_manager/staging_utils.cc", |
| 237 | "update_manager/state_factory.cc", |
| 238 | "update_manager/update_manager.cc", |
| 239 | "update_manager/update_time_restrictions_policy_impl.cc", |
| 240 | "update_manager/weekly_time.cc", |
| 241 | "update_status_utils.cc", |
| 242 | ] |
| 243 | configs += [ ":target_defaults" ] |
| 244 | libs = [ |
| 245 | "bz2", |
Grace Cham | b6d1b41 | 2019-10-31 14:53:42 +0900 | [diff] [blame] | 246 | "policy", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 247 | "rootdev", |
| 248 | "rt", |
| 249 | ] |
| 250 | all_dependent_pkg_deps = [ |
| 251 | "dbus-1", |
| 252 | "expat", |
| 253 | "libcurl", |
| 254 | "libdebugd-client", |
| 255 | "libmetrics-${libbase_ver}", |
| 256 | "libpower_manager-client", |
| 257 | "libsession_manager-client", |
| 258 | "libshill-client", |
| 259 | "libssl", |
| 260 | "libupdate_engine-client", |
| 261 | "vboot_host", |
| 262 | ] |
| 263 | deps = [ |
| 264 | ":libpayload_consumer", |
| 265 | ":update_engine-dbus-adaptor", |
| 266 | ":update_metadata-protos", |
| 267 | ] |
| 268 | |
| 269 | if (use.dlc) { |
| 270 | all_dependent_pkg_deps += [ "libdlcservice-client" ] |
| 271 | } |
| 272 | |
| 273 | if (use.chrome_network_proxy) { |
| 274 | sources += [ "chrome_browser_proxy_resolver.cc" ] |
| 275 | } |
| 276 | |
| 277 | if (use.chrome_kiosk_app) { |
| 278 | deps += [ ":update_engine-dbus-kiosk-app-client" ] |
| 279 | } |
| 280 | |
| 281 | if (use.dlc) { |
Jae Hoon Kim | 38de3b1 | 2020-04-29 19:41:23 -0700 | [diff] [blame] | 282 | sources += [ |
| 283 | "dlcservice_chromeos.cc", |
| 284 | "excluder_chromeos.cc", |
| 285 | ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 286 | } else { |
Jae Hoon Kim | 38de3b1 | 2020-04-29 19:41:23 -0700 | [diff] [blame] | 287 | sources += [ |
| 288 | "common/dlcservice_stub.cc", |
| 289 | "common/excluder_stub.cc", |
| 290 | ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 291 | } |
| 292 | } |
| 293 | |
| 294 | # update_engine daemon. |
| 295 | executable("update_engine") { |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 296 | sources = [ "main.cc" ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 297 | configs += [ ":target_defaults" ] |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 298 | deps = [ ":libupdate_engine" ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | # update_engine client library. |
| 302 | static_library("libupdate_engine_client") { |
| 303 | sources = [ |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 304 | "client_library/client_dbus.cc", |
| 305 | "update_status_utils.cc", |
| 306 | ] |
| 307 | include_dirs = [ "client_library/include" ] |
| 308 | configs += [ ":target_defaults" ] |
| 309 | pkg_deps = [ |
| 310 | "dbus-1", |
| 311 | "libupdate_engine-client", |
| 312 | ] |
| 313 | } |
| 314 | |
| 315 | # update_engine console client. |
| 316 | executable("update_engine_client") { |
| 317 | sources = [ |
| 318 | "common/error_code_utils.cc", |
| 319 | "omaha_utils.cc", |
| 320 | "update_engine_client.cc", |
| 321 | ] |
| 322 | configs += [ ":target_defaults" ] |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 323 | deps = [ ":libupdate_engine_client" ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 324 | } |
| 325 | |
| 326 | # server-side code. This is used for delta_generator and unittests but not |
| 327 | # for any client code. |
| 328 | static_library("libpayload_generator") { |
| 329 | sources = [ |
| 330 | "common/file_fetcher.cc", |
| 331 | "payload_generator/ab_generator.cc", |
| 332 | "payload_generator/annotated_operation.cc", |
| 333 | "payload_generator/blob_file_writer.cc", |
| 334 | "payload_generator/block_mapping.cc", |
| 335 | "payload_generator/boot_img_filesystem.cc", |
| 336 | "payload_generator/bzip.cc", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 337 | "payload_generator/deflate_utils.cc", |
| 338 | "payload_generator/delta_diff_generator.cc", |
| 339 | "payload_generator/delta_diff_utils.cc", |
| 340 | "payload_generator/ext2_filesystem.cc", |
| 341 | "payload_generator/extent_ranges.cc", |
| 342 | "payload_generator/extent_utils.cc", |
| 343 | "payload_generator/full_update_generator.cc", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 344 | "payload_generator/mapfile_filesystem.cc", |
| 345 | "payload_generator/payload_file.cc", |
| 346 | "payload_generator/payload_generation_config.cc", |
| 347 | "payload_generator/payload_generation_config_chromeos.cc", |
Amin Hassani | 7982100 | 2019-05-06 17:40:49 -0700 | [diff] [blame] | 348 | "payload_generator/payload_properties.cc", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 349 | "payload_generator/payload_signer.cc", |
| 350 | "payload_generator/raw_filesystem.cc", |
| 351 | "payload_generator/squashfs_filesystem.cc", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 352 | "payload_generator/xz_chromeos.cc", |
| 353 | ] |
| 354 | configs += [ ":target_defaults" ] |
| 355 | all_dependent_pkg_deps = [ |
| 356 | "ext2fs", |
| 357 | "libbsdiff", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 358 | "liblzma", |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 359 | "libpuffdiff", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 360 | ] |
| 361 | deps = [ |
| 362 | ":libpayload_consumer", |
| 363 | ":update_metadata-protos", |
| 364 | ] |
Allen Webb | 975e866 | 2020-05-14 14:33:13 -0700 | [diff] [blame^] | 365 | |
| 366 | # TODO(crbug.com/1082873): Remove after fixing usage of deprecated |
| 367 | # declarations. |
| 368 | cflags_cc = [ "-Wno-error=deprecated-declarations" ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 369 | } |
| 370 | |
| 371 | # server-side delta generator. |
| 372 | executable("delta_generator") { |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 373 | sources = [ "payload_generator/generate_delta_main.cc" ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 374 | configs += [ ":target_defaults" ] |
| 375 | configs -= [ "//common-mk:pie" ] |
| 376 | deps = [ |
| 377 | ":libpayload_consumer", |
| 378 | ":libpayload_generator", |
| 379 | ] |
| 380 | } |
| 381 | |
| 382 | if (use.test || use.fuzzer) { |
| 383 | static_library("update_engine_test_libs") { |
| 384 | sources = [ |
| 385 | "common/fake_prefs.cc", |
| 386 | "common/mock_http_fetcher.cc", |
| 387 | "common/test_utils.cc", |
| 388 | "fake_shill_proxy.cc", |
| 389 | "fake_system_state.cc", |
| 390 | "payload_consumer/fake_file_descriptor.cc", |
| 391 | "payload_generator/fake_filesystem.cc", |
| 392 | "update_manager/umtest_utils.cc", |
| 393 | ] |
Keigo Oka | ec39a22 | 2019-06-27 13:51:07 +0900 | [diff] [blame] | 394 | |
| 395 | # TODO(crbug.com/887845): After library odering issue is fixed, |
| 396 | # //common-mk:test can be moved in all_dependent_configs and |
| 397 | # //common-mk:test in each test configs can be removed. |
| 398 | configs += [ |
| 399 | "//common-mk:test", |
| 400 | ":target_defaults", |
| 401 | ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 402 | pkg_deps = [ "libshill-client-test" ] |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 403 | deps = [ ":libupdate_engine" ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 404 | } |
| 405 | } |
| 406 | |
| 407 | if (use.test) { |
| 408 | # Public keys used for unit testing. |
| 409 | genopenssl_key("update_engine-testkeys") { |
| 410 | openssl_pem_in_dir = "." |
| 411 | openssl_pem_out_dir = "include/update_engine" |
| 412 | sources = [ |
| 413 | "unittest_key.pem", |
| 414 | "unittest_key2.pem", |
| 415 | ] |
| 416 | } |
| 417 | |
| 418 | # Unpacks sample images used for testing. |
| 419 | tar_bunzip2("update_engine-test_images") { |
| 420 | image_out_dir = "." |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 421 | sources = [ "sample_images/sample_images.tar.bz2" ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 422 | } |
| 423 | |
| 424 | # Test HTTP Server. |
| 425 | executable("test_http_server") { |
| 426 | sources = [ |
| 427 | "common/http_common.cc", |
| 428 | "test_http_server.cc", |
| 429 | ] |
Brian Norris | 0ffa71f | 2019-07-08 10:25:54 -0700 | [diff] [blame] | 430 | |
Keigo Oka | ec39a22 | 2019-06-27 13:51:07 +0900 | [diff] [blame] | 431 | # //common-mk:test should be on the top. |
| 432 | # TODO(crbug.com/887845): Remove this after library odering issue is fixed. |
| 433 | configs += [ |
| 434 | "//common-mk:test", |
| 435 | ":target_defaults", |
| 436 | ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 437 | } |
| 438 | |
| 439 | # Test subprocess helper. |
| 440 | executable("test_subprocess") { |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 441 | sources = [ "test_subprocess.cc" ] |
Brian Norris | 0ffa71f | 2019-07-08 10:25:54 -0700 | [diff] [blame] | 442 | |
Keigo Oka | ec39a22 | 2019-06-27 13:51:07 +0900 | [diff] [blame] | 443 | # //common-mk:test should be on the top. |
| 444 | # TODO(crbug.com/887845): Remove this after library odering issue is fixed. |
| 445 | configs += [ |
| 446 | "//common-mk:test", |
| 447 | ":target_defaults", |
| 448 | ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 449 | } |
| 450 | |
| 451 | # Main unittest file. |
| 452 | executable("update_engine_unittests") { |
| 453 | sources = [ |
| 454 | "boot_control_chromeos_unittest.cc", |
| 455 | "certificate_checker_unittest.cc", |
| 456 | "common/action_pipe_unittest.cc", |
| 457 | "common/action_processor_unittest.cc", |
| 458 | "common/action_unittest.cc", |
| 459 | "common/cpu_limiter_unittest.cc", |
| 460 | "common/hash_calculator_unittest.cc", |
| 461 | "common/http_fetcher_unittest.cc", |
| 462 | "common/hwid_override_unittest.cc", |
| 463 | "common/prefs_unittest.cc", |
| 464 | "common/proxy_resolver_unittest.cc", |
| 465 | "common/subprocess_unittest.cc", |
| 466 | "common/terminator_unittest.cc", |
| 467 | "common/utils_unittest.cc", |
| 468 | "common_service_unittest.cc", |
| 469 | "connection_manager_unittest.cc", |
| 470 | "hardware_chromeos_unittest.cc", |
| 471 | "image_properties_chromeos_unittest.cc", |
Jae Hoon Kim | 0ae8fe1 | 2019-06-26 14:32:50 -0700 | [diff] [blame] | 472 | "libcurl_http_fetcher_unittest.cc", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 473 | "metrics_reporter_omaha_unittest.cc", |
| 474 | "metrics_utils_unittest.cc", |
| 475 | "omaha_request_action_unittest.cc", |
| 476 | "omaha_request_builder_xml_unittest.cc", |
| 477 | "omaha_request_params_unittest.cc", |
| 478 | "omaha_response_handler_action_unittest.cc", |
| 479 | "omaha_utils_unittest.cc", |
| 480 | "p2p_manager_unittest.cc", |
| 481 | "payload_consumer/bzip_extent_writer_unittest.cc", |
| 482 | "payload_consumer/cached_file_descriptor_unittest.cc", |
| 483 | "payload_consumer/delta_performer_integration_test.cc", |
| 484 | "payload_consumer/delta_performer_unittest.cc", |
| 485 | "payload_consumer/download_action_unittest.cc", |
| 486 | "payload_consumer/extent_reader_unittest.cc", |
| 487 | "payload_consumer/extent_writer_unittest.cc", |
| 488 | "payload_consumer/file_descriptor_utils_unittest.cc", |
| 489 | "payload_consumer/file_writer_unittest.cc", |
| 490 | "payload_consumer/filesystem_verifier_action_unittest.cc", |
| 491 | "payload_consumer/postinstall_runner_action_unittest.cc", |
| 492 | "payload_consumer/xz_extent_writer_unittest.cc", |
| 493 | "payload_generator/ab_generator_unittest.cc", |
| 494 | "payload_generator/blob_file_writer_unittest.cc", |
| 495 | "payload_generator/block_mapping_unittest.cc", |
| 496 | "payload_generator/boot_img_filesystem_unittest.cc", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 497 | "payload_generator/deflate_utils_unittest.cc", |
| 498 | "payload_generator/delta_diff_utils_unittest.cc", |
| 499 | "payload_generator/ext2_filesystem_unittest.cc", |
| 500 | "payload_generator/extent_ranges_unittest.cc", |
| 501 | "payload_generator/extent_utils_unittest.cc", |
| 502 | "payload_generator/full_update_generator_unittest.cc", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 503 | "payload_generator/mapfile_filesystem_unittest.cc", |
| 504 | "payload_generator/payload_file_unittest.cc", |
| 505 | "payload_generator/payload_generation_config_unittest.cc", |
Jae Hoon Kim | 4b6d126 | 2019-06-20 10:41:18 -0700 | [diff] [blame] | 506 | "payload_generator/payload_properties_unittest.cc", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 507 | "payload_generator/payload_signer_unittest.cc", |
| 508 | "payload_generator/squashfs_filesystem_unittest.cc", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 509 | "payload_generator/zip_unittest.cc", |
| 510 | "payload_state_unittest.cc", |
| 511 | "testrunner.cc", |
| 512 | "update_attempter_unittest.cc", |
| 513 | "update_boot_flags_action_unittest.cc", |
| 514 | "update_manager/boxed_value_unittest.cc", |
| 515 | "update_manager/chromeos_policy_unittest.cc", |
| 516 | "update_manager/evaluation_context_unittest.cc", |
| 517 | "update_manager/generic_variables_unittest.cc", |
| 518 | "update_manager/prng_unittest.cc", |
| 519 | "update_manager/real_device_policy_provider_unittest.cc", |
| 520 | "update_manager/real_random_provider_unittest.cc", |
| 521 | "update_manager/real_shill_provider_unittest.cc", |
| 522 | "update_manager/real_system_provider_unittest.cc", |
| 523 | "update_manager/real_time_provider_unittest.cc", |
| 524 | "update_manager/real_updater_provider_unittest.cc", |
| 525 | "update_manager/staging_utils_unittest.cc", |
| 526 | "update_manager/update_manager_unittest.cc", |
| 527 | "update_manager/update_time_restrictions_policy_impl_unittest.cc", |
| 528 | "update_manager/variable_unittest.cc", |
| 529 | "update_manager/weekly_time_unittest.cc", |
Jae Hoon Kim | 916af85 | 2019-08-01 17:45:30 -0700 | [diff] [blame] | 530 | "update_status_utils_unittest.cc", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 531 | ] |
Jae Hoon Kim | 38de3b1 | 2020-04-29 19:41:23 -0700 | [diff] [blame] | 532 | if (use.dlc) { |
| 533 | sources += [ "excluder_chromeos_unittest.cc" ] |
| 534 | } |
Brian Norris | 0ffa71f | 2019-07-08 10:25:54 -0700 | [diff] [blame] | 535 | |
Keigo Oka | ec39a22 | 2019-06-27 13:51:07 +0900 | [diff] [blame] | 536 | # //common-mk:test should be on the top. |
| 537 | # TODO(crbug.com/887845): Remove this after library odering issue is fixed. |
| 538 | configs += [ |
| 539 | "//common-mk:test", |
| 540 | ":target_defaults", |
| 541 | ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 542 | pkg_deps = [ |
Grace Cham | b6d1b41 | 2019-10-31 14:53:42 +0900 | [diff] [blame] | 543 | "libbrillo-test", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 544 | "libchrome-test-${libbase_ver}", |
| 545 | "libdebugd-client-test", |
| 546 | "libpower_manager-client-test", |
| 547 | "libsession_manager-client-test", |
| 548 | "libshill-client-test", |
| 549 | ] |
| 550 | deps = [ |
| 551 | ":libpayload_generator", |
| 552 | ":libupdate_engine", |
| 553 | ":update_engine_test_libs", |
| 554 | ] |
| 555 | } |
| 556 | } |
| 557 | |
| 558 | # Fuzzer target. |
| 559 | if (use.fuzzer) { |
Amin Hassani | 6f0366d | 2019-10-14 14:56:43 -0700 | [diff] [blame] | 560 | executable("update_engine_delta_performer_fuzzer") { |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 561 | sources = [ "payload_consumer/delta_performer_fuzzer.cc" ] |
Amin Hassani | 6f0366d | 2019-10-14 14:56:43 -0700 | [diff] [blame] | 562 | configs += [ |
| 563 | "//common-mk/common_fuzzer", |
| 564 | ":target_defaults", |
| 565 | ] |
| 566 | pkg_deps = [ |
Grace Cham | b6d1b41 | 2019-10-31 14:53:42 +0900 | [diff] [blame] | 567 | "libbrillo-test", |
Amin Hassani | 6f0366d | 2019-10-14 14:56:43 -0700 | [diff] [blame] | 568 | "libchrome-test-${libbase_ver}", |
| 569 | ] |
| 570 | deps = [ |
| 571 | ":libupdate_engine", |
| 572 | ":update_engine_test_libs", |
| 573 | ] |
| 574 | } |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 575 | executable("update_engine_omaha_request_action_fuzzer") { |
Clark Chung | e6b888c | 2020-04-20 15:50:37 +0800 | [diff] [blame] | 576 | sources = [ "omaha_request_action_fuzzer.cc" ] |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 577 | configs += [ |
| 578 | "//common-mk/common_fuzzer", |
| 579 | ":target_defaults", |
| 580 | ] |
| 581 | pkg_deps = [ |
Grace Cham | b6d1b41 | 2019-10-31 14:53:42 +0900 | [diff] [blame] | 582 | "libbrillo-test", |
Keigo Oka | 0ede7bd | 2019-05-13 17:35:13 +0900 | [diff] [blame] | 583 | "libchrome-test-${libbase_ver}", |
| 584 | ] |
| 585 | deps = [ |
| 586 | ":libupdate_engine", |
| 587 | ":update_engine_test_libs", |
| 588 | ] |
| 589 | } |
| 590 | } |