blob: 1963537be7076ef18187b1485605c3f4f4c8cb7e [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/component/config.gni")
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 = [
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//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/testing:test_utils_lib",
"//src/sys/component_manager/tests/fidl:components-rustc",
"//third_party/rust_crates:anyhow",
]
sources = [ "rights_integration_test.rs" ]
}
executable("expose_dir_rights") {
sources = [ "expose_dir_rights.cc" ]
deps = [
"//sdk/fidl/fuchsia.io",
"//zircon/public/lib/zx",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fs",
"//zircon/system/ulib/memfs",
"//zircon/system/ulib/svc",
]
}
rustc_binary("use_dir_rights") {
edition = "2018"
source_root = "use_dir_rights.rs"
deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//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",
]
sources = [ "use_dir_rights.rs" ]
}
rustc_binary("use_storage") {
edition = "2018"
source_root = "use_storage.rs"
deps = [
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//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",
]
sources = [ "use_storage.rs" ]
}
component_config("component_manager_rights_test_config") {
sources = [ "rights_test_config.json" ]
}
test_package("rights_integration_test") {
deps = [
":component_manager_rights_test_config",
":expose_dir_rights",
":rights_integration_test_bin",
":use_dir_rights",
":use_storage",
"//src/sys/component_manager:bin",
]
resources = [
{
path = "${root_gen_dir}/src/sys/component_manager/tests/rights/component_manager_rights_test_config"
# OpaqueTest uses this path to search for config file.
dest = "component_manager_debug_config"
},
]
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"
},
]
tests = [
{
name = "rights_integration_test"
},
]
}