Skip to content

Commit 2d86023

Browse files
authored
[sp-sim] configurable initial contents of the cabooses (#8734)
This is a proposal for configurable cabooses in `sp-sim` and `omicron-dev run-all` environments. Closes: #7913
1 parent dab6693 commit 2d86023

File tree

18 files changed

+686
-94
lines changed

18 files changed

+686
-94
lines changed

Cargo.lock

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev-tools/mgs-dev/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ workspace = true
99

1010
[dependencies]
1111
anyhow.workspace = true
12+
camino.workspace = true
1213
clap.workspace = true
1314
futures.workspace = true
1415
gateway-messages.workspace = true

dev-tools/mgs-dev/src/main.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
//! Developer tool for running MGS.
66
7+
use camino::Utf8PathBuf;
78
use clap::{Args, Parser, Subcommand};
89
use futures::StreamExt;
10+
use gateway_test_utils::setup::DEFAULT_SP_SIM_CONFIG;
911
use libc::SIGINT;
1012
use signal_hook_tokio::Signals;
1113
use std::net::SocketAddr;
@@ -43,6 +45,9 @@ struct MgsRunArgs {
4345
/// Oximeter producer.
4446
#[clap(long)]
4547
nexus_address: Option<SocketAddr>,
48+
/// Override the sp-sim configuration file.
49+
#[clap(long, default_value = DEFAULT_SP_SIM_CONFIG)]
50+
sp_sim_config_file: Utf8PathBuf,
4651
}
4752

4853
impl MgsRunArgs {
@@ -54,7 +59,9 @@ impl MgsRunArgs {
5459

5560
println!("mgs-dev: setting up MGS ... ");
5661
let (mut mgs_config, sp_sim_config) =
57-
gateway_test_utils::setup::load_test_config();
62+
gateway_test_utils::setup::load_test_config(
63+
self.sp_sim_config_file.clone(),
64+
);
5865
if let Some(addr) = self.nexus_address {
5966
mgs_config.metrics =
6067
Some(gateway_test_utils::setup::MetricsConfig {

dev-tools/omicron-dev/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ omicron-rpaths.workspace = true
1212

1313
[dependencies]
1414
anyhow.workspace = true
15+
camino.workspace = true
1516
clap.workspace = true
1617
dropshot.workspace = true
1718
futures.workspace = true
19+
gateway-test-utils.workspace = true
1820
libc.workspace = true
1921
nexus-config.workspace = true
2022
nexus-test-interface.workspace = true

dev-tools/omicron-dev/src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
44

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

5055
impl RunAllArgs {
@@ -77,7 +82,7 @@ impl RunAllArgs {
7782
println!("omicron-dev: setting up all services ... ");
7883
let cptestctx = nexus_test_utils::omicron_dev_setup_with_config::<
7984
omicron_nexus::Server,
80-
>(&mut config, 0)
85+
>(&mut config, 0, self.gateway_config.clone())
8186
.await
8287
.context("error setting up services")?;
8388

0 commit comments

Comments
 (0)