blob: 1f5dc7f8d0d5fe72d61d80c133a217ac9289e41e [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}",
Keigo Oka0ede7bd2019-05-13 17:35:13 +090084 ]
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 Chunge6b888c2020-04-20 15:50:37 +080091
92 # NOSORT
Keigo Oka0ede7bd2019-05-13 17:35:13 +090093 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +090094 "libbrillo",
Qijiang Fanb78e1bc2020-10-27 16:31:39 +090095 "libchrome",
Keigo Oka0ede7bd2019-05-13 17:35:13 +090096
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 Oka0ede7bd2019-05-13 17:35:13 +0900101 ]
Allen Webb816193f2019-10-25 10:06:46 -0700102 if (use.fuzzer) {
103 pkg_deps += [ "protobuf" ]
104 } else {
105 pkg_deps += [ "protobuf-lite" ]
106 }
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900107}
108
109# Protobufs.
110proto_library("update_metadata-protos") {
111 proto_in_dir = "."
112 proto_out_dir = "include/update_engine"
Clark Chunge6b888c2020-04-20 15:50:37 +0800113 sources = [ "update_metadata.proto" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900114}
115
116# Chrome D-Bus bindings.
117generate_dbus_adaptors("update_engine-dbus-adaptor") {
118 dbus_adaptors_out_dir = "include/dbus_bindings"
Clark Chunge6b888c2020-04-20 15:50:37 +0800119 sources = [ "dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900120}
121
122generate_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 Chunge6b888c2020-04-20 15:50:37 +0800125 sources = [ "dbus_bindings/org.chromium.KioskAppService.dbus-xml" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900126}
127
128# The payload application component and common dependencies.
129static_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",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700136 "common/dynamic_partition_control_stub.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900137 "common/error_code_utils.cc",
138 "common/hash_calculator.cc",
139 "common/http_common.cc",
140 "common/http_fetcher.cc",
141 "common/hwid_override.cc",
142 "common/multi_range_http_fetcher.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900143 "common/prefs.cc",
144 "common/proxy_resolver.cc",
145 "common/subprocess.cc",
146 "common/terminator.cc",
147 "common/utils.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700148 "cros/platform_constants_chromeos.cc",
149 "download_action.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900150 "payload_consumer/bzip_extent_writer.cc",
151 "payload_consumer/cached_file_descriptor.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700152 "payload_consumer/certificate_parser_stub.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900153 "payload_consumer/delta_performer.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900154 "payload_consumer/extent_reader.cc",
155 "payload_consumer/extent_writer.cc",
156 "payload_consumer/file_descriptor.cc",
157 "payload_consumer/file_descriptor_utils.cc",
158 "payload_consumer/file_writer.cc",
159 "payload_consumer/filesystem_verifier_action.cc",
160 "payload_consumer/install_plan.cc",
161 "payload_consumer/mount_history.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700162 "payload_consumer/partition_update_generator_stub.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900163 "payload_consumer/payload_constants.cc",
164 "payload_consumer/payload_metadata.cc",
165 "payload_consumer/payload_verifier.cc",
166 "payload_consumer/postinstall_runner_action.cc",
167 "payload_consumer/verity_writer_stub.cc",
168 "payload_consumer/xz_extent_writer.cc",
169 ]
170 configs += [ ":target_defaults" ]
171 libs = [
172 "bz2",
173 "rt",
174 ]
175
Allen Webb975e8662020-05-14 14:33:13 -0700176 # TODO(crbug.com/1082873): Remove after fixing usage of deprecated
177 # declarations.
178 cflags_cc = [ "-Wno-error=deprecated-declarations" ]
179
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900180 # TODO(deymo): Remove unused dependencies once we stop including files
181 # from the root directory.
182 all_dependent_pkg_deps = [
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900183 "libbspatch",
Clark Chunge6b888c2020-04-20 15:50:37 +0800184 "libcrypto",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900185 "libpuffpatch",
Clark Chunge6b888c2020-04-20 15:50:37 +0800186 "xz-embedded",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900187 ]
Tatsuhisa Yamaguchi74e47d92020-05-27 05:32:16 +0000188 public_deps = [ ":update_metadata-protos" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900189}
190
191# The main daemon static_library with all the code used to check for updates
192# with Omaha and expose a DBus daemon.
193static_library("libupdate_engine") {
194 sources = [
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900195 "certificate_checker.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700196 "common/connection_utils.cc",
197 "cros/boot_control_chromeos.cc",
198 "cros/common_service.cc",
199 "cros/connection_manager.cc",
200 "cros/daemon_chromeos.cc",
201 "cros/dbus_connection.cc",
202 "cros/dbus_service.cc",
203 "cros/hardware_chromeos.cc",
204 "cros/image_properties_chromeos.cc",
205 "cros/logging.cc",
206 "cros/metrics_reporter_omaha.cc",
207 "cros/omaha_request_action.cc",
208 "cros/omaha_request_builder_xml.cc",
209 "cros/omaha_request_params.cc",
210 "cros/omaha_response_handler_action.cc",
211 "cros/omaha_utils.cc",
212 "cros/p2p_manager.cc",
213 "cros/payload_state.cc",
214 "cros/power_manager_chromeos.cc",
215 "cros/real_system_state.cc",
216 "cros/requisition_util.cc",
217 "cros/shill_proxy.cc",
218 "cros/update_attempter.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900219 "libcurl_http_fetcher.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900220 "metrics_utils.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900221 "update_boot_flags_action.cc",
222 "update_manager/boxed_value.cc",
223 "update_manager/chromeos_policy.cc",
224 "update_manager/default_policy.cc",
225 "update_manager/enough_slots_ab_updates_policy_impl.cc",
226 "update_manager/enterprise_device_policy_impl.cc",
227 "update_manager/evaluation_context.cc",
228 "update_manager/interactive_update_policy_impl.cc",
Saurabh Nijhara79fec2d2020-11-10 23:22:58 +0100229 "update_manager/minimum_version_policy_impl.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900230 "update_manager/next_update_check_policy_impl.cc",
231 "update_manager/official_build_check_policy_impl.cc",
232 "update_manager/out_of_box_experience_policy_impl.cc",
233 "update_manager/policy.cc",
234 "update_manager/policy_test_utils.cc",
235 "update_manager/real_config_provider.cc",
236 "update_manager/real_device_policy_provider.cc",
237 "update_manager/real_random_provider.cc",
238 "update_manager/real_shill_provider.cc",
239 "update_manager/real_system_provider.cc",
240 "update_manager/real_time_provider.cc",
241 "update_manager/real_updater_provider.cc",
242 "update_manager/staging_utils.cc",
243 "update_manager/state_factory.cc",
244 "update_manager/update_manager.cc",
245 "update_manager/update_time_restrictions_policy_impl.cc",
246 "update_manager/weekly_time.cc",
247 "update_status_utils.cc",
248 ]
249 configs += [ ":target_defaults" ]
250 libs = [
251 "bz2",
Grace Chamb6d1b412019-10-31 14:53:42 +0900252 "policy",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900253 "rootdev",
254 "rt",
255 ]
256 all_dependent_pkg_deps = [
257 "dbus-1",
258 "expat",
259 "libcurl",
260 "libdebugd-client",
Qijiang Fanb9c82102020-08-28 16:06:33 +0900261 "libmetrics",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900262 "libpower_manager-client",
263 "libsession_manager-client",
264 "libshill-client",
265 "libssl",
266 "libupdate_engine-client",
267 "vboot_host",
268 ]
269 deps = [
270 ":libpayload_consumer",
271 ":update_engine-dbus-adaptor",
Amin Hassani64a80162020-11-09 16:58:17 -0800272 ":update_engine-dbus-kiosk-app-client",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900273 ":update_metadata-protos",
274 ]
275
276 if (use.dlc) {
277 all_dependent_pkg_deps += [ "libdlcservice-client" ]
278 }
279
280 if (use.chrome_network_proxy) {
Amin Hassaniec7bc112020-10-29 16:47:58 -0700281 sources += [ "cros/chrome_browser_proxy_resolver.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900282 }
283
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900284 if (use.dlc) {
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700285 sources += [
Amin Hassaniec7bc112020-10-29 16:47:58 -0700286 "cros/dlcservice_chromeos.cc",
287 "cros/excluder_chromeos.cc",
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700288 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900289 } else {
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700290 sources += [
291 "common/dlcservice_stub.cc",
292 "common/excluder_stub.cc",
293 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900294 }
295}
296
297# update_engine daemon.
298executable("update_engine") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800299 sources = [ "main.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900300 configs += [ ":target_defaults" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800301 deps = [ ":libupdate_engine" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900302}
303
304# update_engine client library.
305static_library("libupdate_engine_client") {
306 sources = [
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900307 "client_library/client_dbus.cc",
308 "update_status_utils.cc",
309 ]
310 include_dirs = [ "client_library/include" ]
311 configs += [ ":target_defaults" ]
312 pkg_deps = [
313 "dbus-1",
314 "libupdate_engine-client",
315 ]
316}
317
318# update_engine console client.
319executable("update_engine_client") {
320 sources = [
321 "common/error_code_utils.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700322 "cros/omaha_utils.cc",
323 "cros/update_engine_client.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900324 ]
325 configs += [ ":target_defaults" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800326 deps = [ ":libupdate_engine_client" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900327}
328
329# server-side code. This is used for delta_generator and unittests but not
330# for any client code.
331static_library("libpayload_generator") {
332 sources = [
333 "common/file_fetcher.cc",
334 "payload_generator/ab_generator.cc",
335 "payload_generator/annotated_operation.cc",
336 "payload_generator/blob_file_writer.cc",
337 "payload_generator/block_mapping.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700338 "payload_generator/boot_img_filesystem_stub.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900339 "payload_generator/bzip.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900340 "payload_generator/deflate_utils.cc",
341 "payload_generator/delta_diff_generator.cc",
342 "payload_generator/delta_diff_utils.cc",
343 "payload_generator/ext2_filesystem.cc",
344 "payload_generator/extent_ranges.cc",
345 "payload_generator/extent_utils.cc",
346 "payload_generator/full_update_generator.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900347 "payload_generator/mapfile_filesystem.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700348 "payload_generator/merge_sequence_generator.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900349 "payload_generator/payload_file.cc",
350 "payload_generator/payload_generation_config.cc",
351 "payload_generator/payload_generation_config_chromeos.cc",
Amin Hassani79821002019-05-06 17:40:49 -0700352 "payload_generator/payload_properties.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900353 "payload_generator/payload_signer.cc",
354 "payload_generator/raw_filesystem.cc",
355 "payload_generator/squashfs_filesystem.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900356 "payload_generator/xz_chromeos.cc",
357 ]
358 configs += [ ":target_defaults" ]
359 all_dependent_pkg_deps = [
360 "ext2fs",
361 "libbsdiff",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900362 "liblzma",
Clark Chunge6b888c2020-04-20 15:50:37 +0800363 "libpuffdiff",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900364 ]
365 deps = [
366 ":libpayload_consumer",
367 ":update_metadata-protos",
368 ]
Allen Webb975e8662020-05-14 14:33:13 -0700369
370 # TODO(crbug.com/1082873): Remove after fixing usage of deprecated
371 # declarations.
372 cflags_cc = [ "-Wno-error=deprecated-declarations" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900373}
374
375# server-side delta generator.
376executable("delta_generator") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800377 sources = [ "payload_generator/generate_delta_main.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900378 configs += [ ":target_defaults" ]
379 configs -= [ "//common-mk:pie" ]
380 deps = [
381 ":libpayload_consumer",
382 ":libpayload_generator",
383 ]
384}
385
386if (use.test || use.fuzzer) {
387 static_library("update_engine_test_libs") {
388 sources = [
389 "common/fake_prefs.cc",
390 "common/mock_http_fetcher.cc",
391 "common/test_utils.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700392 "cros/fake_shill_proxy.cc",
393 "cros/fake_system_state.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900394 "payload_consumer/fake_file_descriptor.cc",
395 "payload_generator/fake_filesystem.cc",
396 "update_manager/umtest_utils.cc",
397 ]
Keigo Okaec39a222019-06-27 13:51:07 +0900398
399 # TODO(crbug.com/887845): After library odering issue is fixed,
400 # //common-mk:test can be moved in all_dependent_configs and
401 # //common-mk:test in each test configs can be removed.
402 configs += [
403 "//common-mk:test",
404 ":target_defaults",
405 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900406 pkg_deps = [ "libshill-client-test" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800407 deps = [ ":libupdate_engine" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900408 }
409}
410
411if (use.test) {
412 # Public keys used for unit testing.
413 genopenssl_key("update_engine-testkeys") {
414 openssl_pem_in_dir = "."
415 openssl_pem_out_dir = "include/update_engine"
416 sources = [
417 "unittest_key.pem",
418 "unittest_key2.pem",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700419 "unittest_key_RSA4096.pem",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900420 ]
421 }
422
Amin Hassanie53b39b2020-09-16 11:19:28 -0700423 genopenssl_key("update_engine-testkeys-ec") {
424 openssl_pem_in_dir = "."
425 openssl_pem_out_dir = "include/update_engine"
426 openssl_pem_algorithm = "ec"
Amin Hassaniec7bc112020-10-29 16:47:58 -0700427 sources = [ "unittest_key_EC.pem" ]
Amin Hassanie53b39b2020-09-16 11:19:28 -0700428 }
429
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900430 # Unpacks sample images used for testing.
431 tar_bunzip2("update_engine-test_images") {
432 image_out_dir = "."
Clark Chunge6b888c2020-04-20 15:50:37 +0800433 sources = [ "sample_images/sample_images.tar.bz2" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900434 }
435
436 # Test HTTP Server.
437 executable("test_http_server") {
438 sources = [
439 "common/http_common.cc",
440 "test_http_server.cc",
441 ]
Brian Norris0ffa71f2019-07-08 10:25:54 -0700442
Keigo Okaec39a222019-06-27 13:51:07 +0900443 # //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 Oka0ede7bd2019-05-13 17:35:13 +0900449 }
450
451 # Test subprocess helper.
452 executable("test_subprocess") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800453 sources = [ "test_subprocess.cc" ]
Brian Norris0ffa71f2019-07-08 10:25:54 -0700454
Keigo Okaec39a222019-06-27 13:51:07 +0900455 # //common-mk:test should be on the top.
456 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
457 configs += [
458 "//common-mk:test",
459 ":target_defaults",
460 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900461 }
462
463 # Main unittest file.
464 executable("update_engine_unittests") {
465 sources = [
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900466 "certificate_checker_unittest.cc",
467 "common/action_pipe_unittest.cc",
468 "common/action_processor_unittest.cc",
469 "common/action_unittest.cc",
470 "common/cpu_limiter_unittest.cc",
471 "common/hash_calculator_unittest.cc",
472 "common/http_fetcher_unittest.cc",
473 "common/hwid_override_unittest.cc",
474 "common/prefs_unittest.cc",
475 "common/proxy_resolver_unittest.cc",
476 "common/subprocess_unittest.cc",
477 "common/terminator_unittest.cc",
478 "common/utils_unittest.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700479 "cros/boot_control_chromeos_unittest.cc",
480 "cros/common_service_unittest.cc",
481 "cros/connection_manager_unittest.cc",
482 "cros/hardware_chromeos_unittest.cc",
483 "cros/image_properties_chromeos_unittest.cc",
484 "cros/metrics_reporter_omaha_unittest.cc",
485 "cros/omaha_request_action_unittest.cc",
486 "cros/omaha_request_builder_xml_unittest.cc",
487 "cros/omaha_request_params_unittest.cc",
488 "cros/omaha_response_handler_action_unittest.cc",
489 "cros/omaha_utils_unittest.cc",
490 "cros/p2p_manager_unittest.cc",
491 "cros/payload_state_unittest.cc",
492 "cros/requisition_util_unittest.cc",
493 "cros/update_attempter_unittest.cc",
494 "download_action_unittest.cc",
Jae Hoon Kim0ae8fe12019-06-26 14:32:50 -0700495 "libcurl_http_fetcher_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900496 "metrics_utils_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900497 "payload_consumer/bzip_extent_writer_unittest.cc",
498 "payload_consumer/cached_file_descriptor_unittest.cc",
499 "payload_consumer/delta_performer_integration_test.cc",
500 "payload_consumer/delta_performer_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900501 "payload_consumer/extent_reader_unittest.cc",
502 "payload_consumer/extent_writer_unittest.cc",
503 "payload_consumer/file_descriptor_utils_unittest.cc",
504 "payload_consumer/file_writer_unittest.cc",
505 "payload_consumer/filesystem_verifier_action_unittest.cc",
506 "payload_consumer/postinstall_runner_action_unittest.cc",
507 "payload_consumer/xz_extent_writer_unittest.cc",
508 "payload_generator/ab_generator_unittest.cc",
509 "payload_generator/blob_file_writer_unittest.cc",
510 "payload_generator/block_mapping_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900511 "payload_generator/deflate_utils_unittest.cc",
512 "payload_generator/delta_diff_utils_unittest.cc",
513 "payload_generator/ext2_filesystem_unittest.cc",
514 "payload_generator/extent_ranges_unittest.cc",
515 "payload_generator/extent_utils_unittest.cc",
516 "payload_generator/full_update_generator_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900517 "payload_generator/mapfile_filesystem_unittest.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700518 "payload_generator/merge_sequence_generator_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900519 "payload_generator/payload_file_unittest.cc",
520 "payload_generator/payload_generation_config_unittest.cc",
Jae Hoon Kim4b6d1262019-06-20 10:41:18 -0700521 "payload_generator/payload_properties_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900522 "payload_generator/payload_signer_unittest.cc",
523 "payload_generator/squashfs_filesystem_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900524 "payload_generator/zip_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900525 "testrunner.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900526 "update_boot_flags_action_unittest.cc",
527 "update_manager/boxed_value_unittest.cc",
528 "update_manager/chromeos_policy_unittest.cc",
Miriam Polzeraff72002020-08-27 08:20:39 +0200529 "update_manager/enterprise_device_policy_impl_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900530 "update_manager/evaluation_context_unittest.cc",
531 "update_manager/generic_variables_unittest.cc",
Saurabh Nijhara79fec2d2020-11-10 23:22:58 +0100532 "update_manager/minimum_version_policy_impl_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900533 "update_manager/prng_unittest.cc",
534 "update_manager/real_device_policy_provider_unittest.cc",
535 "update_manager/real_random_provider_unittest.cc",
536 "update_manager/real_shill_provider_unittest.cc",
537 "update_manager/real_system_provider_unittest.cc",
538 "update_manager/real_time_provider_unittest.cc",
539 "update_manager/real_updater_provider_unittest.cc",
540 "update_manager/staging_utils_unittest.cc",
541 "update_manager/update_manager_unittest.cc",
542 "update_manager/update_time_restrictions_policy_impl_unittest.cc",
543 "update_manager/variable_unittest.cc",
544 "update_manager/weekly_time_unittest.cc",
Jae Hoon Kim916af852019-08-01 17:45:30 -0700545 "update_status_utils_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900546 ]
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700547 if (use.dlc) {
Amin Hassaniec7bc112020-10-29 16:47:58 -0700548 sources += [ "cros/excluder_chromeos_unittest.cc" ]
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700549 }
Brian Norris0ffa71f2019-07-08 10:25:54 -0700550
Keigo Okaec39a222019-06-27 13:51:07 +0900551 # //common-mk:test should be on the top.
552 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
553 configs += [
554 "//common-mk:test",
555 ":target_defaults",
556 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900557 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900558 "libbrillo-test",
Qijiang Fanb78e1bc2020-10-27 16:31:39 +0900559 "libchrome-test",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900560 "libdebugd-client-test",
561 "libpower_manager-client-test",
562 "libsession_manager-client-test",
563 "libshill-client-test",
564 ]
565 deps = [
566 ":libpayload_generator",
567 ":libupdate_engine",
568 ":update_engine_test_libs",
569 ]
570 }
571}
572
573# Fuzzer target.
574if (use.fuzzer) {
Amin Hassani6f0366d2019-10-14 14:56:43 -0700575 executable("update_engine_delta_performer_fuzzer") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800576 sources = [ "payload_consumer/delta_performer_fuzzer.cc" ]
Amin Hassani6f0366d2019-10-14 14:56:43 -0700577 configs += [
578 "//common-mk/common_fuzzer",
579 ":target_defaults",
580 ]
581 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900582 "libbrillo-test",
Qijiang Fanb78e1bc2020-10-27 16:31:39 +0900583 "libchrome-test",
Amin Hassani6f0366d2019-10-14 14:56:43 -0700584 ]
585 deps = [
586 ":libupdate_engine",
587 ":update_engine_test_libs",
588 ]
589 }
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900590 executable("update_engine_omaha_request_action_fuzzer") {
Amin Hassaniec7bc112020-10-29 16:47:58 -0700591 sources = [ "cros/omaha_request_action_fuzzer.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900592 configs += [
593 "//common-mk/common_fuzzer",
594 ":target_defaults",
595 ]
596 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900597 "libbrillo-test",
Qijiang Fanb78e1bc2020-10-27 16:31:39 +0900598 "libchrome-test",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900599 ]
600 deps = [
601 ":libupdate_engine",
602 ":update_engine_test_libs",
603 ]
604 }
605}