| # 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/component/config.gni") |
| import("//build/fidl/fidl.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_test.gni") |
| import("//src/sys/build/components.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":security-policy-critical-integration-test" ] |
| } |
| |
| rustc_test("security_policy_critical_integration_test_bin") { |
| name = "security_policy_critical_integration_test" |
| edition = "2018" |
| source_root = "security_policy_critical_integration_test.rs" |
| deps = [ |
| ":test.policy-rustc", |
| "../util:security_policy_test_util", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/component_manager/testing:test_utils_lib", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| ] |
| |
| sources = [ "security_policy_critical_integration_test.rs" ] |
| } |
| |
| fidl("test.policy") { |
| name = "test.policy" |
| sources = [ "policy.test.fidl" ] |
| public_deps = [ "//zircon/vdso/zx" ] |
| } |
| |
| rustc_binary("exit_on_command_bin") { |
| name = "exit_on_command" |
| edition = "2018" |
| source_root = "exit_on_command.rs" |
| deps = [ |
| ":test.policy-rustc", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| ] |
| |
| sources = [ "exit_on_command.rs" ] |
| } |
| |
| component_config("cm_config") { |
| sources = [ "cm_config.json" ] |
| } |
| |
| fuchsia_component("test_root") { |
| testonly = true |
| manifest = "meta/test_root.cml" |
| } |
| |
| fuchsia_component("exit_on_command") { |
| testonly = true |
| deps = [ ":exit_on_command_bin" ] |
| manifest = "meta/exit_on_command.cml" |
| } |
| |
| fuchsia_component("exit_on_command_no_request") { |
| testonly = true |
| deps = [ ":exit_on_command_bin" ] |
| manifest = "meta/exit_on_command_no_request.cml" |
| } |
| |
| fuchsia_component("component_manager") { |
| testonly = true |
| deps = [ "//src/sys/component_manager:bin" ] |
| manifest = "meta/cm_for_test.cmx" |
| } |
| |
| fuchsia_unittest_package("security-policy-critical-integration-test") { |
| manifest = "meta/security-policy-critical-integration-test.cmx" |
| deps = [ |
| ":cm_config", |
| ":component_manager", |
| ":exit_on_command", |
| ":exit_on_command_no_request", |
| ":security_policy_critical_integration_test_bin", |
| ":test_root", |
| ] |
| } |