blob: a6b19623ebaa52ddb2b799db664d6523f35cd839 [file] [log] [blame]
// 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.
use {
fidl_fuchsia_io as fio, fuchsia_async as fasync,
test_utils_lib::{events::*, matcher::EventMatcher, opaque_test::*},
/// This uses the implementation to make the test package's
/// contents appear at /pkgfs. This allows component manager's built-in base
/// package resolver to see the contents of the package. HOWEVER, the component
/// manager configuration here sets the built-in resolver to 'None', meaning we
/// expect the attempt to start `echo_server` to not resolve.
async fn base_resolver_appmgr_bridge_test() {
// Obtain access to this component's pkg directory
let pkg_proxy = io_util::open_directory_in_namespace(
let pkg_channel = pkg_proxy.into_channel().unwrap().into_zx_channel();
// Create an OpaqueTest that uses the appmgr bridge config
let test = OpaqueTestBuilder::new("fuchsia-boot:///#meta/")
.add_dir_handle("/boot", pkg_channel.into())
let event_source = test.connect_to_event_source().await.unwrap();
// Subscribe to events and begin execution of component manager
let mut event_stream = event_source.subscribe(vec![Started::NAME]).await.unwrap();
// Begin component manager's execution
// Expect the root component to be bound to
let event = EventMatcher::ok().moniker(".").expect_match::<Started>(&mut event_stream).await;
// // Expect start to succeed because we're using the appmgr loader
let event = EventMatcher::ok()
.expect_match::<Started>(&mut event_stream)