Skip to content

Commit

Permalink
change sled-agent test to use blippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jgallagher committed Jan 7, 2025
1 parent dabf6d4 commit 9283a4a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
1 change: 1 addition & 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 sled-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ guppy.workspace = true
hex-literal.workspace = true
http.workspace = true
hyper.workspace = true
nexus-reconfigurator-blippy.workspace = true
omicron-test-utils.workspace = true
pretty_assertions.workspace = true
rcgen.workspace = true
Expand Down
24 changes: 9 additions & 15 deletions sled-agent/src/rack_setup/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1733,6 +1733,7 @@ impl<'a> OmicronZonesConfigGenerator<'a> {
mod test {
use super::*;
use crate::rack_setup::plan::service::{Plan as ServicePlan, SledInfo};
use nexus_reconfigurator_blippy::{Blippy, BlippyReportSortKey};
use nexus_sled_agent_shared::inventory::{
Baseboard, Inventory, InventoryDisk, OmicronZoneType,
OmicronZonesConfig, SledRole,
Expand Down Expand Up @@ -1931,9 +1932,9 @@ mod test {
}

#[test]
fn only_crucible_datasets_have_addresses() {
fn rss_blueprint_is_blippy_clean() {
let logctx = omicron_test_utils::dev::test_setup_log(
"only_crucible_datasets_have_addresses",
"rss_blueprint_is_blippy_clean",
);

let fake_sleds = make_fake_sleds();
Expand Down Expand Up @@ -1962,19 +1963,12 @@ mod test {
)
.expect("built blueprint");

for dataset_config in blueprint.blueprint_datasets.into_values() {
for dataset in dataset_config.datasets.values() {
match dataset.kind {
DatasetKind::Crucible => assert!(
dataset.address.is_some(),
"crucible datasets should have addresses"
),
_ => assert_eq!(
dataset.address, None,
"non-crucible datasets should not have addresses"
),
}
}
let report =
Blippy::new(&blueprint).into_report(BlippyReportSortKey::Kind);

if !report.notes().is_empty() {
eprintln!("{}", report.display());
panic!("RSS blueprint should have no blippy notes");
}

logctx.cleanup_successful();
Expand Down

0 comments on commit 9283a4a

Please sign in to comment.