| # Copyright 2020 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/bind/bind.gni") |
| import("//build/components.gni") |
| import("//build/config/fuchsia/rules.gni") |
| import("//build/test.gni") |
| import("//zircon/system/ulib/devmgr-integration-test/isolated_devmgr.gni") |
| |
| source_set("verified-volume-client") { |
| sources = [ "verified-volume-client.cc" ] |
| deps = [ |
| "//sdk/fidl/fuchsia.device:fuchsia.device_llcpp", |
| "//sdk/fidl/fuchsia.hardware.block.verified:fuchsia.hardware.block.verified_llcpp", |
| "//src/lib/digest", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/fdio-caller", |
| "//zircon/system/ulib/ramdevice-client", |
| ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| source_set("geometry") { |
| sources = [ "geometry.cc" ] |
| } |
| |
| test("geometry-test") { |
| testonly = true |
| |
| output_name = "geometry-test" |
| sources = [ "geometry-tests.cc" ] |
| deps = [ |
| ":geometry", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| source_set("sealer") { |
| sources = [ |
| "hash-block-accumulator.cc", |
| "sealer.cc", |
| ] |
| deps = [ |
| "//src/lib/digest", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| test("sealer-test") { |
| testonly = true |
| |
| output_name = "sealer-test" |
| sources = [ "sealer-tests.cc" ] |
| deps = [ |
| ":geometry", |
| ":sealer", |
| "//src/lib/digest", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| source_set("block-verifier") { |
| sources = [ "block-verifier.cc" ] |
| deps = [ |
| "//src/lib/digest", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| test("block-verifier-test") { |
| testonly = true |
| |
| output_name = "block-verifier-test" |
| sources = [ "block-verifier-tests.cc" ] |
| deps = [ |
| ":block-verifier", |
| ":geometry", |
| "//src/lib/digest", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| source_set("config") { |
| sources = [ "config.cc" ] |
| public_deps = [ "//sdk/banjo/fuchsia.hardware.block" ] |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.block.verified:fuchsia.hardware.block.verified_llcpp", |
| "//src/lib/ddk", |
| ] |
| } |
| |
| test("config-test") { |
| testonly = true |
| output_name = "config-test" |
| sources = [ "config-tests.cc" ] |
| deps = [ |
| ":config", |
| "//sdk/fidl/fuchsia.hardware.block.verified:fuchsia.hardware.block.verified_llcpp", |
| "//src/devices/testing/no_ddk", |
| "//src/lib/ddk", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| bind_rules("bind") { |
| disable_autobind = true |
| rules = "block-verity.bind" |
| output = "block-verity-bind.h" |
| deps = [ "//src/devices/bind/fuchsia.hardware.block" ] |
| } |
| |
| bind_test("block-verity-bind-test") { |
| rules = "block-verity.bind" |
| tests = "bind-tests.json" |
| deps = [ "//src/devices/bind/fuchsia.hardware.block" ] |
| } |
| |
| driver_module("block-verity") { |
| output_name = "block-verity" |
| |
| sources = [ |
| "device-info.cc", |
| "device-manager.cc", |
| "device.cc", |
| "driver-sealer.cc", |
| "extra.cc", |
| "superblock-verifier.cc", |
| "verified-device.cc", |
| ] |
| |
| configs += [ "//build/config/fuchsia:integer-paranoia" ] |
| |
| deps = [ |
| ":bind", |
| ":block-verifier", |
| ":config", |
| ":geometry", |
| ":sealer", |
| "//sdk/banjo/fuchsia.hardware.block", |
| "//sdk/fidl/fuchsia.hardware.block.verified:fuchsia.hardware.block.verified_llcpp", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//src/lib/digest", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| test("block-verity-test") { |
| output_name = "block-verity-test" |
| sources = [ "block-verity-test.cc" ] |
| deps = [ |
| ":verified-volume-client", |
| "//sdk/fidl/fuchsia.device:fuchsia.device_llcpp", |
| "//sdk/fidl/fuchsia.hardware.block.verified:fuchsia.hardware.block.verified_llcpp", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_llcpp", |
| "//src/lib/digest", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/devmgr-integration-test", |
| "//zircon/system/ulib/devmgr-launcher", |
| "//zircon/system/ulib/driver-integration-test", |
| "//zircon/system/ulib/fdio-caller", |
| "//zircon/system/ulib/fvm-devices", |
| "//zircon/system/ulib/ramdevice-client", |
| ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| fuchsia_unittest_package("block-verity-geometry-test") { |
| deps = [ ":geometry-test" ] |
| } |
| |
| fuchsia_unittest_package("block-verity-sealer-test") { |
| deps = [ ":sealer-test" ] |
| } |
| |
| fuchsia_unittest_package("block-verity-block-verifier-test") { |
| deps = [ ":block-verifier-test" ] |
| } |
| |
| fuchsia_unittest_package("block-verity-config-test") { |
| deps = [ ":config-test" ] |
| } |
| |
| isolated_devmgr_unittest_package("block-verity-integration-test-package") { |
| package_name = "block-verity-test" |
| executable_path = "test/block-verity-test" |
| deps = [ |
| ":block-verity", |
| ":block-verity-test", |
| "//src/devices/block/drivers/core", |
| "//src/devices/block/drivers/ramdisk", |
| "//src/devices/board/drivers/integration-test", |
| "//src/devices/bus/drivers/platform", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":block-verity-bind-test", |
| ":block-verity-block-verifier-test", |
| ":block-verity-config-test", |
| ":block-verity-geometry-test", |
| ":block-verity-integration-test-package", |
| ":block-verity-sealer-test", |
| ] |
| } |