Skip to content

[sp-sim] configurable initial contents of the cabooses #8734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dev-tools/mgs-dev/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ workspace = true

[dependencies]
anyhow.workspace = true
camino.workspace = true
clap.workspace = true
futures.workspace = true
gateway-messages.workspace = true
Expand Down
9 changes: 8 additions & 1 deletion dev-tools/mgs-dev/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

//! Developer tool for running MGS.

use camino::Utf8PathBuf;
use clap::{Args, Parser, Subcommand};
use futures::StreamExt;
use gateway_test_utils::setup::DEFAULT_SP_SIM_CONFIG;
use libc::SIGINT;
use signal_hook_tokio::Signals;
use std::net::SocketAddr;
Expand Down Expand Up @@ -43,6 +45,9 @@ struct MgsRunArgs {
/// Oximeter producer.
#[clap(long)]
nexus_address: Option<SocketAddr>,
/// Override the sp-sim configuration file.
#[clap(long, default_value = DEFAULT_SP_SIM_CONFIG)]
sp_sim_config_file: Utf8PathBuf,
}

impl MgsRunArgs {
Expand All @@ -54,7 +59,9 @@ impl MgsRunArgs {

println!("mgs-dev: setting up MGS ... ");
let (mut mgs_config, sp_sim_config) =
gateway_test_utils::setup::load_test_config();
gateway_test_utils::setup::load_test_config(
self.sp_sim_config_file.clone(),
);
if let Some(addr) = self.nexus_address {
mgs_config.metrics =
Some(gateway_test_utils::setup::MetricsConfig {
Expand Down
2 changes: 2 additions & 0 deletions dev-tools/omicron-dev/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ omicron-rpaths.workspace = true

[dependencies]
anyhow.workspace = true
camino.workspace = true
clap.workspace = true
dropshot.workspace = true
futures.workspace = true
gateway-test-utils.workspace = true
libc.workspace = true
nexus-config.workspace = true
nexus-test-interface.workspace = true
Expand Down
7 changes: 6 additions & 1 deletion dev-tools/omicron-dev/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use anyhow::Context;
use camino::Utf8PathBuf;
use clap::{Args, Parser, Subcommand};
use futures::StreamExt;
use gateway_test_utils::setup::DEFAULT_SP_SIM_CONFIG;
use libc::SIGINT;
use nexus_config::NexusConfig;
use nexus_test_interface::NexusServer;
Expand Down Expand Up @@ -45,6 +47,9 @@ struct RunAllArgs {
/// Nexus external API listen port. Use `0` to request any available port.
#[clap(long, action)]
nexus_listen_port: Option<u16>,
/// Override the gateway server configuration file.
#[clap(long, default_value = DEFAULT_SP_SIM_CONFIG)]
gateway_config: Utf8PathBuf,
}

impl RunAllArgs {
Expand Down Expand Up @@ -77,7 +82,7 @@ impl RunAllArgs {
println!("omicron-dev: setting up all services ... ");
let cptestctx = nexus_test_utils::omicron_dev_setup_with_config::<
omicron_nexus::Server,
>(&mut config, 0)
>(&mut config, 0, self.gateway_config.clone())
.await
.context("error setting up services")?;

Expand Down
Loading
Loading