blob: 1f70e5cc29258a0cdcd0b307cbe34a8230c07250 [file] [log] [blame]
// Copyright 2018 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.
library fuchsia.netemul.environment;
using fuchsia.sys;
using fuchsia.netemul.network;
/// A single service to be launched in managed environment.
struct LaunchService {
/// Service name.
string name;
/// Service launch url (fuchsia component url).
string url;
/// Service launch arguments
vector<string>? arguments;
};
/// A single virtual device to make available for child processes.
/// Virtual devices are mounted on /vdev.
struct VirtualDevice {
/// Relative path to /vdev.
string path;
/// Virtual device server.
fuchsia.netemul.network.DeviceProxy device;
};
/// Options used to create environment.
struct EnvironmentOptions {
/// Environment name, for debugging purposes.
string name;
/// Services to register on environment.
vector<LaunchService> services;
/// Devices to make available.
vector<VirtualDevice> devices;
/// Whether to inherit service launch options from parent environment.
bool inherit_parent_launch_services;
};
/// Managed environment is made available on netemul runners.
/// Typically this interface will be used by the root runner
/// to setup the testing environment.
[Discoverable]
interface ManagedEnvironment {
/// Gets the managed launcher for the environment.
GetLauncher(request<fuchsia.sys.Launcher> launcher);
/// Creates a nested managed environment.
CreateChildEnvironment(request<ManagedEnvironment> child_env, EnvironmentOptions options);
/// Connects to a service named |name| provided by this environment.
ConnectToService(string name, handle<channel> req);
/// Exposes new virtual device |device| for all components within this environment
AddDevice(VirtualDevice device);
/// Removes virtual device mounted at |path| (relative to /vdev)
RemoveDevice(string path);
};