Skip to content

Commit

Permalink
Patch blueprint edit
Browse files Browse the repository at this point in the history
  • Loading branch information
smklein committed Jun 24, 2024
1 parent 3c59610 commit 1270098
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion dev-tools/reconfigurator-cli/tests/test_basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use nexus_db_queries::authn;
use nexus_db_queries::authz;
use nexus_db_queries::context::OpContext;
use nexus_test_utils::SLED_AGENT_UUID;
use nexus_test_utils::resource_helpers::DiskTestBuilder;
use nexus_test_utils_macros::nexus_test;
use nexus_types::deployment::Blueprint;
use nexus_types::deployment::UnstableReconfiguratorState;
Expand All @@ -20,6 +21,7 @@ use omicron_test_utils::dev::test_cmds::path_to_executable;
use omicron_test_utils::dev::test_cmds::redact_variable;
use omicron_test_utils::dev::test_cmds::run_command;
use omicron_test_utils::dev::test_cmds::EXIT_SUCCESS;
use omicron_uuid_kinds::GenericUuid;
use omicron_uuid_kinds::SledUuid;
use slog::debug;
use std::io::BufReader;
Expand Down Expand Up @@ -56,6 +58,24 @@ type ControlPlaneTestContext =
#[nexus_test]
async fn test_blueprint_edit(cptestctx: &ControlPlaneTestContext) {
// Setup
//
// Add a zpool to both sleds, just to ensure that all new zones can find
// a transient filesystem wherever they end up being placed.
let _sled_agent_zpools = DiskTestBuilder::new(&cptestctx)
.on_sled(SledUuid::from_untyped_uuid(
cptestctx.sled_agent.sled_agent.id,
))
.with_zpool_count(1)
.build()
.await;
let _sled_agent2_zpools = DiskTestBuilder::new(&cptestctx)
.on_sled(SledUuid::from_untyped_uuid(
cptestctx.sled_agent2.sled_agent.id,
))
.with_zpool_count(1)
.build()
.await;

let nexus = &cptestctx.server.server_context().nexus;
let datastore = nexus.datastore();
let log = &cptestctx.logctx.log;
Expand Down Expand Up @@ -155,7 +175,7 @@ async fn test_blueprint_edit(cptestctx: &ControlPlaneTestContext) {
// Load the new file and find the new blueprint name.
let state2: UnstableReconfiguratorState =
read_json(&saved_state2_path).unwrap();
assert_eq!(state2.blueprints.len(), state1.blueprints.len() + 1);
assert_eq!(state2.blueprints.len(), state1.blueprints.len() + 1); // XXX
let new_blueprint = state2.blueprints.into_iter().rev().next().unwrap();
assert_ne!(new_blueprint.id, blueprint.id);

Expand Down

0 comments on commit 1270098

Please sign in to comment.