blob: 59aa0047d0d1a0d81746be9cd3e0693d0d87ac20 [file] [log] [blame]
Keigo Oka0ede7bd2019-05-13 17:35:13 +09001#
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 Hassani165d4b42019-06-27 11:04:14 -070017# Stop linter from complaining XXX_unittest.cc naming.
18# gnlint: disable=GnLintSourceFileNames
19
Keigo Oka0ede7bd2019-05-13 17:35:13 +090020import("//common-mk/generate-dbus-adaptors.gni")
21import("//common-mk/generate-dbus-proxies.gni")
22import("//common-mk/openssl_pem.gni")
23import("//common-mk/pkg_config.gni")
24import("//common-mk/proto_library.gni")
25import("//update_engine/tar_bunzip2.gni")
26
27group("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",
Amin Hassanie53b39b2020-09-16 11:19:28 -070047 ":update_engine-testkeys-ec",
Keigo Oka0ede7bd2019-05-13 17:35:13 +090048 ":update_engine_test_libs",
49 ":update_engine_unittests",
50 ]
51 }
52
53 if (use.fuzzer) {
Amin Hassani6f0366d2019-10-14 14:56:43 -070054 deps += [
55 ":update_engine_delta_performer_fuzzer",
56 ":update_engine_omaha_request_action_fuzzer",
57 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +090058 }
59}
60
61pkg_config("target_defaults") {
62 cflags_cc = [
63 "-fno-strict-aliasing",
Amin Hassanid8946442020-08-28 12:26:35 -070064 "-std=gnu++17",
Keigo Oka0ede7bd2019-05-13 17:35:13 +090065 "-Wnon-virtual-dtor",
66 ]
67 cflags = [
68 "-g",
69 "-ffunction-sections",
70 "-Wall",
71 "-Wextra",
72 "-Werror",
73 "-Wno-unused-parameter",
74 ]
75 ldflags = [ "-Wl,--gc-sections" ]
76 defines = [
77 "__CHROMEOS__",
78 "_FILE_OFFSET_BITS=64",
79 "_POSIX_C_SOURCE=199309L",
Matt Ziegelbaum7cfadf72020-06-09 18:51:16 -040080 "USE_CFM=${use.cfm}",
Keigo Oka0ede7bd2019-05-13 17:35:13 +090081 "USE_DBUS=${use.dbus}",
82 "USE_FEC=0",
83 "USE_HWID_OVERRIDE=${use.hwid_override}",
84 "USE_CHROME_KIOSK_APP=${use.chrome_kiosk_app}",
85 "USE_CHROME_NETWORK_PROXY=${use.chrome_network_proxy}",
Keigo Oka0ede7bd2019-05-13 17:35:13 +090086 "USE_SHILL=1",
87 ]
88 include_dirs = [
89 # We need this include dir because we include all the local code as
90 # "update_engine/...".
91 "${platform2_root}",
92 "${platform2_root}/update_engine/client_library/include",
93 ]
Clark Chunge6b888c2020-04-20 15:50:37 +080094
95 # NOSORT
Keigo Oka0ede7bd2019-05-13 17:35:13 +090096 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +090097 "libbrillo",
Keigo Oka0ede7bd2019-05-13 17:35:13 +090098 "libchrome-${libbase_ver}",
99
100 # system_api depends on protobuf (or protobuf-lite). It must appear
101 # before protobuf here or the linker flags won't be in the right
102 # order.
103 "system_api",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900104 ]
Allen Webb816193f2019-10-25 10:06:46 -0700105 if (use.fuzzer) {
106 pkg_deps += [ "protobuf" ]
107 } else {
108 pkg_deps += [ "protobuf-lite" ]
109 }
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900110}
111
112# Protobufs.
113proto_library("update_metadata-protos") {
114 proto_in_dir = "."
115 proto_out_dir = "include/update_engine"
Clark Chunge6b888c2020-04-20 15:50:37 +0800116 sources = [ "update_metadata.proto" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900117}
118
119# Chrome D-Bus bindings.
120generate_dbus_adaptors("update_engine-dbus-adaptor") {
121 dbus_adaptors_out_dir = "include/dbus_bindings"
Clark Chunge6b888c2020-04-20 15:50:37 +0800122 sources = [ "dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900123}
124
125generate_dbus_proxies("update_engine-dbus-kiosk-app-client") {
126 mock_output_file = "include/kiosk-app/dbus-proxy-mocks.h"
127 proxy_output_file = "include/kiosk-app/dbus-proxies.h"
Clark Chunge6b888c2020-04-20 15:50:37 +0800128 sources = [ "dbus_bindings/org.chromium.KioskAppService.dbus-xml" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900129}
130
131# The payload application component and common dependencies.
132static_library("libpayload_consumer") {
133 sources = [
134 "common/action_processor.cc",
135 "common/boot_control_stub.cc",
136 "common/clock.cc",
137 "common/constants.cc",
138 "common/cpu_limiter.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700139 "common/dynamic_partition_control_stub.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900140 "common/error_code_utils.cc",
141 "common/hash_calculator.cc",
142 "common/http_common.cc",
143 "common/http_fetcher.cc",
144 "common/hwid_override.cc",
145 "common/multi_range_http_fetcher.cc",
146 "common/platform_constants_chromeos.cc",
147 "common/prefs.cc",
148 "common/proxy_resolver.cc",
149 "common/subprocess.cc",
150 "common/terminator.cc",
151 "common/utils.cc",
152 "payload_consumer/bzip_extent_writer.cc",
153 "payload_consumer/cached_file_descriptor.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700154 "payload_consumer/certificate_parser_stub.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900155 "payload_consumer/delta_performer.cc",
156 "payload_consumer/download_action.cc",
157 "payload_consumer/extent_reader.cc",
158 "payload_consumer/extent_writer.cc",
159 "payload_consumer/file_descriptor.cc",
160 "payload_consumer/file_descriptor_utils.cc",
161 "payload_consumer/file_writer.cc",
162 "payload_consumer/filesystem_verifier_action.cc",
163 "payload_consumer/install_plan.cc",
164 "payload_consumer/mount_history.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700165 "payload_consumer/partition_update_generator_stub.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900166 "payload_consumer/payload_constants.cc",
167 "payload_consumer/payload_metadata.cc",
168 "payload_consumer/payload_verifier.cc",
169 "payload_consumer/postinstall_runner_action.cc",
170 "payload_consumer/verity_writer_stub.cc",
171 "payload_consumer/xz_extent_writer.cc",
172 ]
173 configs += [ ":target_defaults" ]
174 libs = [
175 "bz2",
176 "rt",
177 ]
178
Allen Webb975e8662020-05-14 14:33:13 -0700179 # TODO(crbug.com/1082873): Remove after fixing usage of deprecated
180 # declarations.
181 cflags_cc = [ "-Wno-error=deprecated-declarations" ]
182
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900183 # TODO(deymo): Remove unused dependencies once we stop including files
184 # from the root directory.
185 all_dependent_pkg_deps = [
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900186 "libbspatch",
Clark Chunge6b888c2020-04-20 15:50:37 +0800187 "libcrypto",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900188 "libpuffpatch",
Clark Chunge6b888c2020-04-20 15:50:37 +0800189 "xz-embedded",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900190 ]
Tatsuhisa Yamaguchi74e47d92020-05-27 05:32:16 +0000191 public_deps = [ ":update_metadata-protos" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900192}
193
194# The main daemon static_library with all the code used to check for updates
195# with Omaha and expose a DBus daemon.
196static_library("libupdate_engine") {
197 sources = [
198 "boot_control_chromeos.cc",
199 "certificate_checker.cc",
200 "common_service.cc",
201 "connection_manager.cc",
202 "connection_utils.cc",
Amin Hassani565331e2019-06-24 14:11:29 -0700203 "daemon_chromeos.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900204 "dbus_connection.cc",
205 "dbus_service.cc",
206 "hardware_chromeos.cc",
207 "image_properties_chromeos.cc",
208 "libcurl_http_fetcher.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700209 "logging.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900210 "metrics_reporter_omaha.cc",
211 "metrics_utils.cc",
212 "omaha_request_action.cc",
213 "omaha_request_builder_xml.cc",
214 "omaha_request_params.cc",
215 "omaha_response_handler_action.cc",
216 "omaha_utils.cc",
217 "p2p_manager.cc",
218 "payload_state.cc",
219 "power_manager_chromeos.cc",
220 "real_system_state.cc",
Matt Ziegelbaum91ba9be2020-06-10 16:56:40 -0400221 "requisition_util.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900222 "shill_proxy.cc",
223 "update_attempter.cc",
224 "update_boot_flags_action.cc",
225 "update_manager/boxed_value.cc",
226 "update_manager/chromeos_policy.cc",
227 "update_manager/default_policy.cc",
228 "update_manager/enough_slots_ab_updates_policy_impl.cc",
229 "update_manager/enterprise_device_policy_impl.cc",
230 "update_manager/evaluation_context.cc",
231 "update_manager/interactive_update_policy_impl.cc",
232 "update_manager/next_update_check_policy_impl.cc",
233 "update_manager/official_build_check_policy_impl.cc",
234 "update_manager/out_of_box_experience_policy_impl.cc",
235 "update_manager/policy.cc",
236 "update_manager/policy_test_utils.cc",
237 "update_manager/real_config_provider.cc",
238 "update_manager/real_device_policy_provider.cc",
239 "update_manager/real_random_provider.cc",
240 "update_manager/real_shill_provider.cc",
241 "update_manager/real_system_provider.cc",
242 "update_manager/real_time_provider.cc",
243 "update_manager/real_updater_provider.cc",
244 "update_manager/staging_utils.cc",
245 "update_manager/state_factory.cc",
246 "update_manager/update_manager.cc",
247 "update_manager/update_time_restrictions_policy_impl.cc",
248 "update_manager/weekly_time.cc",
249 "update_status_utils.cc",
250 ]
251 configs += [ ":target_defaults" ]
252 libs = [
253 "bz2",
Grace Chamb6d1b412019-10-31 14:53:42 +0900254 "policy",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900255 "rootdev",
256 "rt",
257 ]
258 all_dependent_pkg_deps = [
259 "dbus-1",
260 "expat",
261 "libcurl",
262 "libdebugd-client",
Qijiang Fanb9c82102020-08-28 16:06:33 +0900263 "libmetrics",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900264 "libpower_manager-client",
265 "libsession_manager-client",
266 "libshill-client",
267 "libssl",
268 "libupdate_engine-client",
269 "vboot_host",
270 ]
271 deps = [
272 ":libpayload_consumer",
273 ":update_engine-dbus-adaptor",
274 ":update_metadata-protos",
275 ]
276
277 if (use.dlc) {
278 all_dependent_pkg_deps += [ "libdlcservice-client" ]
279 }
280
281 if (use.chrome_network_proxy) {
282 sources += [ "chrome_browser_proxy_resolver.cc" ]
283 }
284
285 if (use.chrome_kiosk_app) {
286 deps += [ ":update_engine-dbus-kiosk-app-client" ]
287 }
288
289 if (use.dlc) {
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700290 sources += [
291 "dlcservice_chromeos.cc",
292 "excluder_chromeos.cc",
293 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900294 } else {
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700295 sources += [
296 "common/dlcservice_stub.cc",
297 "common/excluder_stub.cc",
298 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900299 }
300}
301
302# update_engine daemon.
303executable("update_engine") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800304 sources = [ "main.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900305 configs += [ ":target_defaults" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800306 deps = [ ":libupdate_engine" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900307}
308
309# update_engine client library.
310static_library("libupdate_engine_client") {
311 sources = [
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900312 "client_library/client_dbus.cc",
313 "update_status_utils.cc",
314 ]
315 include_dirs = [ "client_library/include" ]
316 configs += [ ":target_defaults" ]
317 pkg_deps = [
318 "dbus-1",
319 "libupdate_engine-client",
320 ]
321}
322
323# update_engine console client.
324executable("update_engine_client") {
325 sources = [
326 "common/error_code_utils.cc",
327 "omaha_utils.cc",
328 "update_engine_client.cc",
329 ]
330 configs += [ ":target_defaults" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800331 deps = [ ":libupdate_engine_client" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900332}
333
334# server-side code. This is used for delta_generator and unittests but not
335# for any client code.
336static_library("libpayload_generator") {
337 sources = [
338 "common/file_fetcher.cc",
339 "payload_generator/ab_generator.cc",
340 "payload_generator/annotated_operation.cc",
341 "payload_generator/blob_file_writer.cc",
342 "payload_generator/block_mapping.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700343 "payload_generator/boot_img_filesystem_stub.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900344 "payload_generator/bzip.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900345 "payload_generator/deflate_utils.cc",
346 "payload_generator/delta_diff_generator.cc",
347 "payload_generator/delta_diff_utils.cc",
348 "payload_generator/ext2_filesystem.cc",
349 "payload_generator/extent_ranges.cc",
350 "payload_generator/extent_utils.cc",
351 "payload_generator/full_update_generator.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900352 "payload_generator/mapfile_filesystem.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700353 "payload_generator/merge_sequence_generator.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900354 "payload_generator/payload_file.cc",
355 "payload_generator/payload_generation_config.cc",
356 "payload_generator/payload_generation_config_chromeos.cc",
Amin Hassani79821002019-05-06 17:40:49 -0700357 "payload_generator/payload_properties.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900358 "payload_generator/payload_signer.cc",
359 "payload_generator/raw_filesystem.cc",
360 "payload_generator/squashfs_filesystem.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900361 "payload_generator/xz_chromeos.cc",
362 ]
363 configs += [ ":target_defaults" ]
364 all_dependent_pkg_deps = [
365 "ext2fs",
366 "libbsdiff",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900367 "liblzma",
Clark Chunge6b888c2020-04-20 15:50:37 +0800368 "libpuffdiff",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900369 ]
370 deps = [
371 ":libpayload_consumer",
372 ":update_metadata-protos",
373 ]
Allen Webb975e8662020-05-14 14:33:13 -0700374
375 # TODO(crbug.com/1082873): Remove after fixing usage of deprecated
376 # declarations.
377 cflags_cc = [ "-Wno-error=deprecated-declarations" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900378}
379
380# server-side delta generator.
381executable("delta_generator") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800382 sources = [ "payload_generator/generate_delta_main.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900383 configs += [ ":target_defaults" ]
384 configs -= [ "//common-mk:pie" ]
385 deps = [
386 ":libpayload_consumer",
387 ":libpayload_generator",
388 ]
389}
390
391if (use.test || use.fuzzer) {
392 static_library("update_engine_test_libs") {
393 sources = [
394 "common/fake_prefs.cc",
395 "common/mock_http_fetcher.cc",
396 "common/test_utils.cc",
397 "fake_shill_proxy.cc",
398 "fake_system_state.cc",
399 "payload_consumer/fake_file_descriptor.cc",
400 "payload_generator/fake_filesystem.cc",
401 "update_manager/umtest_utils.cc",
402 ]
Keigo Okaec39a222019-06-27 13:51:07 +0900403
404 # TODO(crbug.com/887845): After library odering issue is fixed,
405 # //common-mk:test can be moved in all_dependent_configs and
406 # //common-mk:test in each test configs can be removed.
407 configs += [
408 "//common-mk:test",
409 ":target_defaults",
410 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900411 pkg_deps = [ "libshill-client-test" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800412 deps = [ ":libupdate_engine" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900413 }
414}
415
416if (use.test) {
417 # Public keys used for unit testing.
418 genopenssl_key("update_engine-testkeys") {
419 openssl_pem_in_dir = "."
420 openssl_pem_out_dir = "include/update_engine"
421 sources = [
422 "unittest_key.pem",
Amin Hassanie53b39b2020-09-16 11:19:28 -0700423 "unittest_key_RSA4096.pem",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900424 "unittest_key2.pem",
425 ]
426 }
427
Amin Hassanie53b39b2020-09-16 11:19:28 -0700428 genopenssl_key("update_engine-testkeys-ec") {
429 openssl_pem_in_dir = "."
430 openssl_pem_out_dir = "include/update_engine"
431 openssl_pem_algorithm = "ec"
432 sources = [
433 "unittest_key_EC.pem",
434 ]
435 }
436
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900437 # Unpacks sample images used for testing.
438 tar_bunzip2("update_engine-test_images") {
439 image_out_dir = "."
Clark Chunge6b888c2020-04-20 15:50:37 +0800440 sources = [ "sample_images/sample_images.tar.bz2" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900441 }
442
443 # Test HTTP Server.
444 executable("test_http_server") {
445 sources = [
446 "common/http_common.cc",
447 "test_http_server.cc",
448 ]
Brian Norris0ffa71f2019-07-08 10:25:54 -0700449
Keigo Okaec39a222019-06-27 13:51:07 +0900450 # //common-mk:test should be on the top.
451 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
452 configs += [
453 "//common-mk:test",
454 ":target_defaults",
455 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900456 }
457
458 # Test subprocess helper.
459 executable("test_subprocess") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800460 sources = [ "test_subprocess.cc" ]
Brian Norris0ffa71f2019-07-08 10:25:54 -0700461
Keigo Okaec39a222019-06-27 13:51:07 +0900462 # //common-mk:test should be on the top.
463 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
464 configs += [
465 "//common-mk:test",
466 ":target_defaults",
467 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900468 }
469
470 # Main unittest file.
471 executable("update_engine_unittests") {
472 sources = [
473 "boot_control_chromeos_unittest.cc",
474 "certificate_checker_unittest.cc",
475 "common/action_pipe_unittest.cc",
476 "common/action_processor_unittest.cc",
477 "common/action_unittest.cc",
478 "common/cpu_limiter_unittest.cc",
479 "common/hash_calculator_unittest.cc",
480 "common/http_fetcher_unittest.cc",
481 "common/hwid_override_unittest.cc",
482 "common/prefs_unittest.cc",
483 "common/proxy_resolver_unittest.cc",
484 "common/subprocess_unittest.cc",
485 "common/terminator_unittest.cc",
486 "common/utils_unittest.cc",
487 "common_service_unittest.cc",
488 "connection_manager_unittest.cc",
489 "hardware_chromeos_unittest.cc",
490 "image_properties_chromeos_unittest.cc",
Jae Hoon Kim0ae8fe12019-06-26 14:32:50 -0700491 "libcurl_http_fetcher_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900492 "metrics_reporter_omaha_unittest.cc",
493 "metrics_utils_unittest.cc",
494 "omaha_request_action_unittest.cc",
495 "omaha_request_builder_xml_unittest.cc",
496 "omaha_request_params_unittest.cc",
497 "omaha_response_handler_action_unittest.cc",
498 "omaha_utils_unittest.cc",
499 "p2p_manager_unittest.cc",
500 "payload_consumer/bzip_extent_writer_unittest.cc",
501 "payload_consumer/cached_file_descriptor_unittest.cc",
502 "payload_consumer/delta_performer_integration_test.cc",
503 "payload_consumer/delta_performer_unittest.cc",
504 "payload_consumer/download_action_unittest.cc",
505 "payload_consumer/extent_reader_unittest.cc",
506 "payload_consumer/extent_writer_unittest.cc",
507 "payload_consumer/file_descriptor_utils_unittest.cc",
508 "payload_consumer/file_writer_unittest.cc",
509 "payload_consumer/filesystem_verifier_action_unittest.cc",
510 "payload_consumer/postinstall_runner_action_unittest.cc",
511 "payload_consumer/xz_extent_writer_unittest.cc",
512 "payload_generator/ab_generator_unittest.cc",
513 "payload_generator/blob_file_writer_unittest.cc",
514 "payload_generator/block_mapping_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900515 "payload_generator/deflate_utils_unittest.cc",
516 "payload_generator/delta_diff_utils_unittest.cc",
517 "payload_generator/ext2_filesystem_unittest.cc",
518 "payload_generator/extent_ranges_unittest.cc",
519 "payload_generator/extent_utils_unittest.cc",
520 "payload_generator/full_update_generator_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900521 "payload_generator/mapfile_filesystem_unittest.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700522 "payload_generator/merge_sequence_generator_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900523 "payload_generator/payload_file_unittest.cc",
524 "payload_generator/payload_generation_config_unittest.cc",
Jae Hoon Kim4b6d1262019-06-20 10:41:18 -0700525 "payload_generator/payload_properties_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900526 "payload_generator/payload_signer_unittest.cc",
527 "payload_generator/squashfs_filesystem_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900528 "payload_generator/zip_unittest.cc",
529 "payload_state_unittest.cc",
Matt Ziegelbaum91ba9be2020-06-10 16:56:40 -0400530 "requisition_util_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900531 "testrunner.cc",
532 "update_attempter_unittest.cc",
533 "update_boot_flags_action_unittest.cc",
534 "update_manager/boxed_value_unittest.cc",
535 "update_manager/chromeos_policy_unittest.cc",
536 "update_manager/evaluation_context_unittest.cc",
537 "update_manager/generic_variables_unittest.cc",
538 "update_manager/prng_unittest.cc",
539 "update_manager/real_device_policy_provider_unittest.cc",
540 "update_manager/real_random_provider_unittest.cc",
541 "update_manager/real_shill_provider_unittest.cc",
542 "update_manager/real_system_provider_unittest.cc",
543 "update_manager/real_time_provider_unittest.cc",
544 "update_manager/real_updater_provider_unittest.cc",
545 "update_manager/staging_utils_unittest.cc",
546 "update_manager/update_manager_unittest.cc",
547 "update_manager/update_time_restrictions_policy_impl_unittest.cc",
548 "update_manager/variable_unittest.cc",
549 "update_manager/weekly_time_unittest.cc",
Jae Hoon Kim916af852019-08-01 17:45:30 -0700550 "update_status_utils_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900551 ]
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700552 if (use.dlc) {
553 sources += [ "excluder_chromeos_unittest.cc" ]
554 }
Brian Norris0ffa71f2019-07-08 10:25:54 -0700555
Keigo Okaec39a222019-06-27 13:51:07 +0900556 # //common-mk:test should be on the top.
557 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
558 configs += [
559 "//common-mk:test",
560 ":target_defaults",
561 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900562 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900563 "libbrillo-test",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900564 "libchrome-test-${libbase_ver}",
565 "libdebugd-client-test",
566 "libpower_manager-client-test",
567 "libsession_manager-client-test",
568 "libshill-client-test",
569 ]
570 deps = [
571 ":libpayload_generator",
572 ":libupdate_engine",
573 ":update_engine_test_libs",
574 ]
575 }
576}
577
578# Fuzzer target.
579if (use.fuzzer) {
Amin Hassani6f0366d2019-10-14 14:56:43 -0700580 executable("update_engine_delta_performer_fuzzer") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800581 sources = [ "payload_consumer/delta_performer_fuzzer.cc" ]
Amin Hassani6f0366d2019-10-14 14:56:43 -0700582 configs += [
583 "//common-mk/common_fuzzer",
584 ":target_defaults",
585 ]
586 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900587 "libbrillo-test",
Amin Hassani6f0366d2019-10-14 14:56:43 -0700588 "libchrome-test-${libbase_ver}",
589 ]
590 deps = [
591 ":libupdate_engine",
592 ":update_engine_test_libs",
593 ]
594 }
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900595 executable("update_engine_omaha_request_action_fuzzer") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800596 sources = [ "omaha_request_action_fuzzer.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900597 configs += [
598 "//common-mk/common_fuzzer",
599 ":target_defaults",
600 ]
601 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900602 "libbrillo-test",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900603 "libchrome-test-${libbase_ver}",
604 ]
605 deps = [
606 ":libupdate_engine",
607 ":update_engine_test_libs",
608 ]
609 }
610}