Skip to content
Draft
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
82 changes: 52 additions & 30 deletions Cargo.lock

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

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ members = [
"sled-agent/bootstrap-agent-lockstep-api",
"sled-agent/bootstrap-agent-lockstep-types",
"sled-agent/config-reconciler",
"sled-agent/scrimlet-reconcilers",
"sled-agent/health-monitor",
"sled-agent/measurements",
"sled-agent/rack-setup",
Expand Down Expand Up @@ -333,6 +334,7 @@ default-members = [
"sled-agent/bootstrap-agent-lockstep-api",
"sled-agent/bootstrap-agent-lockstep-types",
"sled-agent/config-reconciler",
"sled-agent/scrimlet-reconcilers",
"sled-agent/health-monitor",
"sled-agent/measurements",
"sled-agent/rack-setup",
Expand Down Expand Up @@ -727,7 +729,7 @@ propolis_api_types = { git = "https://github.com/oxidecomputer/propolis", rev =
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "bc489ddf0f38f75e0c194b86cf6f0de377f68845" }
propolis-mock-server = { git = "https://github.com/oxidecomputer/propolis", rev = "bc489ddf0f38f75e0c194b86cf6f0de377f68845" }
# NOTE: see above!
proptest = "1.7.0"
proptest = "1.11.0"
qorb = "0.4.1"
quote = "1.0"
# Some dependencies still require rand 0.8.x.
Expand Down Expand Up @@ -792,6 +794,7 @@ sled-agent-config-reconciler = { path = "sled-agent/config-reconciler" }
sled-agent-health-monitor = { path = "sled-agent/health-monitor" }
sled-agent-measurements = { path = "sled-agent/measurements" }
sled-agent-rack-setup = { path = "sled-agent/rack-setup" }
sled-agent-scrimlet-reconcilers = { path = "sled-agent/scrimlet-reconcilers" }
sled-agent-types = { path = "sled-agent/types" }
sled-agent-types-versions = { path = "sled-agent/types/versions" }
sled-agent-resolvable-files = { path = "sled-agent/resolvable-files" }
Expand Down
6 changes: 5 additions & 1 deletion gateway-test-utils/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub const DEFAULT_SP_SIM_CONFIG: &str =
pub struct GatewayTestContext {
pub client: gateway_client::Client,
pub server: omicron_gateway::Server,
pub port: u16,
port: u16,
pub simrack: SimRack,
pub logctx: LogContext,
pub gateway_id: Uuid,
Expand All @@ -47,6 +47,10 @@ pub struct GatewayTestContext {
}

impl GatewayTestContext {
pub fn address(&self) -> SocketAddrV6 {
SocketAddrV6::new(Ipv6Addr::LOCALHOST, self.port, 0, 0)
}

pub fn mgs_backends(&self) -> watch::Receiver<AllBackends> {
self.resolver_backends.clone()
}
Expand Down
3 changes: 2 additions & 1 deletion nexus/reconfigurator/execution/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ pub fn overridables_for_test(
for (id_str, switch_slot) in scrimlets {
let sled_id = id_str.parse().unwrap();
let ip = Ipv6Addr::LOCALHOST;
let mgs_port = cptestctx.gateway.get(&switch_slot).unwrap().port;
let mgs_port =
cptestctx.gateway.get(&switch_slot).unwrap().address().port();
let dendrite_port =
cptestctx.dendrite.read().unwrap().get(&switch_slot).unwrap().port;
let mgd_port = cptestctx.mgd.get(&switch_slot).unwrap().port;
Expand Down
4 changes: 1 addition & 3 deletions nexus/src/app/sagas/instance_start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,6 @@ async fn sis_ensure_running(
#[cfg(test)]
mod test {
use core::time::Duration;
use std::net::SocketAddrV6;

use crate::app::sagas::disk_delete::test::ExpungeTestHarness;
use crate::app::sagas::disk_delete::test::create_disk;
Expand Down Expand Up @@ -1493,8 +1492,7 @@ mod test {
// Reuse the port number from the removed Switch0 to start a new dendrite instance
let nexus_address = cptestctx.internal_client.bind_address;
let mgs = cptestctx.gateway.get(&SwitchSlot::Switch0).unwrap();
let mgs_address =
SocketAddrV6::new(Ipv6Addr::LOCALHOST, mgs.port, 0, 0).into();
let mgs_address = mgs.address().into();

// Test fault recovery for nat propogation
// Start a new dendrite instance for switch0
Expand Down
12 changes: 6 additions & 6 deletions nexus/src/app/sagas/instance_update/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2777,13 +2777,13 @@ mod test {
cptestctx: &ControlPlaneTestContext,
switch0_port: u16,
) {
use std::net::Ipv6Addr;
use std::net::SocketAddrV6;

let nexus_address = cptestctx.internal_client.bind_address;
let mgs = cptestctx.gateway.get(&SwitchSlot::Switch0).unwrap();
let mgs_address =
SocketAddrV6::new(Ipv6Addr::LOCALHOST, mgs.port, 0, 0).into();
let mgs_address = cptestctx
.gateway
.get(&SwitchSlot::Switch0)
.unwrap()
.address()
.into();

let new_switch0 =
omicron_test_utils::dev::dendrite::DendriteInstance::start(
Expand Down
8 changes: 1 addition & 7 deletions nexus/test-utils/src/nexus_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,7 @@ impl<N: NexusServer> ControlPlaneTestContext<N> {
};

let mgs = self.gateway.get(&switch_slot).unwrap();
let mgs_addr = std::net::SocketAddrV6::new(
std::net::Ipv6Addr::LOCALHOST,
mgs.port,
0,
0,
)
.into();
let mgs_addr = mgs.address().into();

let dendrite =
omicron_test_utils::dev::dendrite::DendriteInstance::start(
Expand Down
9 changes: 3 additions & 6 deletions nexus/test-utils/src/starter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,7 @@ impl<'a, N: NexusServer> ControlPlaneStarter<'a, N> {
let log = &self.logctx.log;
debug!(log, "Starting Dendrite"; "switch_slot" => ?switch_slot);
let mgs = self.gateway.get(&switch_slot).unwrap();
let mgs_addr =
SocketAddrV6::new(Ipv6Addr::LOCALHOST, mgs.port, 0, 0).into();
let mgs_addr = mgs.address().into();

// Set up a stub instance of dendrite
let dendrite = dev::dendrite::DendriteInstance::start(
Expand All @@ -448,9 +447,7 @@ impl<'a, N: NexusServer> ControlPlaneStarter<'a, N> {
pub async fn start_mgd(&mut self, switch_slot: SwitchSlot) {
let log = &self.logctx.log;
debug!(log, "Starting mgd"; "switch_slot" => ?switch_slot);
let mgs = self.gateway.get(&switch_slot).unwrap();
let mgs_addr =
SocketAddrV6::new(Ipv6Addr::LOCALHOST, mgs.port, 0, 0).into();
let mgs_addr = self.gateway.get(&switch_slot).unwrap().address().into();

// Set up an instance of mgd
let mgd =
Expand Down Expand Up @@ -484,7 +481,7 @@ impl<'a, N: NexusServer> ControlPlaneStarter<'a, N> {
sled_id,
Ipv6Addr::LOCALHOST,
self.dendrite.read().unwrap().get(&switch_slot).unwrap().port,
self.gateway.get(&switch_slot).unwrap().port,
self.gateway.get(&switch_slot).unwrap().address().port(),
self.mgd.get(&switch_slot).unwrap().port,
)
.unwrap()
Expand Down
Loading
Loading