blob: 3674f50eef69667a5fc199d941f60916c5167390 [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",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900149 "payload_consumer/bzip_extent_writer.cc",
150 "payload_consumer/cached_file_descriptor.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700151 "payload_consumer/certificate_parser_stub.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900152 "payload_consumer/delta_performer.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900153 "payload_consumer/extent_reader.cc",
154 "payload_consumer/extent_writer.cc",
155 "payload_consumer/file_descriptor.cc",
156 "payload_consumer/file_descriptor_utils.cc",
157 "payload_consumer/file_writer.cc",
158 "payload_consumer/filesystem_verifier_action.cc",
159 "payload_consumer/install_plan.cc",
160 "payload_consumer/mount_history.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700161 "payload_consumer/partition_update_generator_stub.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900162 "payload_consumer/payload_constants.cc",
163 "payload_consumer/payload_metadata.cc",
164 "payload_consumer/payload_verifier.cc",
165 "payload_consumer/postinstall_runner_action.cc",
166 "payload_consumer/verity_writer_stub.cc",
167 "payload_consumer/xz_extent_writer.cc",
168 ]
169 configs += [ ":target_defaults" ]
170 libs = [
171 "bz2",
172 "rt",
173 ]
174
Allen Webb975e8662020-05-14 14:33:13 -0700175 # TODO(crbug.com/1082873): Remove after fixing usage of deprecated
176 # declarations.
177 cflags_cc = [ "-Wno-error=deprecated-declarations" ]
178
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900179 # TODO(deymo): Remove unused dependencies once we stop including files
180 # from the root directory.
181 all_dependent_pkg_deps = [
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900182 "libbspatch",
Clark Chunge6b888c2020-04-20 15:50:37 +0800183 "libcrypto",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900184 "libpuffpatch",
Clark Chunge6b888c2020-04-20 15:50:37 +0800185 "xz-embedded",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900186 ]
Tatsuhisa Yamaguchi74e47d92020-05-27 05:32:16 +0000187 public_deps = [ ":update_metadata-protos" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900188}
189
190# The main daemon static_library with all the code used to check for updates
191# with Omaha and expose a DBus daemon.
192static_library("libupdate_engine") {
193 sources = [
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900194 "certificate_checker.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700195 "common/connection_utils.cc",
Amin Hassani538bd592020-11-04 20:46:08 -0800196 "common/system_state.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700197 "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",
Amin Hassani538bd592020-11-04 20:46:08 -0800219 "download_action.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900220 "libcurl_http_fetcher.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900221 "metrics_utils.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900222 "update_boot_flags_action.cc",
223 "update_manager/boxed_value.cc",
224 "update_manager/chromeos_policy.cc",
225 "update_manager/default_policy.cc",
226 "update_manager/enough_slots_ab_updates_policy_impl.cc",
227 "update_manager/enterprise_device_policy_impl.cc",
Saurabh Nijharaac834882020-11-11 14:10:47 +0100228 "update_manager/enterprise_rollback_policy_impl.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900229 "update_manager/evaluation_context.cc",
230 "update_manager/interactive_update_policy_impl.cc",
Saurabh Nijhara79fec2d2020-11-10 23:22:58 +0100231 "update_manager/minimum_version_policy_impl.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900232 "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",
Amin Hassani64a80162020-11-09 16:58:17 -0800274 ":update_engine-dbus-kiosk-app-client",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900275 ":update_metadata-protos",
276 ]
277
278 if (use.dlc) {
279 all_dependent_pkg_deps += [ "libdlcservice-client" ]
280 }
281
282 if (use.chrome_network_proxy) {
Amin Hassaniec7bc112020-10-29 16:47:58 -0700283 sources += [ "cros/chrome_browser_proxy_resolver.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900284 }
285
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900286 if (use.dlc) {
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700287 sources += [
Amin Hassaniec7bc112020-10-29 16:47:58 -0700288 "cros/dlcservice_chromeos.cc",
289 "cros/excluder_chromeos.cc",
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700290 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900291 } else {
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700292 sources += [
293 "common/dlcservice_stub.cc",
294 "common/excluder_stub.cc",
295 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900296 }
297}
298
299# update_engine daemon.
300executable("update_engine") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800301 sources = [ "main.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900302 configs += [ ":target_defaults" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800303 deps = [ ":libupdate_engine" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900304}
305
306# update_engine client library.
307static_library("libupdate_engine_client") {
308 sources = [
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900309 "client_library/client_dbus.cc",
310 "update_status_utils.cc",
311 ]
312 include_dirs = [ "client_library/include" ]
313 configs += [ ":target_defaults" ]
314 pkg_deps = [
315 "dbus-1",
316 "libupdate_engine-client",
317 ]
318}
319
320# update_engine console client.
321executable("update_engine_client") {
322 sources = [
323 "common/error_code_utils.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700324 "cros/omaha_utils.cc",
325 "cros/update_engine_client.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900326 ]
327 configs += [ ":target_defaults" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800328 deps = [ ":libupdate_engine_client" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900329}
330
331# server-side code. This is used for delta_generator and unittests but not
332# for any client code.
333static_library("libpayload_generator") {
334 sources = [
335 "common/file_fetcher.cc",
Amin Hassani538bd592020-11-04 20:46:08 -0800336 "common/system_state.cc",
337 "cros/real_system_state.cc",
338 "download_action.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900339 "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",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700397 "cros/fake_shill_proxy.cc",
398 "cros/fake_system_state.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900399 "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",
423 "unittest_key2.pem",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700424 "unittest_key_RSA4096.pem",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900425 ]
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"
Amin Hassaniec7bc112020-10-29 16:47:58 -0700432 sources = [ "unittest_key_EC.pem" ]
Amin Hassanie53b39b2020-09-16 11:19:28 -0700433 }
434
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900435 # Unpacks sample images used for testing.
436 tar_bunzip2("update_engine-test_images") {
437 image_out_dir = "."
Clark Chunge6b888c2020-04-20 15:50:37 +0800438 sources = [ "sample_images/sample_images.tar.bz2" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900439 }
440
441 # Test HTTP Server.
442 executable("test_http_server") {
443 sources = [
444 "common/http_common.cc",
445 "test_http_server.cc",
446 ]
Brian Norris0ffa71f2019-07-08 10:25:54 -0700447
Keigo Okaec39a222019-06-27 13:51:07 +0900448 # //common-mk:test should be on the top.
449 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
450 configs += [
451 "//common-mk:test",
452 ":target_defaults",
453 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900454 }
455
456 # Test subprocess helper.
457 executable("test_subprocess") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800458 sources = [ "test_subprocess.cc" ]
Brian Norris0ffa71f2019-07-08 10:25:54 -0700459
Keigo Okaec39a222019-06-27 13:51:07 +0900460 # //common-mk:test should be on the top.
461 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
462 configs += [
463 "//common-mk:test",
464 ":target_defaults",
465 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900466 }
467
468 # Main unittest file.
469 executable("update_engine_unittests") {
470 sources = [
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900471 "certificate_checker_unittest.cc",
472 "common/action_pipe_unittest.cc",
473 "common/action_processor_unittest.cc",
474 "common/action_unittest.cc",
475 "common/cpu_limiter_unittest.cc",
476 "common/hash_calculator_unittest.cc",
477 "common/http_fetcher_unittest.cc",
478 "common/hwid_override_unittest.cc",
479 "common/prefs_unittest.cc",
480 "common/proxy_resolver_unittest.cc",
481 "common/subprocess_unittest.cc",
482 "common/terminator_unittest.cc",
483 "common/utils_unittest.cc",
Amin Hassaniec7bc112020-10-29 16:47:58 -0700484 "cros/boot_control_chromeos_unittest.cc",
485 "cros/common_service_unittest.cc",
486 "cros/connection_manager_unittest.cc",
487 "cros/hardware_chromeos_unittest.cc",
488 "cros/image_properties_chromeos_unittest.cc",
489 "cros/metrics_reporter_omaha_unittest.cc",
490 "cros/omaha_request_action_unittest.cc",
491 "cros/omaha_request_builder_xml_unittest.cc",
492 "cros/omaha_request_params_unittest.cc",
493 "cros/omaha_response_handler_action_unittest.cc",
494 "cros/omaha_utils_unittest.cc",
495 "cros/p2p_manager_unittest.cc",
496 "cros/payload_state_unittest.cc",
497 "cros/requisition_util_unittest.cc",
498 "cros/update_attempter_unittest.cc",
499 "download_action_unittest.cc",
Jae Hoon Kim0ae8fe12019-06-26 14:32:50 -0700500 "libcurl_http_fetcher_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900501 "metrics_utils_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900502 "payload_consumer/bzip_extent_writer_unittest.cc",
503 "payload_consumer/cached_file_descriptor_unittest.cc",
504 "payload_consumer/delta_performer_integration_test.cc",
505 "payload_consumer/delta_performer_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900506 "payload_consumer/extent_reader_unittest.cc",
507 "payload_consumer/extent_writer_unittest.cc",
508 "payload_consumer/file_descriptor_utils_unittest.cc",
509 "payload_consumer/file_writer_unittest.cc",
510 "payload_consumer/filesystem_verifier_action_unittest.cc",
511 "payload_consumer/postinstall_runner_action_unittest.cc",
512 "payload_consumer/xz_extent_writer_unittest.cc",
513 "payload_generator/ab_generator_unittest.cc",
514 "payload_generator/blob_file_writer_unittest.cc",
515 "payload_generator/block_mapping_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900516 "payload_generator/deflate_utils_unittest.cc",
517 "payload_generator/delta_diff_utils_unittest.cc",
518 "payload_generator/ext2_filesystem_unittest.cc",
519 "payload_generator/extent_ranges_unittest.cc",
520 "payload_generator/extent_utils_unittest.cc",
521 "payload_generator/full_update_generator_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900522 "payload_generator/mapfile_filesystem_unittest.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700523 "payload_generator/merge_sequence_generator_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900524 "payload_generator/payload_file_unittest.cc",
525 "payload_generator/payload_generation_config_unittest.cc",
Jae Hoon Kim4b6d1262019-06-20 10:41:18 -0700526 "payload_generator/payload_properties_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900527 "payload_generator/payload_signer_unittest.cc",
528 "payload_generator/squashfs_filesystem_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900529 "payload_generator/zip_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900530 "testrunner.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900531 "update_boot_flags_action_unittest.cc",
532 "update_manager/boxed_value_unittest.cc",
533 "update_manager/chromeos_policy_unittest.cc",
Miriam Polzeraff72002020-08-27 08:20:39 +0200534 "update_manager/enterprise_device_policy_impl_unittest.cc",
Saurabh Nijharaac834882020-11-11 14:10:47 +0100535 "update_manager/enterprise_rollback_policy_impl_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900536 "update_manager/evaluation_context_unittest.cc",
537 "update_manager/generic_variables_unittest.cc",
Saurabh Nijhara79fec2d2020-11-10 23:22:58 +0100538 "update_manager/minimum_version_policy_impl_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900539 "update_manager/prng_unittest.cc",
540 "update_manager/real_device_policy_provider_unittest.cc",
541 "update_manager/real_random_provider_unittest.cc",
542 "update_manager/real_shill_provider_unittest.cc",
543 "update_manager/real_system_provider_unittest.cc",
544 "update_manager/real_time_provider_unittest.cc",
545 "update_manager/real_updater_provider_unittest.cc",
546 "update_manager/staging_utils_unittest.cc",
547 "update_manager/update_manager_unittest.cc",
548 "update_manager/update_time_restrictions_policy_impl_unittest.cc",
549 "update_manager/variable_unittest.cc",
550 "update_manager/weekly_time_unittest.cc",
Jae Hoon Kim916af852019-08-01 17:45:30 -0700551 "update_status_utils_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900552 ]
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700553 if (use.dlc) {
Amin Hassaniec7bc112020-10-29 16:47:58 -0700554 sources += [ "cros/excluder_chromeos_unittest.cc" ]
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700555 }
Brian Norris0ffa71f2019-07-08 10:25:54 -0700556
Keigo Okaec39a222019-06-27 13:51:07 +0900557 # //common-mk:test should be on the top.
558 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
559 configs += [
560 "//common-mk:test",
561 ":target_defaults",
562 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900563 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900564 "libbrillo-test",
Qijiang Fanb78e1bc2020-10-27 16:31:39 +0900565 "libchrome-test",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900566 "libdebugd-client-test",
567 "libpower_manager-client-test",
568 "libsession_manager-client-test",
569 "libshill-client-test",
570 ]
571 deps = [
572 ":libpayload_generator",
573 ":libupdate_engine",
574 ":update_engine_test_libs",
575 ]
576 }
577}
578
579# Fuzzer target.
580if (use.fuzzer) {
Amin Hassani6f0366d2019-10-14 14:56:43 -0700581 executable("update_engine_delta_performer_fuzzer") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800582 sources = [ "payload_consumer/delta_performer_fuzzer.cc" ]
Amin Hassani6f0366d2019-10-14 14:56:43 -0700583 configs += [
584 "//common-mk/common_fuzzer",
585 ":target_defaults",
586 ]
587 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900588 "libbrillo-test",
Qijiang Fanb78e1bc2020-10-27 16:31:39 +0900589 "libchrome-test",
Amin Hassani6f0366d2019-10-14 14:56:43 -0700590 ]
591 deps = [
592 ":libupdate_engine",
593 ":update_engine_test_libs",
594 ]
595 }
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900596 executable("update_engine_omaha_request_action_fuzzer") {
Amin Hassaniec7bc112020-10-29 16:47:58 -0700597 sources = [ "cros/omaha_request_action_fuzzer.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900598 configs += [
599 "//common-mk/common_fuzzer",
600 ":target_defaults",
601 ]
602 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900603 "libbrillo-test",
Qijiang Fanb78e1bc2020-10-27 16:31:39 +0900604 "libchrome-test",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900605 ]
606 deps = [
607 ":libupdate_engine",
608 ":update_engine_test_libs",
609 ]
610 }
611}