blob: e8b92c6a5d34cdf7cec5921b3ec1634625950aba [file] [log] [blame]
# Copyright 2019 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/rust/rustc_binary.gni")
import("//build/rust/rustc_test.gni")
import("//build/test/test_package.gni")
group("tests") {
testonly = true
deps = [ ":rights_integration_test" ]
}
rustc_test("rights_integration_test_bin") {
name = "rights_integration_test"
edition = "2018"
source_root = "rights_integration_test.rs"
deps = [
"//src/lib/fdio/rust:fdio",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-runtime",
"//src/lib/scoped_task",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/component_manager/tests:test_utils_lib",
"//src/sys/component_manager/tests/fidl:components-rustc",
"//third_party/rust_crates:anyhow",
"//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc",
]
# TODO(46776): Fix the leaks and remove this.
non_rust_deps = [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ]
}
executable("expose_dir_rights") {
sources = [ "expose_dir_rights.cc" ]
deps = [
"//zircon/public/lib/async-loop-cpp",
"//zircon/public/lib/async-loop-default",
"//zircon/public/lib/fs",
"//zircon/public/lib/memfs",
"//zircon/public/lib/zx",
"//zircon/system/fidl/fuchsia-io",
"//zircon/system/ulib/svc",
]
}
rustc_binary("use_dir_rights") {
edition = "2018"
source_root = "use_dir_rights.rs"
deps = [
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/component_manager/tests/fidl:components-rustc",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
"//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc",
]
}
rustc_binary("component_manager_for_rights_test") {
edition = "2018"
source_root = "component_manager.rs"
deps = [
"//garnet/lib/rust/files_async",
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.test.manager:fuchsia.test.manager-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-runtime",
"//src/lib/storage/pseudo-fs",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/component_manager:lib",
"//src/sys/component_manager/tests/fidl:components-rustc",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
"//third_party/rust_crates:thiserror",
"//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc",
]
}
rustc_binary("use_storage") {
edition = "2018"
source_root = "use_storage.rs"
deps = [
"//garnet/lib/rust/io_util",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/component_manager/tests/fidl:components-rustc",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
"//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc",
]
}
test_package("rights_integration_test") {
deps = [
":component_manager_for_rights_test",
":expose_dir_rights",
":rights_integration_test_bin",
":use_dir_rights",
":use_storage",
]
meta = [
{
path = rebase_path("meta/component_manager_for_rights_test.cmx")
dest = "component_manager_for_rights_test.cmx"
},
{
path = rebase_path("meta/use_dir_rights.cml")
dest = "use_dir_rights.cm"
},
{
path = rebase_path("meta/expose_dir_rights.cml")
dest = "expose_dir_rights.cm"
},
{
path = rebase_path("meta/root_offer_dir_rights.cml")
dest = "root_offer_dir_rights.cm"
},
{
path = rebase_path("meta/invalid_use_dir_rights.cml")
dest = "invalid_use_dir_rights.cm"
},
{
path = rebase_path("meta/root_invalid_use_in_offer_dir_rights.cml")
dest = "root_invalid_use_in_offer_dir_rights.cm"
},
{
path = rebase_path("meta/root_invalid_offer_dir_rights.cml")
dest = "root_invalid_offer_dir_rights.cm"
},
{
path = rebase_path(
"meta/root_invalid_expose_intermediate_offer_dir_rights.cml")
dest = "root_invalid_expose_intermediate_offer_dir_rights.cm"
},
{
path = rebase_path("meta/invalid_intermediate_expose_dir_rights.cml")
dest = "invalid_intermediate_expose_dir_rights.cm"
},
{
path = rebase_path("meta/intermediate_expose_dir_rights.cml")
dest = "intermediate_expose_dir_rights.cm"
},
{
path = rebase_path("meta/root_expose_intermediate_offer_dir_rights.cml")
dest = "root_expose_intermediate_offer_dir_rights.cm"
},
{
path = rebase_path("meta/intermediate_offer_dir_rights.cml")
dest = "intermediate_offer_dir_rights.cm"
},
{
path = rebase_path("meta/root_offer_intermediate_offer_dir_rights.cml")
dest = "root_offer_intermediate_offer_dir_rights.cm"
},
{
path = rebase_path("meta/invalid_intermediate_offer_dir_rights.cml")
dest = "invalid_intermediate_offer_dir_rights.cm"
},
{
path = rebase_path(
"meta/root_invalid_offer_intermediate_offer_dir_rights.cml")
dest = "root_invalid_offer_intermediate_offer_dir_rights.cm"
},
{
path = rebase_path("meta/root_alias_offer_dir_rights.cml")
dest = "root_alias_offer_dir_rights.cm"
},
{
path = rebase_path("meta/root_invalid_storage_offer_rights.cml")
dest = "root_invalid_storage_offer_rights.cm"
},
{
path = rebase_path("meta/root_storage_offer_rights.cml")
dest = "root_storage_offer_rights.cm"
},
{
path = rebase_path("meta/use_storage.cml")
dest = "use_storage.cm"
},
]
binaries = [
{
name = "use_dir_rights"
},
{
name = "use_storage"
},
{
name = "expose_dir_rights"
},
{
name = "component_manager_for_rights_test"
},
]
tests = [
{
name = "rights_integration_test"
},
]
}